aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/test/gmock-nice-strict_test.cc
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-04-12 09:13:38 -0400
committerGennadiy Civil <misterg@google.com>2018-04-12 09:13:38 -0400
commit07f3bdd4c93dd556d08eba8de3a17cfcbe5cd132 (patch)
treec5902ce59400b64146728fc2ce3caccadb84ed80 /googlemock/test/gmock-nice-strict_test.cc
parent854adb087ba913a867c9ec2228e76febe3c531b5 (diff)
parentb640d8743d85f5e69c16679e7ead3f31d94e31ff (diff)
downloadgoogletest-07f3bdd4c93dd556d08eba8de3a17cfcbe5cd132.tar.gz
googletest-07f3bdd4c93dd556d08eba8de3a17cfcbe5cd132.tar.bz2
googletest-07f3bdd4c93dd556d08eba8de3a17cfcbe5cd132.zip
Merge branch 'master' of https://github.com/google/googletest
Diffstat (limited to 'googlemock/test/gmock-nice-strict_test.cc')
-rw-r--r--googlemock/test/gmock-nice-strict_test.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/googlemock/test/gmock-nice-strict_test.cc b/googlemock/test/gmock-nice-strict_test.cc
index 0eac6439..7812f626 100644
--- a/googlemock/test/gmock-nice-strict_test.cc
+++ b/googlemock/test/gmock-nice-strict_test.cc
@@ -259,6 +259,13 @@ TEST(NiceMockTest, NonDefaultConstructor10) {
nice_bar.That(5, true);
}
+TEST(NiceMockTest, AllowLeak) {
+ NiceMock<MockFoo>* leaked = new NiceMock<MockFoo>;
+ Mock::AllowLeak(leaked);
+ EXPECT_CALL(*leaked, DoThis());
+ leaked->DoThis();
+}
+
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
// Tests that NiceMock<Mock> compiles where Mock is a user-defined
// class (as opposed to ::testing::Mock). We had to work around an
@@ -352,6 +359,13 @@ TEST(NaggyMockTest, NonDefaultConstructor10) {
naggy_bar.That(5, true);
}
+TEST(NaggyMockTest, AllowLeak) {
+ NaggyMock<MockFoo>* leaked = new NaggyMock<MockFoo>;
+ Mock::AllowLeak(leaked);
+ EXPECT_CALL(*leaked, DoThis());
+ leaked->DoThis();
+}
+
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
// Tests that NaggyMock<Mock> compiles where Mock is a user-defined
// class (as opposed to ::testing::Mock). We had to work around an
@@ -426,6 +440,13 @@ TEST(StrictMockTest, NonDefaultConstructor10) {
"Uninteresting mock function call");
}
+TEST(StrictMockTest, AllowLeak) {
+ StrictMock<MockFoo>* leaked = new StrictMock<MockFoo>;
+ Mock::AllowLeak(leaked);
+ EXPECT_CALL(*leaked, DoThis());
+ leaked->DoThis();
+}
+
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
// Tests that StrictMock<Mock> compiles where Mock is a user-defined
// class (as opposed to ::testing::Mock). We had to work around an