Skip to content

Commit 0b1ef3f

Browse files
mengxianglinxcarlescufi
authored andcommitted
test: msgq: remove number of cpu restriction
Remove CONFIG_MP_NUM_CPU=1 from test cases of msgq. For CONFIG_MP_NUM_CPU > 1, start a thread with K_NO_WAIT to get message from message queue will run immediately on another cpu and cause message peek failure if there is no message in queue, so put messages in msgq before start that thread. Signed-off-by: Meng xianglin <[email protected]>
1 parent c308f80 commit 0b1ef3f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
CONFIG_ZTEST=y
22
CONFIG_IRQ_OFFLOAD=y
33
CONFIG_TEST_USERSPACE=y
4-
CONFIG_MP_NUM_CPUS=1

tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ static void thread_entry(void *p1, void *p2, void *p3)
9393
static void msgq_thread(struct k_msgq *pmsgq)
9494
{
9595
/**TESTPOINT: thread-thread data passing via message queue*/
96+
put_msgq(pmsgq);
9697
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
9798
thread_entry, pmsgq, NULL, NULL,
9899
K_PRIO_PREEMPT(0),
99100
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
100-
put_msgq(pmsgq);
101101
k_sem_take(&end_sema, K_FOREVER);
102102
k_thread_abort(tid);
103103

0 commit comments

Comments
 (0)