diff --git a/googletest/test/googletest-param-test-test.cc b/googletest/test/googletest-param-test-test.cc index fab977e07..10d429c9a 100644 --- a/googletest/test/googletest-param-test-test.cc +++ b/googletest/test/googletest-param-test-test.cc @@ -696,7 +696,7 @@ class TestGenerationEnvironment : public ::testing::Environment { msg << "TestsExpandedAndRun/" << i; if (UnitTestOptions::FilterMatchesTest( "TestExpansionModule/MultipleTestGenerationTest", - msg.GetString().c_str())) { + msg.GetString())) { perform_check = true; } } diff --git a/googletest/test/googletest-printers-test.cc b/googletest/test/googletest-printers-test.cc index c5d9756d5..7d7e933e2 100644 --- a/googletest/test/googletest-printers-test.cc +++ b/googletest/test/googletest-printers-test.cc @@ -1699,7 +1699,7 @@ TEST(PrintToStringTest, ContainsNonLatin) { EXPECT_PRINT_TO_STRING_(non_ascii_str, "\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n" " As Text: \"오전 4:30\""); - non_ascii_str = ::std::string("From ä — ẑ"); + non_ascii_str = "From ä — ẑ"; EXPECT_PRINT_TO_STRING_(non_ascii_str, "\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\"" "\n As Text: \"From ä — ẑ\""); diff --git a/googletest/test/gtest_stress_test.cc b/googletest/test/gtest_stress_test.cc index af8e757dc..daebd4322 100644 --- a/googletest/test/gtest_stress_test.cc +++ b/googletest/test/gtest_stress_test.cc @@ -95,9 +95,9 @@ void ManyAsserts(int id) { // RecordProperty() should interact safely with other threads as well. // 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("shared_key", IdToString(id).c_str()); + Test::RecordProperty("shared_key", IdToString(id)); // This assertion should fail kThreadCount times per thread. It // is for testing whether Google Test can handle failed assertions in a diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index a31b7ba0b..3680b918b 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -2649,8 +2649,8 @@ TEST(IsSubstringTest, GeneratesCorrectMessageForCString) { // Tests that IsSubstring returns the correct result when the input // argument type is ::std::string. TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) { - EXPECT_TRUE(IsSubstring("", "", std::string("hello"), "ahellob")); - EXPECT_FALSE(IsSubstring("", "", "hello", std::string("world"))); + EXPECT_TRUE(IsSubstring("", "", "hello", "ahellob")); + EXPECT_FALSE(IsSubstring("", "", "hello", "world")); } #if GTEST_HAS_STD_WSTRING @@ -2707,8 +2707,8 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) { // Tests that IsNotSubstring returns the correct result when the input // argument type is ::std::string. TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) { - EXPECT_FALSE(IsNotSubstring("", "", std::string("hello"), "ahellob")); - EXPECT_TRUE(IsNotSubstring("", "", "hello", std::string("world"))); + EXPECT_FALSE(IsNotSubstring("", "", "hello", "ahellob")); + EXPECT_TRUE(IsNotSubstring("", "", "hello", "world")); } // Tests that IsNotSubstring() generates the correct message when the input @@ -2719,8 +2719,7 @@ TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) { " Actual: \"needle\"\n" "Expected: not a substring of haystack_expr\n" "Which is: \"two needles\"", - IsNotSubstring("needle_expr", "haystack_expr", ::std::string("needle"), - "two needles") + IsNotSubstring("needle_expr", "haystack_expr", "needle", "two needles") .failure_message()); } @@ -3655,8 +3654,7 @@ TEST(AssertionTest, EqFailure) { msg4.c_str()); const std::string msg5( - EqFailure("foo", "bar", std::string("\"x\""), std::string("\"y\""), true) - .failure_message()); + EqFailure("foo", "bar", "\"x\"", "\"y\"", true).failure_message()); EXPECT_STREQ( "Expected equality of these values:\n" " foo\n"