diff options
author | Alexander Nikforov <nikiforov.al@gmail.com> | 2022-07-01 22:33:13 (GMT) |
---|---|---|
committer | Alexander Nikforov <nikiforov.al@gmail.com> | 2022-07-01 22:33:13 (GMT) |
commit | 7107c441885900fedb8458a96bddca16e9768573 (patch) | |
tree | 0cc76011b4a44ece49f2745d9a755079cc9a506c /googletest | |
parent | 4219e7254cb8c473f57f6065bd13d1520d7b708f (diff) | |
download | googletest-7107c441885900fedb8458a96bddca16e9768573.zip googletest-7107c441885900fedb8458a96bddca16e9768573.tar.gz googletest-7107c441885900fedb8458a96bddca16e9768573.tar.bz2 |
cleanup from unique_ptr branchrefs/pull/3928/head
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 3 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 2 | ||||
-rw-r--r-- | googletest/test/googletest-param-test-test.cc | 4 | ||||
-rw-r--r-- | googletest/test/gtest-unittest-api_test.cc | 4 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 9b04e4c..527dc99 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -829,8 +829,7 @@ class TypeParameterizedTestSuite<Fixture, internal::None, Types> { // For example, if Foo() calls Bar(), which in turn calls // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(UnitTest* unit_test, - int skip_count); +GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(int skip_count); // Helpers for suppressing warnings on unreachable code or constant // condition. diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 6f31dd2..9989f71 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6245,7 +6245,7 @@ void UnitTestImpl::UnshuffleTests() { // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. GTEST_NO_INLINE_ GTEST_NO_TAIL_CALL_ std::string -GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/, int skip_count) { +GetCurrentOsStackTraceExceptTop(int skip_count) { // We pass skip_count + 1 to skip this wrapper function in addition // to what the user really wants to skip. return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1); diff --git a/googletest/test/googletest-param-test-test.cc b/googletest/test/googletest-param-test-test.cc index 848ef97..e3090ae 100644 --- a/googletest/test/googletest-param-test-test.cc +++ b/googletest/test/googletest-param-test-test.cc @@ -821,7 +821,7 @@ TEST_F(PREFIX_WITH_MACRO(NamingTestNonParametrized), TEST(MacroNameing, LookupNames) { std::set<std::string> know_suite_names, know_test_names; - auto ins = testing::UnitTest::GetInstance(); + const auto& ins = testing::UnitTest::GetInstance(); int ts = 0; while (const testing::TestSuite* suite = ins->GetTestSuite(ts++)) { know_suite_names.insert(suite->name()); @@ -897,7 +897,7 @@ INSTANTIATE_TEST_SUITE_P(CustomParamNameLambda, CustomLambdaNamingTest, }); TEST(CustomNamingTest, CheckNameRegistry) { - ::testing::UnitTest* unit_test = ::testing::UnitTest::GetInstance(); + const auto& unit_test = ::testing::UnitTest::GetInstance(); std::set<std::string> test_names; for (int suite_num = 0; suite_num < unit_test->total_test_suite_count(); ++suite_num) { diff --git a/googletest/test/gtest-unittest-api_test.cc b/googletest/test/gtest-unittest-api_test.cc index 2a13fa3..2ea6927 100644 --- a/googletest/test/gtest-unittest-api_test.cc +++ b/googletest/test/gtest-unittest-api_test.cc @@ -106,7 +106,7 @@ const int kTypedTests = 1; // Since tests can be run in any order, the values the accessors that track // test execution (such as failed_test_count) can not be predicted. TEST(ApiTest, UnitTestImmutableAccessorsWork) { - UnitTest* unit_test = UnitTest::GetInstance(); + const auto& unit_test = UnitTest::GetInstance(); ASSERT_EQ(2 + kTypedTestSuites, unit_test->total_test_suite_count()); EXPECT_EQ(1 + kTypedTestSuites, unit_test->test_suite_to_run_count()); @@ -224,7 +224,7 @@ TEST(DISABLED_Test, Dummy2) {} class FinalSuccessChecker : public Environment { protected: void TearDown() override { - UnitTest* unit_test = UnitTest::GetInstance(); + const auto& unit_test = UnitTest::GetInstance(); EXPECT_EQ(1 + kTypedTestSuites, unit_test->successful_test_suite_count()); EXPECT_EQ(3 + kTypedTests, unit_test->successful_test_count()); diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index cdfdc6c..b579e81 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -7703,7 +7703,7 @@ auto* dynamic_test = testing::RegisterTest( __LINE__, []() -> DynamicUnitTestFixture* { return new DynamicTest; }); TEST(RegisterTest, WasRegistered) { - auto* unittest = testing::UnitTest::GetInstance(); + const auto& unittest = testing::UnitTest::GetInstance(); for (int i = 0; i < unittest->total_test_suite_count(); ++i) { auto* tests = unittest->GetTestSuite(i); if (tests->name() != std::string("DynamicUnitTestFixture")) continue; |