Open osiewicz opened 6 years ago
Would it be possible to handle mocking outside of the library code? Some quick googling: https://cmocka.org https://cgreen-devs.github.io
Alternatively, the library itself could be written in C but testing can easily be done in C++.
I'm not sure if we are on the same page - Criterion is the library of choice for that project, however eprintf usage restricts our testing capabilities.
As of today there is no unified interface for mock error values - functions can either return NULL or (in case of value-returning functions), arbitrary values - however, there is no consistency with these and so, we'll need something like macros to help us solve these. exit function in eprintf has a magic number of '2' which is not okay. I want it to signal something so that bash scripting can be made a tad bit easier.