diff options
author | Chris Johnson <chrisjohnsonmail@gmail.com> | 2019-01-04 03:13:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 03:13:20 (GMT) |
commit | 0ffa5f9779fc3a1b18d4931484b46825d952821d (patch) | |
tree | f31698c81378165e2fe639e93d6f54b252b1e2c2 /googlemock/src | |
parent | 0c0ca90382457859785a97bea5695093d72097dd (diff) | |
parent | 3880b13e4c0b04ca88f69b9c93da6058bd836c34 (diff) | |
download | googletest-0ffa5f9779fc3a1b18d4931484b46825d952821d.zip googletest-0ffa5f9779fc3a1b18d4931484b46825d952821d.tar.gz googletest-0ffa5f9779fc3a1b18d4931484b46825d952821d.tar.bz2 |
Merge branch 'master' into chore/fix_library_json
Diffstat (limited to 'googlemock/src')
-rw-r--r-- | googlemock/src/gmock-internal-utils.cc | 3 | ||||
-rw-r--r-- | googlemock/src/gmock-spec-builders.cc | 14 | ||||
-rw-r--r-- | googlemock/src/gmock.cc | 3 |
3 files changed, 4 insertions, 16 deletions
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc index 937d830..1594662 100644 --- a/googlemock/src/gmock-internal-utils.cc +++ b/googlemock/src/gmock-internal-utils.cc @@ -154,9 +154,6 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message, // Ensures that logs from different threads don't interleave. MutexLock l(&g_log_mutex); - // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a - // macro. - if (severity == kWarning) { // Prints a GMOCK WARNING marker to make the warnings easily searchable. std::cout << "\nGMOCK WARNING:"; diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index 5db774e..1971415 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -572,7 +572,7 @@ struct MockObjectState { // invoked on this mock object. const char* first_used_file; int first_used_line; - ::std::string first_used_test_case; + ::std::string first_used_test_suite; ::std::string first_used_test; bool leakable; // true iff it's OK to leak the object. FunctionMockers function_mockers; // All registered methods of the object. @@ -592,9 +592,6 @@ class MockObjectRegistry { // object alive. Therefore we report any living object as test // failure, unless the user explicitly asked us to ignore it. ~MockObjectRegistry() { - // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is - // a macro. - if (!GMOCK_FLAG(catch_leaked_mocks)) return; @@ -612,8 +609,8 @@ class MockObjectRegistry { state.first_used_line); std::cout << " ERROR: this mock object"; if (state.first_used_test != "") { - std::cout << " (used in test " << state.first_used_test_case << "." - << state.first_used_test << ")"; + std::cout << " (used in test " << state.first_used_test_suite << "." + << state.first_used_test << ")"; } std::cout << " should be deleted but never is. Its address is @" << it->first << "."; @@ -793,10 +790,7 @@ void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj, const TestInfo* const test_info = UnitTest::GetInstance()->current_test_info(); if (test_info != nullptr) { - // FIXME: record the test case name when the - // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or - // TearDownTestCase(). - state.first_used_test_case = test_info->test_case_name(); + state.first_used_test_suite = test_info->test_suite_name(); state.first_used_test = test_info->name(); } } diff --git a/googlemock/src/gmock.cc b/googlemock/src/gmock.cc index 675e8db..3fd2e93 100644 --- a/googlemock/src/gmock.cc +++ b/googlemock/src/gmock.cc @@ -33,9 +33,6 @@ namespace testing { -// FIXME: support using environment variables to -// control the flag values, like what Google Test does. - GMOCK_DEFINE_bool_(catch_leaked_mocks, true, "true iff Google Mock should report leaked mock objects " "as failures."); |