Mock/Wrap static functions called by a non-static function under test
问题 I would like to test some functions by implementing unit tests with cmocka framework. For example I have a non-static function under test which calls two static functions. Because of the fact that these static functions interact with hardware I want to mock/wrap them and use a wrap function instead of the real function when testing. Like described in the cmocka documentation I've used the --wrap=myfunction linker flags when building/linking my tests. The tests compile but when I run them the