NotImplementedException in Hippomock's MockRepository::BasicRegisterExpect

545 views Asked by At

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?
2

There are 2 answers

0
Roland Sarrazin On BEST ANSWER

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

1
dascandy On

On what version was this and on which platform (compiler, version, settings) ? It should let you know with a nice message instead; if it gets to that line it thinks it's a virtual function and it's wrong.