Closed hartness closed 9 years ago
Looks like this is not a bug at all. I've discovered that I can fix this issue by declaring my mock like this:
Mock<Derived, Base> mock;
Doing this fixes the issue and allows correct casting from base to derived mocked classes.
Doh!!
If I try to dynamic cast the underlying smart pointers to mocked objects it doenst work. The result is always null.
E.G. class IBase { public: virtual void methodA() = 0; };
//Next line fails. //d1 is always null for the mocked version. If a real Derived object is used like the line commented out above #1 it works fine.