Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS

Tests for the mailbox kernel object. More...

Functions

void test_mbox_data_get_null (void)
 Test k_mbox_data_get() API. More...
 
void test_mbox_get_put_block_data (void)
 Test put and get mailbox with block data. More...
 

Variables

static ZTEST_BMEM char buffer [8]
 Test mailbox enhance capabilities. More...
 

Detailed Description

Tests for the mailbox kernel object.

Function Documentation

◆ test_mbox_data_get_null()

void test_mbox_data_get_null ( void  )

#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()

◆ test_mbox_get_put_block_data()

void test_mbox_get_put_block_data ( void  )

#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

Variable Documentation

◆ buffer

ZTEST_BMEM char buffer[8]
static

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

Test mailbox enhance capabilities.

  • Define and initilized 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()