Automated Code Change

PiperOrigin-RevId: 813050069
Change-Id: I7c778db5bda5d681097af5d3569b5f4b980603e4
This commit is contained in:
Abseil Team 2025-09-29 20:04:59 -07:00 committed by Copybara-Service
parent 50b8600c63
commit 9706f75b8f
4 changed files with 10 additions and 12 deletions

View File

@ -696,7 +696,7 @@ class TestGenerationEnvironment : public ::testing::Environment {
msg << "TestsExpandedAndRun/" << i; msg << "TestsExpandedAndRun/" << i;
if (UnitTestOptions::FilterMatchesTest( if (UnitTestOptions::FilterMatchesTest(
"TestExpansionModule/MultipleTestGenerationTest", "TestExpansionModule/MultipleTestGenerationTest",
msg.GetString().c_str())) { msg.GetString())) {
perform_check = true; perform_check = true;
} }
} }

View File

@ -1699,7 +1699,7 @@ TEST(PrintToStringTest, ContainsNonLatin) {
EXPECT_PRINT_TO_STRING_(non_ascii_str, EXPECT_PRINT_TO_STRING_(non_ascii_str,
"\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n" "\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n"
" As Text: \"오전 4:30\""); " As Text: \"오전 4:30\"");
non_ascii_str = ::std::string("From ä — ẑ"); non_ascii_str = "From ä — ẑ";
EXPECT_PRINT_TO_STRING_(non_ascii_str, EXPECT_PRINT_TO_STRING_(non_ascii_str,
"\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\"" "\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\""
"\n As Text: \"From ä — ẑ\""); "\n As Text: \"From ä — ẑ\"");

View File

@ -95,9 +95,9 @@ void ManyAsserts(int id) {
// RecordProperty() should interact safely with other threads as well. // RecordProperty() should interact safely with other threads as well.
// The shared_key forces property updates. // The shared_key forces property updates.
Test::RecordProperty(IdToKey(id, "string").c_str(), IdToString(id).c_str()); Test::RecordProperty(IdToKey(id, "string"), IdToString(id));
Test::RecordProperty(IdToKey(id, "int").c_str(), id); Test::RecordProperty(IdToKey(id, "int").c_str(), id);
Test::RecordProperty("shared_key", IdToString(id).c_str()); Test::RecordProperty("shared_key", IdToString(id));
// This assertion should fail kThreadCount times per thread. It // This assertion should fail kThreadCount times per thread. It
// is for testing whether Google Test can handle failed assertions in a // is for testing whether Google Test can handle failed assertions in a

View File

@ -2649,8 +2649,8 @@ TEST(IsSubstringTest, GeneratesCorrectMessageForCString) {
// Tests that IsSubstring returns the correct result when the input // Tests that IsSubstring returns the correct result when the input
// argument type is ::std::string. // argument type is ::std::string.
TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) { TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) {
EXPECT_TRUE(IsSubstring("", "", std::string("hello"), "ahellob")); EXPECT_TRUE(IsSubstring("", "", "hello", "ahellob"));
EXPECT_FALSE(IsSubstring("", "", "hello", std::string("world"))); EXPECT_FALSE(IsSubstring("", "", "hello", "world"));
} }
#if GTEST_HAS_STD_WSTRING #if GTEST_HAS_STD_WSTRING
@ -2707,8 +2707,8 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) {
// Tests that IsNotSubstring returns the correct result when the input // Tests that IsNotSubstring returns the correct result when the input
// argument type is ::std::string. // argument type is ::std::string.
TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) { TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) {
EXPECT_FALSE(IsNotSubstring("", "", std::string("hello"), "ahellob")); EXPECT_FALSE(IsNotSubstring("", "", "hello", "ahellob"));
EXPECT_TRUE(IsNotSubstring("", "", "hello", std::string("world"))); EXPECT_TRUE(IsNotSubstring("", "", "hello", "world"));
} }
// Tests that IsNotSubstring() generates the correct message when the input // Tests that IsNotSubstring() generates the correct message when the input
@ -2719,8 +2719,7 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) {
" Actual: \"needle\"\n" " Actual: \"needle\"\n"
"Expected: not a substring of haystack_expr\n" "Expected: not a substring of haystack_expr\n"
"Which is: \"two needles\"", "Which is: \"two needles\"",
IsNotSubstring("needle_expr", "haystack_expr", ::std::string("needle"), IsNotSubstring("needle_expr", "haystack_expr", "needle", "two needles")
"two needles")
.failure_message()); .failure_message());
} }
@ -3655,8 +3654,7 @@ TEST(AssertionTest, EqFailure) {
msg4.c_str()); msg4.c_str());
const std::string msg5( const std::string msg5(
EqFailure("foo", "bar", std::string("\"x\""), std::string("\"y\""), true) EqFailure("foo", "bar", "\"x\"", "\"y\"", true).failure_message());
.failure_message());
EXPECT_STREQ( EXPECT_STREQ(
"Expected equality of these values:\n" "Expected equality of these values:\n"
" foo\n" " foo\n"