Skip to content

Commit fb34813

Browse files
committed
Fix test build failure on windows platforms
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com> (cherry picked from commit deff403)
1 parent 1769366 commit fb34813

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ else()
5050
# MSVC's legacy preprocessor mis-handles the token-paste + rescan used
5151
# by IS_ENABLED() in utils/include/utils/utils.h, silently returning 0
5252
# for every defined-as-1 flag. /Zc:preprocessor switches to the
53-
# C99/C11-conformant preprocessor (VS 2019 16.5+).
54-
add_compile_options(/Zc:preprocessor)
53+
# C99/C11-conformant preprocessor (VS 2019 16.5+). /std:c11 is also
54+
# required so _Static_assert (used by the IS_ENABLED self-test in
55+
# utils/src/utils.c) is recognised as a keyword.
56+
add_compile_options(/Zc:preprocessor /std:c11)
5557
endif()
5658

5759
if (OPT_BUILD_BARE_METAL)

tests/unit-tests/test-async-fuzz.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ static bool test_async_recovery(void)
229229
struct async_test_data data = {0};
230230
int retry_count = 0;
231231
const int max_retries = 2; /* Allow 2 retries for this challenging scenario */
232+
struct test dummy_test = { .loglevel = OSDP_LOG_INFO };
232233

233234
printf(SUB_2 "Testing CP restart recovery\n");
234235

235236
retry_recovery:
236237
/* Setup devices with dummy test structure */
237-
struct test dummy_test = { .loglevel = OSDP_LOG_INFO };
238238
if (test_setup_devices(&dummy_test, &cp_ctx, &pd_ctx)) {
239239
printf(SUB_2 "Failed to setup devices\n");
240240
return false;
@@ -499,4 +499,4 @@ void run_async_fuzz_tests(struct test *t)
499499

500500
printf(SUB_1 "Async fuzz tests %s\n", overall_result ? "succeeded" : "failed");
501501
TEST_REPORT(t, overall_result);
502-
}
502+
}

0 commit comments

Comments
 (0)