Skip to content

Commit 16a4bf6

Browse files
keith-packardcarlescufi
authored andcommitted
test: cmsis_rtos_v2: Initialize versionInfos
get_version_check will leave the version info unchanged if osKernelGetInfo fails. This lead to a compiler warning when those results were used. Initialize the values with data that will cause a failure that should be easily diagnosed. Signed-off-by: Keith Packard <[email protected]>
1 parent afed5e4 commit 16a4bf6

File tree

1 file changed

+14
-1
lines changed
  • tests/subsys/portability/cmsis_rtos_v2/src

1 file changed

+14
-1
lines changed

tests/subsys/portability/cmsis_rtos_v2/src/kernel.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,20 @@ void lock_unlock_check(const void *arg)
6363

6464
void test_kernel_apis(void)
6565
{
66-
versionInfo version, version_irq;
66+
versionInfo version = {
67+
.os_info = {
68+
.api = 0xfefefefe,
69+
.kernel = 0xfdfdfdfd,
70+
},
71+
.info = "local function call info is uninitialized"
72+
};
73+
versionInfo version_irq = {
74+
.os_info = {
75+
.api = 0xfcfcfcfc,
76+
.kernel = 0xfbfbfbfb,
77+
},
78+
.info = "irq_offload function call info is uninitialized"
79+
};
6780

6881
get_version_check(&version);
6982
irq_offload(get_version_check, (const void *)&version_irq);

0 commit comments

Comments
 (0)