"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "googlemock/test/gmock_leak_test_.cc" between
googletest-release-1.11.0.tar.gz and googletest-release-1.12.0.tar.gz

About: GoogleTest is Google's (unit) testing and mocking framework for C++ tests.

gmock_leak_test_.cc  (googletest-release-1.11.0):gmock_leak_test_.cc  (googletest-release-1.12.0)
skipping to change at line 54 skipping to change at line 54
virtual void DoThis() = 0; virtual void DoThis() = 0;
}; };
class MockFoo : public FooInterface { class MockFoo : public FooInterface {
public: public:
MockFoo() {} MockFoo() {}
MOCK_METHOD0(DoThis, void()); MOCK_METHOD0(DoThis, void());
private: private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo); MockFoo(const MockFoo&) = delete;
MockFoo& operator=(const MockFoo&) = delete;
}; };
TEST(LeakTest, LeakedMockWithExpectCallCausesFailureWhenLeakCheckingIsEnabled) { TEST(LeakTest, LeakedMockWithExpectCallCausesFailureWhenLeakCheckingIsEnabled) {
MockFoo* foo = new MockFoo; MockFoo* foo = new MockFoo;
EXPECT_CALL(*foo, DoThis()); EXPECT_CALL(*foo, DoThis());
foo->DoThis(); foo->DoThis();
// In order to test the leak detector, we deliberately leak foo. // In order to test the leak detector, we deliberately leak foo.
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)