diff options
Diffstat (limited to 'testing/gmock/test/gmock-nice-strict_test.cc')
| -rw-r--r-- | testing/gmock/test/gmock-nice-strict_test.cc | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/testing/gmock/test/gmock-nice-strict_test.cc b/testing/gmock/test/gmock-nice-strict_test.cc index 0dc7106..1d36e03 100644 --- a/testing/gmock/test/gmock-nice-strict_test.cc +++ b/testing/gmock/test/gmock-nice-strict_test.cc @@ -40,7 +40,12 @@ // clash with ::testing::Mock. class Mock { public: + Mock() {} + MOCK_METHOD0(DoThis, void()); + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock); }; namespace testing { @@ -64,10 +69,14 @@ class Foo { class MockFoo : public Foo { public: + MockFoo() {} void Delete() { delete this; } MOCK_METHOD0(DoThis, void()); MOCK_METHOD1(DoThat, int(bool flag)); + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo); }; class MockBar { @@ -89,6 +98,8 @@ class MockBar { private: string str_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar); }; // TODO(wan@google.com): find a way to re-enable these tests. @@ -173,21 +184,21 @@ TEST(NiceMockTest, NonDefaultConstructor10) { nice_bar.That(5, true); } -#if !GTEST_OS_SYMBIAN +#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 workaround an // MSVC 8.0 bug that caused the symbol Mock used in the definition of // NiceMock to be looked up in the wrong context, and this test // ensures that our fix works. // -// We have to skip this test on Symbian, as it causes the program to -// crash there, for reasons unclear to us yet. +// We have to skip this test on Symbian and Windows Mobile, as it +// causes the program to crash there, for reasons unclear to us yet. TEST(NiceMockTest, AcceptsClassNamedMock) { NiceMock< ::Mock> nice; EXPECT_CALL(nice, DoThis()); nice.DoThis(); } -#endif // !GTEST_OS_SYMBIAN +#endif // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE // Tests that a strict mock allows expected calls. TEST(StrictMockTest, AllowsExpectedCall) { @@ -247,21 +258,21 @@ TEST(StrictMockTest, NonDefaultConstructor10) { "Uninteresting mock function call"); } -#if !GTEST_OS_SYMBIAN +#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 workaround an // MSVC 8.0 bug that caused the symbol Mock used in the definition of // StrictMock to be looked up in the wrong context, and this test // ensures that our fix works. // -// We have to skip this test on Symbian, as it causes the program to -// crash there, for reasons unclear to us yet. +// We have to skip this test on Symbian and Windows Mobile, as it +// causes the program to crash there, for reasons unclear to us yet. TEST(StrictMockTest, AcceptsClassNamedMock) { StrictMock< ::Mock> strict; EXPECT_CALL(strict, DoThis()); strict.DoThis(); } -#endif // !GTEST_OS_SYMBIAN +#endif // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE } // namespace gmock_nice_strict_test } // namespace testing |
