Skip to content

Commit cf395cf

Browse files
parth21999Copilot
andcommitted
Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP
Replace TEST_SUITE_INITIALIZE/CLEANUP with TIMED_TEST_SUITE_INITIALIZE/ TIMED_TEST_SUITE_CLEANUP. Add c_pal/timed_test_suite.h includes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 659167b commit cf395cf

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tests/com_wrapper_int/com_wrapper_int.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55

66
#include "c_pal/gballoc_hl.h"
77
#include "c_pal/gballoc_hl_redirect.h"
8+
#include "c_pal/timed_test_suite.h"
89

910
#include "real_gballoc_hl.h"
1011

1112
#include "test_object_custom_alloc_wrapper.h"
1213

1314
BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)
1415

15-
TEST_SUITE_INITIALIZE(suite_initialize)
16+
TIMED_TEST_SUITE_INITIALIZE(suite_initialize, TIMED_TEST_DEFAULT_TIMEOUT_MS)
1617
{
1718
ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL));
1819
}
1920

20-
TEST_SUITE_CLEANUP(suite_cleanup)
21+
TIMED_TEST_SUITE_CLEANUP(suite_cleanup)
2122
{
2223
real_gballoc_hl_deinit();
2324
}
@@ -46,4 +47,4 @@ TEST_FUNCTION(custom_allocator_create_and_release_succeeds)
4647
(void)custom_interface->lpVtbl->Release(custom_interface);
4748
}
4849

49-
END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)
50+
END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)

tests/com_wrapper_ut/com_wrapper_ut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DEFINE_COM_WRAPPER_OBJECT(TEST_OBJECT_NOT_ENOUGH_HANDLE, TEST_OBJECT_NOT_ENOUGH_
5757

5858
BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)
5959

60-
TEST_SUITE_INITIALIZE(suite_init)
60+
TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS)
6161
{
6262
ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL));
6363

@@ -76,7 +76,7 @@ TEST_SUITE_INITIALIZE(suite_init)
7676
REGISTER_GLOBAL_MOCK_HOOK(ut_custom_free, real_gballoc_hl_free);
7777
}
7878

79-
TEST_SUITE_CLEANUP(suite_cleanup)
79+
TIMED_TEST_SUITE_CLEANUP(suite_cleanup)
8080
{
8181
umock_c_deinit();
8282

tests/com_wrapper_ut/com_wrapper_ut_pch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS
2323
#include "c_pal/gballoc_hl.h"
2424
#include "c_pal/gballoc_hl_redirect.h"
25+
#include "c_pal/timed_test_suite.h"
2526
#include "test_object.h"
2627

2728
#include "umock_c/umock_c_DISABLE_MOCKS.h" // ============================== DISABLE_MOCKS
@@ -36,4 +37,4 @@
3637
#include "test_object_wrapper.h"
3738
#include "test_object_2_wrapper.h"
3839

39-
#endif // COM_WRAPPER_UT_PCH_H
40+
#endif // COM_WRAPPER_UT_PCH_H

0 commit comments

Comments
 (0)