diff --git a/src/google/protobuf/compiler/java/message_serialization_unittest.cc b/src/google/protobuf/compiler/java/message_serialization_unittest.cc index 51d66a2efc..521bce4511 100644 --- a/src/google/protobuf/compiler/java/message_serialization_unittest.cc +++ b/src/google/protobuf/compiler/java/message_serialization_unittest.cc @@ -13,7 +13,6 @@ #include "google/protobuf/testing/file.h" #include "google/protobuf/testing/file.h" #include -#include "google/protobuf/testing/googletest.h" #include #include "absl/log/absl_check.h" #include "absl/strings/str_cat.h" @@ -41,7 +40,7 @@ int CompileJavaProto(std::string proto_file_name) { std::string proto_path = absl::StrCat( "--proto_path=", TestUtil::GetTestDataPath("google/protobuf/compiler/java")); - std::string java_out = absl::StrCat("--java_out=", TestTempDir()); + std::string java_out = absl::StrCat("--java_out=", ::testing::TempDir()); const char* argv[] = { "protoc", @@ -61,7 +60,7 @@ TEST(MessageSerializationTest, CollapseAdjacentExtensionRanges) { ABSL_CHECK_OK(File::GetContents( // Open-source codebase does not support file::JoinPath, so we manually // concatenate instead. - absl::StrCat(TestTempDir(), + absl::StrCat(::testing::TempDir(), "/TestMessageWithManyExtensionRanges.java"), &java_source, true)); diff --git a/src/google/protobuf/compiler/java/plugin_unittest.cc b/src/google/protobuf/compiler/java/plugin_unittest.cc index 393f94d390..7a0f55df47 100644 --- a/src/google/protobuf/compiler/java/plugin_unittest.cc +++ b/src/google/protobuf/compiler/java/plugin_unittest.cc @@ -12,7 +12,6 @@ #include "google/protobuf/testing/file.h" #include "google/protobuf/testing/file.h" -#include "google/protobuf/testing/googletest.h" #include #include "absl/log/absl_check.h" #include "absl/strings/str_split.h" @@ -66,7 +65,7 @@ class TestGenerator : public CodeGenerator { // compiling the output which is a bit more than I care to do for this test. TEST(JavaPluginTest, PluginTest) { ABSL_CHECK_OK( - File::SetContents(absl::StrCat(TestTempDir(), "/test.proto"), + File::SetContents(absl::StrCat(::testing::TempDir(), "/test.proto"), "edition = \"2023\";\n" "package foo;\n" "option java_package = \"\";\n" @@ -88,9 +87,9 @@ TEST(JavaPluginTest, PluginTest) { cli.RegisterGenerator("--java_out", &java_generator, ""); cli.RegisterGenerator("--test_out", &test_generator, ""); - std::string proto_path = absl::StrCat("-I", TestTempDir()); - std::string java_out = absl::StrCat("--java_out=", TestTempDir()); - std::string test_out = absl::StrCat("--test_out=", TestTempDir()); + std::string proto_path = absl::StrCat("-I", ::testing::TempDir()); + std::string java_out = absl::StrCat("--java_out=", ::testing::TempDir()); + std::string test_out = absl::StrCat("--test_out=", ::testing::TempDir()); const char* argv[] = { "protoc", proto_path.c_str(), java_out.c_str(), @@ -102,8 +101,9 @@ TEST(JavaPluginTest, PluginTest) { // expect std::string output; - ABSL_CHECK_OK(File::GetContents(absl::StrCat(TestTempDir(), "/Test.java"), - &output, true)); + ABSL_CHECK_OK( + File::GetContents(absl::StrCat(::testing::TempDir(), "/Test.java"), + &output, true)); std::vector lines = absl::StrSplit(output, "\n"); bool found_generated_annotation = false; bool found_do_not_edit = false;