mirror of
https://github.com/meekrosoft/fff
synced 2026-01-28 02:34:28 +01:00
Add example for the weak linking
This commit is contained in:
28
examples/weak_linking/test/main.test.c
Normal file
28
examples/weak_linking/test/main.test.c
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#include "display.fake.h"
|
||||
#include "sensor.fake.h"
|
||||
#include "test_common.h"
|
||||
|
||||
DEFINE_FFF_GLOBALS;
|
||||
|
||||
int update_main( void );
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
init_tests(); // will reset common and hook errors to asserts
|
||||
|
||||
sensor_init_fake.return_val = true;
|
||||
display_init_fake.return_val = true;
|
||||
|
||||
update_main();
|
||||
|
||||
assert( sensor_init_fake.call_count == 1 );
|
||||
assert( display_init_fake.call_count == 1 );
|
||||
assert( display_update_fake.call_count == 1 );
|
||||
|
||||
printf("Test " __FILE__ " ok\n");
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user