Commit 746a3b94 authored by Christopher Friedt's avatar Christopher Friedt Committed by Fabio Baltieri
Browse files

tests: posix: use consistent min stack sizes

* Use PTHREAD_STACK_MIN as provided by the specification
  instead of a hard-coded value of 1024
* add extra stack size to semaphore tests

Signed-off-by: default avatarChristopher Friedt <cfriedt@meta.com>
parent ecda7207
Loading
Loading
Loading
Loading
+1 −1
Changes for tests/posix/common/src/key.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@

#define N_THR 2
#define N_KEY 2
#define STACKSZ (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
#define STACKSZ (MAX(1024, PTHREAD_STACK_MIN) + CONFIG_TEST_EXTRA_STACK_SIZE)
#define BUFFSZ 48

K_THREAD_STACK_ARRAY_DEFINE(stackp, N_THR, STACKSZ);
+1 −1
Changes for tests/posix/common/src/mqueue.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include <zephyr/ztest.h>

#define N_THR 2
#define STACKSZ (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
#define STACKSZ (MAX(1024, PTHREAD_STACK_MIN) + CONFIG_TEST_EXTRA_STACK_SIZE)
#define SENDER_THREAD 0
#define RECEIVER_THREAD 1
#define MESSAGE_SIZE 16
+2 −1
Changes for tests/posix/common/src/mutex.c: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,9 +7,10 @@
#include <errno.h>
#include <pthread.h>

#include <zephyr/sys/util.h>
#include <zephyr/ztest.h>

#define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
#define STACK_SIZE (MAX(1024, PTHREAD_STACK_MIN) + CONFIG_TEST_EXTRA_STACK_SIZE)

static K_THREAD_STACK_DEFINE(stack, STACK_SIZE);

+1 −1
Changes for tests/posix/common/src/pthread.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#define N_THR_E 3
#define N_THR_T 4
#define BOUNCES 64
#define STACKS (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
#define STACKS (MAX(1024, PTHREAD_STACK_MIN) + CONFIG_TEST_EXTRA_STACK_SIZE)
#define THREAD_PRIORITY 3
#define ONE_SECOND 1

+1 −1
Changes for tests/posix/common/src/rwlock.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include <zephyr/ztest.h>

#define N_THR 3
#define STACKSZ (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
#define STACKSZ (MAX(1024, PTHREAD_STACK_MIN) + CONFIG_TEST_EXTRA_STACK_SIZE)

K_THREAD_STACK_ARRAY_DEFINE(stack, N_THR, STACKSZ);
pthread_rwlock_t rwlock;
Loading