Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>
Data Structures | |
struct | pipe_sequence |
Macros | |
#define | STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | PIPE_SIZE (256) |
#define | TOTAL_ELEMENTS (sizeof(single_elements) / sizeof(struct pipe_sequence)) |
#define | TOTAL_WAIT_ELEMENTS |
#define | TOTAL_TIMEOUT_ELEMENTS |
#define | NO_CONSTRAINT (0U) |
#define | ATLEAST_1 (1U) |
#define | ALL_BYTES (sizeof(tx_buffer)) |
#define | RETURN_SUCCESS (0) |
#define | TIMEOUT_VAL (K_MSEC(10)) |
#define | TIMEOUT_200MSEC (K_MSEC(200)) |
Functions | |
K_PIPE_DEFINE (test_pipe, 256, 4) | |
Define and initialize test_pipe at compile time. | |
K_PIPE_DEFINE (small_pipe, 10, 4) | |
K_THREAD_STACK_DEFINE (stack_1,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_SEM_DEFINE (get_sem, 0, 1) | |
K_SEM_DEFINE (put_sem, 1, 1) | |
K_SEM_DEFINE (sync_sem, 0, 1) | |
K_SEM_DEFINE (multiple_send_sem, 0, 1) | |
uint32_t | rx_buffer_check (char *buffer, uint32_t size) |
void | pipe_put_single (void) |
void | pipe_get_single (void *p1, void *p2, void *p3) |
void | pipe_put_multiple (void) |
void | pipe_get_multiple (void *p1, void *p2, void *p3) |
void | pipe_put_forever_wait (void) |
void | pipe_get_forever_wait (void *pi, void *p2, void *p3) |
void | pipe_put_timeout (void) |
void | pipe_get_timeout (void *pi, void *p2, void *p3) |
void | pipe_get_on_empty_pipe (void) |
void | pipe_put_forever_timeout (void) |
void | pipe_get_forever_timeout (void *p1, void *p2, void *p3) |
void | pipe_put_get_timeout (void) |
void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf) |
Fatal error policy handler. | |
ZTEST_USER (pipe, test_pipe_on_single_elements) | |
Verify pipe with 1 element insert. | |
ZTEST_USER (pipe, test_pipe_on_multiple_elements) | |
Test when multiple items are present in the pipe. | |
ZTEST_USER (pipe, test_pipe_forever_wait) | |
Test when multiple items are present with wait. | |
ZTEST_USER (pipe, test_pipe_timeout) | |
Test pipes with timeout. | |
ZTEST_USER (pipe, test_pipe_get_on_empty_pipe) | |
Test pipe get from a empty pipe. | |
ZTEST_USER (pipe, test_pipe_forever_timeout) | |
Test the pipe_get with K_FOREVER as timeout. | |
ZTEST_USER (pipe, test_pipe_get_timeout) | |
k_pipe_get timeout test | |
ZTEST_USER (pipe, test_pipe_get_invalid_size) | |
Test pipe get of invalid size. | |
ZTEST_USER (pipe, test_pipe_get_min_xfer) | |
Test pipe get returns immediately if >= min_xfer is available. | |
ZTEST_USER (pipe, test_pipe_put_min_xfer) | |
Test pipe put returns immediately if >= min_xfer is available. | |
ZTEST (pipe, test_pipe_define_at_runtime) | |
Test defining and initializing pipes at run time. | |
void | test_pipe_flush_helper (void *p1, void *p2, void *p3) |
Helper thread to test k_pipe_flush() and k_pipe_buffer_flush() | |
ZTEST (pipe, test_pipe_flush) | |
Test flushing a pipe. | |
Variables | |
ZTEST_BMEM uint8_t | tx_buffer [(256)+1] |
ZTEST_BMEM uint8_t | rx_buffer [(256)+1] |
static const struct pipe_sequence | single_elements [] |
static const struct pipe_sequence | multiple_elements [] |
static const struct pipe_sequence | wait_elements [] |
static const struct pipe_sequence | timeout_elements [] |
struct k_thread | get_single_tid |
ZTEST_BMEM bool | valid_fault |
#define ATLEAST_1 (1U) |
#define NO_CONSTRAINT (0U) |
#define PIPE_SIZE (256) |
#define RETURN_SUCCESS (0) |
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define TIMEOUT_200MSEC (K_MSEC(200)) |
#define TIMEOUT_VAL (K_MSEC(10)) |
#define TOTAL_ELEMENTS (sizeof(single_elements) / sizeof(struct pipe_sequence)) |
#define TOTAL_TIMEOUT_ELEMENTS |
#define TOTAL_WAIT_ELEMENTS |
K_PIPE_DEFINE | ( | small_pipe | , |
10 | , | ||
4 | |||
) |
K_PIPE_DEFINE | ( | test_pipe | , |
256 | , | ||
4 | |||
) |
Define and initialize test_pipe at compile time.
K_SEM_DEFINE | ( | get_sem | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | multiple_send_sem | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | put_sem | , |
1 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | sync_sem | , |
0 | , | ||
1 | |||
) |
K_THREAD_STACK_DEFINE | ( | stack_1 | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
void pipe_get_forever_timeout | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void pipe_get_forever_wait | ( | void * | pi, |
void * | p2, | ||
void * | p3 | ||
) |
void pipe_get_multiple | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void pipe_get_on_empty_pipe | ( | void | ) |
void pipe_get_single | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void pipe_get_timeout | ( | void * | pi, |
void * | p2, | ||
void * | p3 | ||
) |
void pipe_put_forever_timeout | ( | void | ) |
void pipe_put_forever_wait | ( | void | ) |
void pipe_put_get_timeout | ( | void | ) |
void pipe_put_multiple | ( | void | ) |
void pipe_put_single | ( | void | ) |
void pipe_put_timeout | ( | void | ) |
void test_pipe_flush_helper | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
Helper thread to test k_pipe_flush() and k_pipe_buffer_flush()
This helper thread attempts to write 50 bytes to the pipe identified by [p1], which has an internal buffer size of 10. This helper thread is expected to fill the internal buffer, and then block until it can complete the write.
struct k_thread get_single_tid |
|
static |
ZTEST_BMEM uint8_t rx_buffer[(256)+1] |
|
static |
|
static |
ZTEST_BMEM uint8_t tx_buffer[(256)+1] |
ZTEST_BMEM bool valid_fault |
|
static |