Changeset 4b54bd9 in mainline for uspace/lib/pcut/tests/preinithook.c
- Timestamp:
- 2018-09-12T13:23:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3da0ee4
- Parents:
- 275530a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/tests/preinithook.c
r275530a4 r4b54bd9 30 30 #include "tested.h" 31 31 32 PCUT_INIT ;32 PCUT_INIT 33 33 34 34 static int init_counter = 1; 35 35 36 static void init_hook(void) 37 { 36 static void init_hook(void) { 38 37 init_counter++; 39 38 } 40 39 41 static void pre_init_hook(int *argc, char **argv[]) 42 { 40 static void pre_init_hook(int *argc, char **argv[]) { 43 41 (void) argc; 44 42 (void) argv; … … 46 44 } 47 45 48 PCUT_TEST_BEFORE 49 { 46 PCUT_TEST_BEFORE { 50 47 PCUT_ASSERT_INT_EQUALS(4, init_counter); 51 48 init_counter++; 52 49 } 53 50 54 PCUT_TEST(check_init_counter) 55 { 51 PCUT_TEST(check_init_counter) { 56 52 PCUT_ASSERT_INT_EQUALS(5, init_counter); 57 53 } 58 54 59 PCUT_TEST(check_init_counter_2) 60 { 55 PCUT_TEST(check_init_counter_2) { 61 56 PCUT_ASSERT_INT_EQUALS(5, init_counter); 62 57 } 63 58 64 59 65 PCUT_CUSTOM_MAIN(PCUT_MAIN_SET_INIT_HOOK(init_hook), 66 PCUT_MAIN_SET_PREINIT_HOOK(pre_init_hook)); 60 PCUT_CUSTOM_MAIN( 61 PCUT_MAIN_SET_INIT_HOOK(init_hook), 62 PCUT_MAIN_SET_PREINIT_HOOK(pre_init_hook) 63 ) 67 64
Note:
See TracChangeset
for help on using the changeset viewer.