From 1f55c8916db6355a810dabe2ff8a2c3d54f73f6e Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 24 Jan 2017 17:55:08 -0500 Subject: [PATCH] ztest: use an aligned stack size 1000 stack size was causing issues on architectures requireing aligned stacks. Change-Id: I57c06ef7eb09067d0312c27daad5d1300e6f43c6 Signed-off-by: Anas Nashif --- tests/ztest/Kconfig | 2 +- tests/ztest/src/ztest.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/ztest/Kconfig b/tests/ztest/Kconfig index ea9cafe74e1..b48f5d41cd1 100644 --- a/tests/ztest/Kconfig +++ b/tests/ztest/Kconfig @@ -14,7 +14,7 @@ config ZTEST config ZTEST_STACKSIZE int "Test function thread stack size" depends on ZTEST - default 1000 + default 1024 config ZTEST_FAIL_FAST bool "Abort on first failing test" diff --git a/tests/ztest/src/ztest.c b/tests/ztest/src/ztest.c index 28b1bb47c85..8c7ac05c082 100644 --- a/tests/ztest/src/ztest.c +++ b/tests/ztest/src/ztest.c @@ -125,7 +125,10 @@ out: #define FAIL_FAST 0 #endif -static char thread_stack[CONFIG_ZTEST_STACKSIZE]; +#if CONFIG_ZTEST_STACKSIZE & (STACK_ALIGN - 1) + #error "CONFIG_ZTEST_STACKSIZE must be a multiple of the stack alignment" +#endif +static char __stack thread_stack[CONFIG_ZTEST_STACKSIZE]; static int test_result; static struct k_sem mutex;