Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>
Data Structures | |
struct | mem_block |
Macros | |
#define | STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | PIPE_LEN (4 * 16) |
#define | BYTES_TO_WRITE 16 |
#define | BYTES_TO_READ BYTES_TO_WRITE |
#define | SZ 128 |
Functions | |
K_HEAP_DEFINE (mpool,(4 *16) *1) | |
K_PIPE_DEFINE (kpipe,(4 *16), 4) | |
TESTPOINT: init via K_PIPE_DEFINE. | |
K_PIPE_DEFINE (khalfpipe,((4 *16)/2), 4) | |
K_PIPE_DEFINE (kpipe1,(4 *16), 4) | |
K_PIPE_DEFINE (pipe_test_alloc,(4 *16), 4) | |
K_PIPE_DEFINE (ksmallpipe, 10, 2) | |
K_THREAD_STACK_DEFINE (tstack,(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_DEFINE (tstack1,(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_DEFINE (tstack2,(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_SEM_DEFINE (end_sema, 0, 1) | |
K_HEAP_DEFINE (test_pool, 128 *4) | |
static void | tpipe_put (struct k_pipe *ppipe, k_timeout_t timeout) |
static void | tpipe_get (struct k_pipe *ppipe, k_timeout_t timeout) |
static void | tThread_entry (void *p1, void *p2, void *p3) |
static void | tpipe_thread_thread (struct k_pipe *ppipe) |
static void | tpipe_kthread_to_kthread (struct k_pipe *ppipe) |
static void | tpipe_put_no_wait (struct k_pipe *ppipe) |
static void | tpipe_put_small_size (struct k_pipe *ppipe, k_timeout_t timeout) |
static void | tpipe_get_small_size (struct k_pipe *ppipe, k_timeout_t timeout) |
static void | tpipe_get_large_size (struct k_pipe *ppipe, k_timeout_t timeout) |
ZTEST (pipe_api_1cpu, test_pipe_alloc) | |
Test Initialization and buffer allocation of pipe, with various parameters. | |
static void | thread_for_get_forever (void *p1, void *p2, void *p3) |
ZTEST (pipe_api, test_pipe_cleanup) | |
static void | thread_handler (void *p1, void *p2, void *p3) |
ZTEST (pipe_api_1cpu, test_pipe_thread2thread) | |
Test pipe data passing between threads. | |
ZTEST_USER (pipe_api_1cpu, test_pipe_user_thread2thread) | |
Test data passing using pipes between user threads. | |
ZTEST (pipe_api, test_resource_pool_auto_free) | |
Test resource pool free. | |
static void | tThread_half_pipe_put (void *p1, void *p2, void *p3) |
static void | tThread_half_pipe_get (void *p1, void *p2, void *p3) |
ZTEST (pipe_api, test_half_pipe_put_get) | |
Test put/get with smaller pipe buffer. | |
ZTEST (pipe_api, test_pipe_get_put) | |
ZTEST (pipe_api, test_pipe_get_large) | |
ZTEST (pipe_api, test_pipe_reader_wait) | |
Test pending reader in pipe. | |
Variables | |
static ZTEST_DMEM unsigned char | data [] |
struct k_pipe pipe | pipe1 |
struct k_thread | tdata |
struct k_thread | tdata1 |
struct k_thread | tdata2 |
#define BYTES_TO_READ BYTES_TO_WRITE |
#define BYTES_TO_WRITE 16 |
#define PIPE_LEN (4 * 16) |
#define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define SZ 128 |
K_HEAP_DEFINE | ( | mpool | , |
(4 *16) * | 1 | ||
) |
K_HEAP_DEFINE | ( | test_pool | , |
128 * | 4 | ||
) |
K_PIPE_DEFINE | ( | khalfpipe | , |
((4 *16)/2) | , | ||
4 | |||
) |
K_PIPE_DEFINE | ( | kpipe | , |
(4 *16) | , | ||
4 | |||
) |
TESTPOINT: init via K_PIPE_DEFINE.
K_PIPE_DEFINE | ( | kpipe1 | , |
(4 *16) | , | ||
4 | |||
) |
K_PIPE_DEFINE | ( | ksmallpipe | , |
10 | , | ||
2 | |||
) |
K_PIPE_DEFINE | ( | pipe_test_alloc | , |
(4 *16) | , | ||
4 | |||
) |
K_SEM_DEFINE | ( | end_sema | , |
0 | , | ||
1 | |||
) |
K_THREAD_STACK_DEFINE | ( | tstack | , |
(1024+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | tstack1 | , |
(1024+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | tstack2 | , |
(1024+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
|
static |
|
static |
|
static |
TESTPOINT: pipe get
|
static |
TESTPOINT: pipe get
|
static |
TESTPOINT: pipe get
|
static |
TESTPOINT: thread-thread data passing via pipe
|
static |
TESTPOINT: pipe put
|
static |
TESTPOINT: pipe put
|
static |
TESTPOINT: pipe put
|
static |
TESTPOINT: thread-thread data passing via pipe
|
static |
ZTEST | ( | pipe_api | , |
test_pipe_cleanup | |||
) |
TESTPOINT: test if a dynamically allocated buffer can be freed
TESTPOINT: nothing to do with k_pipe_cleanup() for static buffer in pipe
ZTEST | ( | pipe_api_1cpu | , |
test_pipe_alloc | |||
) |
Test Initialization and buffer allocation of pipe, with various parameters.
|
static |
struct k_thread tdata |
struct k_thread tdata1 |
struct k_thread tdata2 |