dascandy / hippomocks

GNU Lesser General Public License v2.1
196 stars 67 forks source link

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

Open michielveldkamp opened 5 years ago

michielveldkamp commented 5 years ago

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