diff --git a/tests/posix/rwlocks/prj.conf b/tests/posix/rwlocks/prj.conf index e55d87a7ad143..eff85b030dd6e 100644 --- a/tests/posix/rwlocks/prj.conf +++ b/tests/posix/rwlocks/prj.conf @@ -3,3 +3,7 @@ CONFIG_ZTEST=y CONFIG_POSIX_AEP_CHOICE_BASE=y CONFIG_POSIX_READER_WRITER_LOCKS=y + +CONFIG_DYNAMIC_THREAD=y +CONFIG_DYNAMIC_THREAD_POOL_SIZE=3 +CONFIG_THREAD_STACK_INFO=y diff --git a/tests/posix/rwlocks/src/main.c b/tests/posix/rwlocks/src/main.c index 450180aff6f8d..7e0fd101f028a 100644 --- a/tests/posix/rwlocks/src/main.c +++ b/tests/posix/rwlocks/src/main.c @@ -11,6 +11,7 @@ #include #define N_THR 3 +BUILD_ASSERT(N_THR <= CONFIG_DYNAMIC_THREAD_POOL_SIZE, "Insufficient number of dynamic threads"); LOG_MODULE_REGISTER(posix_rwlock_test); @@ -144,14 +145,4 @@ ZTEST(posix_rw_locks, test_pthread_rwlockattr_setpshared) test_pthread_rwlockattr_pshared_common(true, PTHREAD_PROCESS_SHARED); } -static void before(void *arg) -{ - ARG_UNUSED(arg); - - if (!IS_ENABLED(CONFIG_DYNAMIC_THREAD)) { - /* skip redundant testing if there is no thread pool / heap allocation */ - ztest_test_skip(); - } -} - -ZTEST_SUITE(posix_rw_locks, NULL, NULL, before, NULL, NULL); +ZTEST_SUITE(posix_rw_locks, NULL, NULL, NULL, NULL, NULL);