Changeset 3bacee1 in mainline for uspace/lib/pcut/tests/preinithook.c
- Timestamp:
- 2018-04-12T16:27:17Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/tests/preinithook.c
r76d0981d r3bacee1 34 34 static int init_counter = 1; 35 35 36 static void init_hook(void) { 36 static void init_hook(void) 37 { 37 38 init_counter++; 38 39 } 39 40 40 static void pre_init_hook(int *argc, char **argv[]) { 41 static void pre_init_hook(int *argc, char **argv[]) 42 { 41 43 (void) argc; 42 44 (void) argv; … … 44 46 } 45 47 46 PCUT_TEST_BEFORE { 48 PCUT_TEST_BEFORE 49 { 47 50 PCUT_ASSERT_INT_EQUALS(4, init_counter); 48 51 init_counter++; 49 52 } 50 53 51 PCUT_TEST(check_init_counter) { 54 PCUT_TEST(check_init_counter) 55 { 52 56 PCUT_ASSERT_INT_EQUALS(5, init_counter); 53 57 } 54 58 55 PCUT_TEST(check_init_counter_2) { 59 PCUT_TEST(check_init_counter_2) 60 { 56 61 PCUT_ASSERT_INT_EQUALS(5, init_counter); 57 62 } 58 63 59 64 60 PCUT_CUSTOM_MAIN( 61 PCUT_MAIN_SET_INIT_HOOK(init_hook), 62 PCUT_MAIN_SET_PREINIT_HOOK(pre_init_hook) 63 ); 65 PCUT_CUSTOM_MAIN(PCUT_MAIN_SET_INIT_HOOK(init_hook), 66 PCUT_MAIN_SET_PREINIT_HOOK(pre_init_hook)); 64 67
Note:
See TracChangeset
for help on using the changeset viewer.