Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
bf0d0a44
Commit
bf0d0a44
authored
Apr 29, 2009
by
zhanyong.wan
Browse files
Turns --gmock_catch_leaked_mocks on by default.
parent
df35a763
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
src/gmock.cc
src/gmock.cc
+1
-3
test/gmock_leak_test.py
test/gmock_leak_test.py
+3
-3
No files found.
src/gmock.cc
View file @
bf0d0a44
...
...
@@ -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."
);
...
...
test/gmock_leak_test.py
View file @
bf0d0a44
...
...
@@ -55,9 +55,9 @@ TEST_MULTIPLE_LEAKS = PROGRAM_PATH + ' --gtest_filter=*MultipleLeaked*'
class
GMockLeakTest
(
unittest
.
TestCase
):
def
test
DoesNot
CatchLeakedMockByDefault
(
self
):
self
.
assertEqual
s
(
0
,
os
.
system
(
TEST_WITH_EXPECT_CALL
))
self
.
assertEqual
s
(
0
,
os
.
system
(
TEST_WITH_ON_CALL
))
def
testCatch
es
LeakedMockByDefault
(
self
):
self
.
assert
Not
Equal
(
os
.
system
(
TEST_WITH_EXPECT_CALL
)
,
0
)
self
.
assert
Not
Equal
(
os
.
system
(
TEST_WITH_ON_CALL
)
,
0
)
def
testDoesNotCatchLeakedMockWhenDisabled
(
self
):
self
.
assertEquals
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment