1
0
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:
Pauli Salmenrinne
2019-01-22 15:11:10 +02:00
parent 647737304d
commit 0a7fbeceec
25 changed files with 414 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
#include "test_common.h"
#include "display.h"
DEFINE_FFF_GLOBALS;
int main(void)
{
init_tests(); // will reset common and hook errors to asserts
GLOBAL_TEST_bus_read_ret[2] = 0x10;
assert( display_init() == true );
assert( bus_read_write_fake.call_count == 1);
display_update( "TEST INFO" );
assert( bus_read_write_fake.call_count == 1 );
assert( bus_write_fake.call_count == 1 );
GLOBAL_TEST_bus_read_ret[2] = 0x00;
assert( display_init() == false );
printf("Test " __FILE__ " ok\n");
return 0;
}