From 0e8bb1954d79dcfbf068fb42f50fe6beca1fd929 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 26 Feb 2024 04:36:21 -0800 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 610367636 --- src/google/protobuf/compiler/cpp/metadata_test.cc | 5 ++--- src/google/protobuf/compiler/cpp/plugin_unittest.cc | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/metadata_test.cc b/src/google/protobuf/compiler/cpp/metadata_test.cc index 469d4b6b3d..734d58ffaa 100644 --- a/src/google/protobuf/compiler/cpp/metadata_test.cc +++ b/src/google/protobuf/compiler/cpp/metadata_test.cc @@ -13,7 +13,6 @@ #include "google/protobuf/compiler/command_line_interface.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor.pb.h" -#include "google/protobuf/testing/googletest.h" #include #include "absl/log/absl_check.h" #include "google/protobuf/compiler/annotation_test_util.h" @@ -45,7 +44,7 @@ class CppMetadataTest : public ::testing::Test { "--cpp_out=annotate_headers=true," "annotation_pragma_name=pragma_name," "annotation_guard_name=guard_name:", - TestTempDir()); + ::testing::TempDir()); const bool result = atu::RunProtoCompiler(filename, cpp_out, &cli, file); @@ -54,7 +53,7 @@ class CppMetadataTest : public ::testing::Test { } std::string output_base = - absl::StrCat(TestTempDir(), "/", StripProto(filename)); + absl::StrCat(::testing::TempDir(), "/", StripProto(filename)); if (pb_cc != nullptr) { ABSL_CHECK_OK(File::GetContents(absl::StrCat(output_base, ".pb.cc"), diff --git a/src/google/protobuf/compiler/cpp/plugin_unittest.cc b/src/google/protobuf/compiler/cpp/plugin_unittest.cc index 43695b2380..7f91da90f7 100644 --- a/src/google/protobuf/compiler/cpp/plugin_unittest.cc +++ b/src/google/protobuf/compiler/cpp/plugin_unittest.cc @@ -17,7 +17,6 @@ #include "google/protobuf/testing/file.h" #include "google/protobuf/compiler/cpp/generator.h" #include "google/protobuf/compiler/command_line_interface.h" -#include "google/protobuf/testing/googletest.h" #include #include "absl/log/absl_check.h" #include "google/protobuf/io/printer.h" @@ -150,7 +149,7 @@ class TestGenerator : public CodeGenerator { // compiling the output which is a bit more than I care to do for this test. TEST(CppPluginTest, PluginTest) { ABSL_CHECK_OK( - File::SetContents(absl::StrCat(TestTempDir(), "/test.proto"), + File::SetContents(absl::StrCat(::testing::TempDir(), "/test.proto"), "syntax = \"proto2\";\n" "package foo;\n" "\n" @@ -197,9 +196,9 @@ TEST(CppPluginTest, PluginTest) { cli.RegisterGenerator("--cpp_out", &cpp_generator, ""); cli.RegisterGenerator("--test_out", &test_generator, ""); - std::string proto_path = absl::StrCat("-I", TestTempDir()); - std::string cpp_out = absl::StrCat("--cpp_out=", TestTempDir()); - std::string test_out = absl::StrCat("--test_out=", TestTempDir()); + std::string proto_path = absl::StrCat("-I", ::testing::TempDir()); + std::string cpp_out = absl::StrCat("--cpp_out=", ::testing::TempDir()); + std::string test_out = absl::StrCat("--test_out=", ::testing::TempDir()); const char* argv[] = {"protoc", proto_path.c_str(), cpp_out.c_str(), test_out.c_str(), "test.proto"};