Questions tagged [hippomocks]

A library for writing and using C++ mock classes

Hippo mocks is a c++ framework to create mock classes.

38 questions
0
votes
2 answers

Are multiple coexistent instances of MockRepository possible? If yes under which conditions?

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…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
1 answer

Failed to compile while the argument is lambda. [using hippomocks]

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
compass00
  • 167
  • 2
  • 9
0
votes
1 answer

Equivalent of Hippomocks' previously existing MockRepository::ClassMock

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…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
1 answer

HippoMocks With weak_ptr

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…
0
votes
1 answer

HippoMocks - How to mock user defined structures, specifically WinAPI structures

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…
0
votes
1 answer

Mocking base class method in Hippomocks

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…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
1 answer

Hippomocks: How to expect only some of the arguments passed to ExpectCall()?

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…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
1 answer

HippoMocks - mocking methods with std::vector fail to compile

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…
Zach Saw
  • 4,308
  • 3
  • 33
  • 49
1 2
3