turtle icon indicating copy to clipboard operation
turtle copied to clipboard

Running Unit Tests with the mocked class

Open zichaelpath opened this issue 5 years ago • 3 comments

Hello, I am currently testing a feature of software that requires a hardware component, and my solution to that was to create a partially mocked class of the class being tested in order to control the outcome of the derived classes private functions. While running that test suite individually, I get no errors in the tests of that suite; however when I run all the test suites, the tests after that test suite is completed gives me an "invalid parameter detected by a C Runtime Library".

My issue is that this circumstance is causing all the other tests after this suite to fail with our own error system, however removing the test suite with the mocked class being tested causes all the other suites to run as expected and pass.

Are we able to test a partially mocked class and run all the boost tests without the latter suites crashing?

zichaelpath avatar Jan 07 '21 15:01 zichaelpath

Hi,

It’s a bit hard to debug without seeing the code. Would you be able to provide a minimal example reproducing the problem?

mat007 avatar Jan 07 '21 16:01 mat007

Absolutely I can, is there any chance you can give me an email to send the sample code to? I'm having difficulty uploading it to github at the moment

zichaelpath avatar Jan 07 '21 17:01 zichaelpath

Hey, I don’t remember if I ever gave you my email in the end, sorry about that. Do you still need help? 😬

mat007 avatar Jan 24 '22 16:01 mat007