Search code examples
c++exceptionmockingexpectationshippomocks

NotImplementedException in Hippomock's MockRepository::BasicRegisterExpect


While trying to register an expectation using Hippomock's MockRepository::ExpectCall I encounter the NotImplementedException exception at MockRepository::BasicRegisterExpect's following line which I admittedly do not understand:

if ((unsigned int)baseOffset * sizeof(void*) + sizeof(void*)-1 > sizeof(Z)) RAISEEXCEPTION(NotImplementedException(this));

Unfortunately I cannot reproduce the exception using a stripped down example.

Hence my "simple" questions:

  • In which cases is this very exception raised when expecting a call?
  • What does this code line exactly test?

Solution

  • In my case the exception was due to my trying to mock a non-virtual class function. Simple answer, but so easy to overlook...