diff --git a/src/tests/bin-sem-flush-test/bin-sem-flush-test.c b/src/tests/bin-sem-flush-test/bin-sem-flush-test.c index 33297a34c..9916c8f42 100644 --- a/src/tests/bin-sem-flush-test/bin-sem-flush-test.c +++ b/src/tests/bin-sem-flush-test/bin-sem-flush-test.c @@ -177,6 +177,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/bin-sem-test/bin-sem-test.c b/src/tests/bin-sem-test/bin-sem-test.c index 36fa6cc4f..847616ff0 100644 --- a/src/tests/bin-sem-test/bin-sem-test.c +++ b/src/tests/bin-sem-test/bin-sem-test.c @@ -186,6 +186,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c b/src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c index 78c72022e..cb926a1a2 100644 --- a/src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c +++ b/src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c @@ -181,6 +181,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/count-sem-test/count-sem-test.c b/src/tests/count-sem-test/count-sem-test.c index 48efe2c8b..4001392b8 100644 --- a/src/tests/count-sem-test/count-sem-test.c +++ b/src/tests/count-sem-test/count-sem-test.c @@ -151,6 +151,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/file-api-test/file-api-test.c b/src/tests/file-api-test/file-api-test.c index a0ced207f..5b548ee52 100644 --- a/src/tests/file-api-test/file-api-test.c +++ b/src/tests/file-api-test/file-api-test.c @@ -57,6 +57,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * This test case requires a fixed virtual dir for one test case. * Just map /test to a dir of the same name, relative to current dir. diff --git a/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c b/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c index e3fd8567d..710da0d29 100644 --- a/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c +++ b/src/tests/file-sys-add-fixed-map-api-test/file-sys-add-fixed-map-api-test.c @@ -96,6 +96,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/idmap-api-test/idmap-api-test.c b/src/tests/idmap-api-test/idmap-api-test.c index 3a9ab8327..d8cd1ca72 100644 --- a/src/tests/idmap-api-test/idmap-api-test.c +++ b/src/tests/idmap-api-test/idmap-api-test.c @@ -348,6 +348,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/mutex-test/mutex-test.c b/src/tests/mutex-test/mutex-test.c index d47de5741..a34330e85 100644 --- a/src/tests/mutex-test/mutex-test.c +++ b/src/tests/mutex-test/mutex-test.c @@ -217,6 +217,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/network-api-test/network-api-test.c b/src/tests/network-api-test/network-api-test.c index 6e53a42ad..d2689bdff 100644 --- a/src/tests/network-api-test/network-api-test.c +++ b/src/tests/network-api-test/network-api-test.c @@ -658,6 +658,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/osal-core-test/osal-core-test.c b/src/tests/osal-core-test/osal-core-test.c index a70aa4aec..f4d728619 100644 --- a/src/tests/osal-core-test/osal-core-test.c +++ b/src/tests/osal-core-test/osal-core-test.c @@ -96,6 +96,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UtTest_Add(TestTasks, NULL, NULL, "TASK"); UtTest_Add(TestQueues, NULL, NULL, "MSGQ"); UtTest_Add(TestBinaries, NULL, NULL, "BSEM"); diff --git a/src/tests/queue-test/queue-test.c b/src/tests/queue-test/queue-test.c index 9d36294b1..a7f1526c4 100644 --- a/src/tests/queue-test/queue-test.c +++ b/src/tests/queue-test/queue-test.c @@ -247,6 +247,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/select-test/select-test.c b/src/tests/select-test/select-test.c index 84b213964..6479e4c41 100644 --- a/src/tests/select-test/select-test.c +++ b/src/tests/select-test/select-test.c @@ -596,6 +596,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/sem-speed-test/sem-speed-test.c b/src/tests/sem-speed-test/sem-speed-test.c index 3c2a61379..fdda695b6 100644 --- a/src/tests/sem-speed-test/sem-speed-test.c +++ b/src/tests/sem-speed-test/sem-speed-test.c @@ -150,6 +150,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/shell-test/shell-test.c b/src/tests/shell-test/shell-test.c index f05ff0f9f..81627a0ee 100644 --- a/src/tests/shell-test/shell-test.c +++ b/src/tests/shell-test/shell-test.c @@ -101,6 +101,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/symbol-api-test/symbol-api-test.c b/src/tests/symbol-api-test/symbol-api-test.c index 60f5a767c..bfe43ea0d 100644 --- a/src/tests/symbol-api-test/symbol-api-test.c +++ b/src/tests/symbol-api-test/symbol-api-test.c @@ -112,6 +112,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/time-base-api-test/time-base-api-test.c b/src/tests/time-base-api-test/time-base-api-test.c index 94bc69a9b..775b5229a 100644 --- a/src/tests/time-base-api-test/time-base-api-test.c +++ b/src/tests/time-base-api-test/time-base-api-test.c @@ -264,6 +264,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/timer-add-api-test/timer-add-api-test.c b/src/tests/timer-add-api-test/timer-add-api-test.c index 5ff9541b4..917db9e8d 100644 --- a/src/tests/timer-add-api-test/timer-add-api-test.c +++ b/src/tests/timer-add-api-test/timer-add-api-test.c @@ -199,6 +199,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the test setup and check routines in UT assert */ diff --git a/src/tests/timer-test/timer-test.c b/src/tests/timer-test/timer-test.c index 79ba39d5b..2863dafbd 100644 --- a/src/tests/timer-test/timer-test.c +++ b/src/tests/timer-test/timer-test.c @@ -74,6 +74,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * Register the timer test setup and check routines in UT assert */ diff --git a/src/unit-tests/oscore-test/ut_oscore_test.c b/src/unit-tests/oscore-test/ut_oscore_test.c index e1662fd66..9a48689b8 100644 --- a/src/unit-tests/oscore-test/ut_oscore_test.c +++ b/src/unit-tests/oscore-test/ut_oscore_test.c @@ -188,6 +188,9 @@ void UT_os_init_task_get_info_test() void UtTest_Setup(void) { + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UtTest_Add(UT_os_apiinit_test, NULL, NULL, "OS_API_Init"); UtTest_Add(UT_os_printf_test, NULL, NULL, "OS_printf"); diff --git a/src/unit-tests/osfile-test/ut_osfile_test.c b/src/unit-tests/osfile-test/ut_osfile_test.c index 925fdb612..db9484a8b 100644 --- a/src/unit-tests/osfile-test/ut_osfile_test.c +++ b/src/unit-tests/osfile-test/ut_osfile_test.c @@ -132,6 +132,9 @@ void UT_os_init_file_misc() void UtTest_Setup(void) { + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UT_os_initfs_test(); if (UT_os_setup_fs() == OS_SUCCESS) diff --git a/src/unit-tests/osfilesys-test/ut_osfilesys_test.c b/src/unit-tests/osfilesys-test/ut_osfilesys_test.c index 5a8496d72..248ae5296 100644 --- a/src/unit-tests/osfilesys-test/ut_osfilesys_test.c +++ b/src/unit-tests/osfilesys-test/ut_osfilesys_test.c @@ -121,6 +121,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UT_os_init_fs_misc(); UtTest_Add(UT_os_makefs_test, NULL, NULL, "OS_mkfs"); diff --git a/src/unit-tests/osloader-test/ut_osloader_test.c b/src/unit-tests/osloader-test/ut_osloader_test.c index 7dc7d9c6c..d0adbff8b 100644 --- a/src/unit-tests/osloader-test/ut_osloader_test.c +++ b/src/unit-tests/osloader-test/ut_osloader_test.c @@ -67,6 +67,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + /* * This test needs to load the modules from the filesystem, so * there must be a virtual path corresponding to the path where diff --git a/src/unit-tests/osnetwork-test/ut_osnetwork_test.c b/src/unit-tests/osnetwork-test/ut_osnetwork_test.c index a550d2f4a..7277b83dd 100644 --- a/src/unit-tests/osnetwork-test/ut_osnetwork_test.c +++ b/src/unit-tests/osnetwork-test/ut_osnetwork_test.c @@ -65,6 +65,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UtTest_Add(UT_os_networkgetid_test, NULL, NULL, "OS_NetworkGetID"); UtTest_Add(UT_os_networkgethostname_test, NULL, NULL, "OS_NetworkGetHostName"); } diff --git a/src/unit-tests/ostimer-test/ut_ostimer_test.c b/src/unit-tests/ostimer-test/ut_ostimer_test.c index dcbe25d10..68e94ec89 100644 --- a/src/unit-tests/ostimer-test/ut_ostimer_test.c +++ b/src/unit-tests/ostimer-test/ut_ostimer_test.c @@ -193,6 +193,9 @@ void UtTest_Setup(void) UtAssert_Abort("OS_API_Init() failed"); } + /* the test should call OS_API_Teardown() before exiting */ + UtTest_AddTeardown(OS_API_Teardown, "Cleanup"); + UT_os_init_timer_misc(); UtTest_Add(UT_os_timercreate_test, UT_os_setup_timercreate_test, NULL, "OS_TimerCreate");