Skip to content

Commit 9706f75

Browse files
Abseil Teamcopybara-github
authored andcommitted
Automated Code Change
PiperOrigin-RevId: 813050069 Change-Id: I7c778db5bda5d681097af5d3569b5f4b980603e4
1 parent 50b8600 commit 9706f75

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

googletest/test/googletest-param-test-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ class TestGenerationEnvironment : public ::testing::Environment {
696696
msg << "TestsExpandedAndRun/" << i;
697697
if (UnitTestOptions::FilterMatchesTest(
698698
"TestExpansionModule/MultipleTestGenerationTest",
699-
msg.GetString().c_str())) {
699+
msg.GetString())) {
700700
perform_check = true;
701701
}
702702
}

googletest/test/googletest-printers-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ TEST(PrintToStringTest, ContainsNonLatin) {
16991699
EXPECT_PRINT_TO_STRING_(non_ascii_str,
17001700
"\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n"
17011701
" As Text: \"오전 4:30\"");
1702-
non_ascii_str = ::std::string("From ä — ẑ");
1702+
non_ascii_str = "From ä — ẑ";
17031703
EXPECT_PRINT_TO_STRING_(non_ascii_str,
17041704
"\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\""
17051705
"\n As Text: \"From ä — ẑ\"");

googletest/test/gtest_stress_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ void ManyAsserts(int id) {
9595

9696
// RecordProperty() should interact safely with other threads as well.
9797
// The shared_key forces property updates.
98-
Test::RecordProperty(IdToKey(id, "string").c_str(), IdToString(id).c_str());
98+
Test::RecordProperty(IdToKey(id, "string"), IdToString(id));
9999
Test::RecordProperty(IdToKey(id, "int").c_str(), id);
100-
Test::RecordProperty("shared_key", IdToString(id).c_str());
100+
Test::RecordProperty("shared_key", IdToString(id));
101101

102102
// This assertion should fail kThreadCount times per thread. It
103103
// is for testing whether Google Test can handle failed assertions in a

googletest/test/gtest_unittest.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,8 +2649,8 @@ TEST(IsSubstringTest, GeneratesCorrectMessageForCString) {
26492649
// Tests that IsSubstring returns the correct result when the input
26502650
// argument type is ::std::string.
26512651
TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) {
2652-
EXPECT_TRUE(IsSubstring("", "", std::string("hello"), "ahellob"));
2653-
EXPECT_FALSE(IsSubstring("", "", "hello", std::string("world")));
2652+
EXPECT_TRUE(IsSubstring("", "", "hello", "ahellob"));
2653+
EXPECT_FALSE(IsSubstring("", "", "hello", "world"));
26542654
}
26552655

26562656
#if GTEST_HAS_STD_WSTRING
@@ -2707,8 +2707,8 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) {
27072707
// Tests that IsNotSubstring returns the correct result when the input
27082708
// argument type is ::std::string.
27092709
TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) {
2710-
EXPECT_FALSE(IsNotSubstring("", "", std::string("hello"), "ahellob"));
2711-
EXPECT_TRUE(IsNotSubstring("", "", "hello", std::string("world")));
2710+
EXPECT_FALSE(IsNotSubstring("", "", "hello", "ahellob"));
2711+
EXPECT_TRUE(IsNotSubstring("", "", "hello", "world"));
27122712
}
27132713

27142714
// Tests that IsNotSubstring() generates the correct message when the input
@@ -2719,8 +2719,7 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) {
27192719
" Actual: \"needle\"\n"
27202720
"Expected: not a substring of haystack_expr\n"
27212721
"Which is: \"two needles\"",
2722-
IsNotSubstring("needle_expr", "haystack_expr", ::std::string("needle"),
2723-
"two needles")
2722+
IsNotSubstring("needle_expr", "haystack_expr", "needle", "two needles")
27242723
.failure_message());
27252724
}
27262725

@@ -3655,8 +3654,7 @@ TEST(AssertionTest, EqFailure) {
36553654
msg4.c_str());
36563655

36573656
const std::string msg5(
3658-
EqFailure("foo", "bar", std::string("\"x\""), std::string("\"y\""), true)
3659-
.failure_message());
3657+
EqFailure("foo", "bar", "\"x\"", "\"y\"", true).failure_message());
36603658
EXPECT_STREQ(
36613659
"Expected equality of these values:\n"
36623660
" foo\n"

0 commit comments

Comments
 (0)