Skip to content

Commit 2323319

Browse files
Bradley Bolengalak
authored andcommitted
tests: ztest: Use #if defined()
This compile test should be checking if a symbol has been defined, otherwise it is using the kconfig value directly. This fixes a warning ../src/main.c:115:37: warning: "CONFIG_SOC_QEMU_ARC" is not defined, evaluates to 0 [-Wundef] when using the -Wundef flag. Signed-off-by: Bradley Bolen <[email protected]>
1 parent 505c22e commit 2323319

File tree

1 file changed

+2
-2
lines changed
  • tests/ztest/error_hook/src

1 file changed

+2
-2
lines changed

tests/ztest/error_hook/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ __no_optimization static void trigger_fault_divide_zero(void)
111111
* zero exception. We only skip the QEMU board here, this means this
112112
* test will still apply on the physical board.
113113
*/
114-
#if (defined(CONFIG_SOC_SERIES_MPS2) && (CONFIG_QEMU_TARGET)) || \
115-
(CONFIG_BOARD_QEMU_CORTEX_A53) || (CONFIG_SOC_QEMU_ARC)
114+
#if (defined(CONFIG_SOC_SERIES_MPS2) && defined(CONFIG_QEMU_TARGET)) || \
115+
defined(CONFIG_BOARD_QEMU_CORTEX_A53) || defined(CONFIG_SOC_QEMU_ARC)
116116
ztest_test_skip();
117117
#endif
118118
}

0 commit comments

Comments
 (0)