In my case the exception was due to my trying to mock a non-virtual class function. Simple answer, but so easy to overlook...
NotImplementedException in Hippomock's MockRepository::BasicRegisterExpect
-
25-09-2022 - |
Pergunta
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?
Solução
Outras dicas
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.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow