diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-04-29 23:52:29 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-04-29 23:52:29 +0000 |
commit | bf0d0a44812f97449d7401d0eeb8da954f76ba2a (patch) | |
tree | c1366fc958a7ac54295ebe2543f33e2f72e26f26 | |
parent | df35a763b9d98d7040a00fc1e5cffe91a80ba9e0 (diff) | |
download | googletest-bf0d0a44812f97449d7401d0eeb8da954f76ba2a.tar.gz googletest-bf0d0a44812f97449d7401d0eeb8da954f76ba2a.tar.bz2 googletest-bf0d0a44812f97449d7401d0eeb8da954f76ba2a.zip |
Turns --gmock_catch_leaked_mocks on by default.
-rw-r--r-- | src/gmock.cc | 4 | ||||
-rwxr-xr-x | test/gmock_leak_test.py | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/gmock.cc b/src/gmock.cc index dc9d3d22..caafb015 100644 --- a/src/gmock.cc +++ b/src/gmock.cc @@ -37,9 +37,7 @@ namespace testing { // TODO(wan@google.com): support using environment variables to // control the flag values, like what Google Test does. -// TODO(wan@google.com): change the default value to true after people -// have a chance to fix their leaked mocks. -GMOCK_DEFINE_bool_(catch_leaked_mocks, false, +GMOCK_DEFINE_bool_(catch_leaked_mocks, true, "true iff Google Mock should report leaked mock objects " "as failures."); diff --git a/test/gmock_leak_test.py b/test/gmock_leak_test.py index 51358f06..1337e0b0 100755 --- a/test/gmock_leak_test.py +++ b/test/gmock_leak_test.py @@ -55,9 +55,9 @@ TEST_MULTIPLE_LEAKS = PROGRAM_PATH + ' --gtest_filter=*MultipleLeaked*' class GMockLeakTest(unittest.TestCase): - def testDoesNotCatchLeakedMockByDefault(self): - self.assertEquals(0, os.system(TEST_WITH_EXPECT_CALL)) - self.assertEquals(0, os.system(TEST_WITH_ON_CALL)) + def testCatchesLeakedMockByDefault(self): + self.assertNotEqual(os.system(TEST_WITH_EXPECT_CALL), 0) + self.assertNotEqual(os.system(TEST_WITH_ON_CALL), 0) def testDoesNotCatchLeakedMockWhenDisabled(self): self.assertEquals( |