Zephyr Project API  3.2.0
A Scalable Open Source RTOS

Tests for the mailbox kernel object. More...

Functions

 ZTEST (mbox_api, test_mbox_data_get_null)
 Test k_mbox_data_get() API. More...
 
 ZTEST (mbox_api, test_mbox_get_put_block_data)
 Test put and get mailbox with block data. More...
 
 ZTEST (mbox_api, test_enhance_capability)
 Test mailbox enhance capabilities. More...
 

Detailed Description

Tests for the mailbox kernel object.

Function Documentation

◆ ZTEST() [1/3]

ZTEST ( mbox_api  ,
test_enhance_capability   
)

#include <tests/kernel/mbox/mbox_api/src/test_mbox_api.c>

Test mailbox enhance capabilities.

  • Define and initialized a message queue and a mailbox
  • Verify the capability of message queue and mailbox
  • with same data.
See also
k_msgq_init() k_msgq_put() k_mbox_async_put() k_mbox_get()

◆ ZTEST() [2/3]

ZTEST ( mbox_api  ,
test_mbox_data_get_null   
)

#include <tests/kernel/mbox/mbox_api/src/test_mbox_api.c>

Test k_mbox_data_get() API.

  • Init a mbox and just invoke k_mbox_data_get() with different input to check robust of API.
See also
k_mbox_data_get()

◆ ZTEST() [3/3]

ZTEST ( mbox_api  ,
test_mbox_get_put_block_data   
)

#include <tests/kernel/mbox/mbox_api/src/test_mbox_api.c>

Test put and get mailbox with block data.

  • Create two threads to put and get block data with specify thread ID and K_FOREVER for each other.
  • Check the result after finished exchange.
See also
k_mbox_init() k_mbox_async_put() k_mbox_get()

TESTPOINT: thread-thread data passing via mbox