eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.24k stars 170 forks source link

And suggestion on mocking a class inherit from std::enable_shared_from_this? #61

Closed jicailiu closed 8 years ago

jicailiu commented 8 years ago

Hi,

I have a project with std::enable_shared_from_this<> is quite commonly inherited by multiply classes. When I trying to mock these classes, I got error saying "Can't mock a type with multiple inheritance or with non-polymorphic base class".

Is there any suggestion for this scenario?

Thanks!

eranpeer commented 8 years ago

Currently, not. Due to the complexity of hacking the virtual table FakeIt can only handle simple inheritance hierarchies. Multiple inheritance is not supported.

jicailiu commented 8 years ago

Understand, just want to make sure. Thanks!