I have a method that calls pthread_create(...). is it possible to mock and expect the output of pthread_create so I don’t actually launch a thread?
I am asking this because the entire class is a Mock Object and as soon as I delete the object at the end of the test case the thread segments.
Yes. Declare mock class and functions:
In every test function do following:
In source file with
pthread_createadd conditional include like: