You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using gmock 1.7.0, gtest 1.7.0 on linux x64 (ubuntu 14.10)
Example:
----
class MyMock {
public:
MOCK_METHOD0(func, void());
};
TEST(MyTest, testMock) {
MyMock mock;
ON_CALL(mock, func()).WillByDefault(Throw(std::logic_error("error")));
EXPECT_CALL(mock, func()).Times(0);
try {
mock.func();
} catch (std::logic_error &e) {
}
}
----
The test is green and passes. I expect it to fail, because the mock function is
called once but I expect it not to be..
I assume in the gmock implementation, the call counter is incremented after the
function returns and throwing an exception jumps over this piece of code.
Original issue reported on code.google.com by heinzis...@gmail.com on 20 Nov 2014 at 11:33
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
heinzis...@gmail.com
on 20 Nov 2014 at 11:33The text was updated successfully, but these errors were encountered: