From 4a5df5b612012092a21ea878657a805bf110449c Mon Sep 17 00:00:00 2001 From: Parth Aggarwal Date: Mon, 2 Mar 2026 14:59:49 -0800 Subject: [PATCH] Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/com_wrapper_int/com_wrapper_int.c | 7 ++++--- tests/com_wrapper_ut/com_wrapper_ut.c | 4 ++-- tests/com_wrapper_ut/com_wrapper_ut_pch.h | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/com_wrapper_int/com_wrapper_int.c b/tests/com_wrapper_int/com_wrapper_int.c index 7b62232..a189d76 100644 --- a/tests/com_wrapper_int/com_wrapper_int.c +++ b/tests/com_wrapper_int/com_wrapper_int.c @@ -5,6 +5,7 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "real_gballoc_hl.h" @@ -12,12 +13,12 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_initialize) +TIMED_TEST_SUITE_INITIALIZE(suite_initialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { real_gballoc_hl_deinit(); } @@ -46,4 +47,4 @@ TEST_FUNCTION(custom_allocator_create_and_release_succeeds) (void)custom_interface->lpVtbl->Release(custom_interface); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/com_wrapper_ut/com_wrapper_ut.c b/tests/com_wrapper_ut/com_wrapper_ut.c index 9198fa6..a73b5b7 100644 --- a/tests/com_wrapper_ut/com_wrapper_ut.c +++ b/tests/com_wrapper_ut/com_wrapper_ut.c @@ -57,7 +57,7 @@ DEFINE_COM_WRAPPER_OBJECT(TEST_OBJECT_NOT_ENOUGH_HANDLE, TEST_OBJECT_NOT_ENOUGH_ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -76,7 +76,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_HOOK(ut_custom_free, real_gballoc_hl_free); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/com_wrapper_ut/com_wrapper_ut_pch.h b/tests/com_wrapper_ut/com_wrapper_ut_pch.h index 053b097..b9fa5c9 100644 --- a/tests/com_wrapper_ut/com_wrapper_ut_pch.h +++ b/tests/com_wrapper_ut/com_wrapper_ut_pch.h @@ -19,6 +19,8 @@ #include "c_pal/interlocked.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to interlocked.h - at the moment verified through int tests - this is porting legacy code, temporary solution*/ +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" @@ -36,4 +38,4 @@ #include "test_object_wrapper.h" #include "test_object_2_wrapper.h" -#endif // COM_WRAPPER_UT_PCH_H +#endif // COM_WRAPPER_UT_PCH_H \ No newline at end of file