Hippomocks' MockRepository supports multiple instances as far as the compiler is concerned. Some use cases are not possible, though, as they lead to unit test executable crash. Let's consider the following example.
void MyCall()
{
}
void…
I wrote an unit test with hippomocks, but got error while compiling it.
The compiler is VS 2010.
How can I fix it ?
#include "hippomocks.h"
#include
using namespace HippoMocks;
struct A
{
virtual void f(std::function…
In the official version 3.1 of Hippomocks (https://www.assembla.com/spaces/hippomocks/wiki/Home) there used to be a MockRepository::ClassMock that constructed mocked objects (contrary to MockRepository::InterfaceMock that doesn't) which can be very…
Just stuck with a compilation error of the code trying to mock a method taking std::weak_ptr as argument. HippoMocks has a code to compare it when calling the method With, that doesn't get compiled. I would appreciate any help.
Here is the…
I'm in a situation where I have to mock WinAPI calls, and with some difficulty I was able to get C function mocking to work in HippoMocks.
1) I found that the HippoMocks repository on Assembla does not have C function mocking. I was able to find it…
Let's say we have the following classes A and B:
class A
{
virtual void Init() { DoSomething(); }
};
class B : public A
{
virtual void Init() { DoSomethingSpecial(); A::Init(); }
};
In our unit test we only want to test B, that is to test…
In the mocking framework Hippomocks it is possible to check the passed arguments within an expectation. For example:
void Class::Method(int arg1);
...
m_mockRepository_p->ExpectCall(someObject_p, Class::Method).With(1);
Is there a possibility to…
While trying out HippoMocks (Cygwin, GCC 4.5.3, CppUnit) to mock an interface, one of the methods is causing compilation to fail. Further triage shows that only mocking methods with std::vector as arguments would…