hippomocks icon indicating copy to clipboard operation
hippomocks copied to clipboard

ExpectCallDestructor fails with multiple inheritance using virtual destructor of second base class

Open michielveldkamp opened this issue 6 years ago • 0 comments

Suppose we mock a class that implements two interfaces, and our code uses the second interface, then we cannot expect deletion with ExpectCallDestructor:

terminate called after throwing an instance of 'HippoMocks::NotImplementedException' what(): Function called without expectation! Expectations set: test.cpp(48) Expectation for IBar::Bar() on the mock at 0x0xab5c20 was satisfied. test.cpp(49) Expectation for destructor() on the mock at 0x0xab5c20 was not satisfied

This was tested on the latest version on both master branch and cpp11 branch using g++ 6.2.0 (with -g3 -O0, and -std=c++11 for the cpp11 branch).

test.cpp.txt

michielveldkamp avatar Sep 05 '19 09:09 michielveldkamp