Fix windows test.
The problem was that LocalTempFilename returns a full path, not just a basename, so we were joining two full paths, which doesn't work on Windows. PiperOrigin-RevId: 324094697 Change-Id: I563f692ba6525097c95fda2a45ee9d565ac9c8a1
This commit is contained in:
parent
56bb1ccfaa
commit
26c01423d9
@ -176,7 +176,6 @@ cc_library(
|
|||||||
tf_cc_test(
|
tf_cc_test(
|
||||||
name = "journal_test",
|
name = "journal_test",
|
||||||
srcs = ["journal_test.cc"],
|
srcs = ["journal_test.cc"],
|
||||||
tags = ["no_windows"], # b/162268597
|
|
||||||
deps = [
|
deps = [
|
||||||
":common_proto_cc",
|
":common_proto_cc",
|
||||||
":journal",
|
":journal",
|
||||||
|
@ -29,11 +29,11 @@ namespace {
|
|||||||
using ::testing::HasSubstr;
|
using ::testing::HasSubstr;
|
||||||
|
|
||||||
bool NewJournalDir(std::string* journal_dir) {
|
bool NewJournalDir(std::string* journal_dir) {
|
||||||
std::string filename;
|
std::string filename = testing::TmpDir();
|
||||||
if (!Env::Default()->LocalTempFilename(&filename)) {
|
if (!Env::Default()->CreateUniqueFileName(&filename, "journal_dir")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*journal_dir = io::JoinPath(testing::TmpDir(), filename);
|
*journal_dir = filename;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user