Skip to content

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

@michielveldkamp

Description

@michielveldkamp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions