|
Zephyr Project API
3.2.0
A Scalable Open Source RTOS
|
#include <zephyr/tc_util.h>#include <zephyr/ztest.h>#include <zephyr/kernel.h>#include <zephyr/kernel_structs.h>#include <stdbool.h>Data Structures | |
| struct | fifo_data |
| struct | lifo_data |
| struct | offload_work |
Macros | |
| #define | NUM_SECONDS(x) ((x) * 1000) |
| #define | HALF_SECOND (500) |
| #define | THIRD_SECOND (333) |
| #define | FOURTH_SECOND (250) |
| #define | COOP_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define | PREEM_STACKSIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define | FIFO_TEST_START 10 |
| #define | FIFO_TEST_END 20 |
| #define | SEM_TEST_START 30 |
| #define | SEM_TEST_END 40 |
| #define | LIFO_TEST_START 50 |
| #define | LIFO_TEST_END 60 |
| #define | NON_NULL_PTR ((void *)0x12345678) |
| #define | OFFLOAD_WORKQUEUE_STACK_SIZE 1024 |
| #define | OFFLOAD_WORKQUEUE_PRIORITY (-1) |
Functions | |
| static | K_THREAD_STACK_DEFINE (offload_work_q_stack, 1024) |
| static | K_THREAD_STACK_ARRAY_DEFINE (coop_stack, 2,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) |
| static void * | my_fifo_get (struct k_fifo *fifo, int32_t timeout) |
| static void * | my_lifo_get (struct k_lifo *lifo, int32_t timeout) |
| static int | increment_counter (void) |
| static void | sync_threads (struct k_work *work) |
| static void | fifo_tests (int32_t timeout, volatile int *state, void *(*get)(struct k_fifo *, int32_t), int(*sem_take)(struct k_sem *, k_timeout_t)) |
| static void | lifo_tests (int32_t timeout, volatile int *state, void *(*get)(struct k_lifo *, int32_t), int(*sem_take)(struct k_sem *, k_timeout_t)) |
| static void | timer_tests (void) |
| static void | coop_high (void *arg1, void *arg2, void *arg3) |
| static void | coop_low (void *arg1, void *arg2, void *arg3) |
| void | task_high (void) |
| void | task_low (void) |
| ZTEST (pending, test_pending_fifo) | |
| Test pending of workq, fifo and lifo. More... | |
| ZTEST (pending, test_pending_lifo) | |
| ZTEST (pending, test_pending_timer) | |
| K_THREAD_DEFINE (TASK_LOW,(1024+CONFIG_TEST_EXTRA_STACK_SIZE), task_low, NULL, NULL, NULL, 7, 0, 0) | |
| K_THREAD_DEFINE (TASK_HIGH,(1024+CONFIG_TEST_EXTRA_STACK_SIZE), task_high, NULL, NULL, NULL, 5, 0, 0) | |
| ZTEST_SUITE (pending, NULL, NULL, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL) | |
Variables | |
| static struct k_work_q | offload_work_q |
| static struct k_thread | coop_thread [2] |
| static struct k_fifo | fifo |
| static struct k_lifo | lifo |
| static struct k_timer | timer |
| static struct k_sem | start_test_sem |
| static struct k_sem | sync_test_sem |
| static struct k_sem | end_test_sem |
| struct fifo_data | fifo_test_data [4] |
| struct lifo_data | lifo_test_data [4] |
| static uint32_t | timer_start_tick |
| static uint32_t | timer_end_tick |
| static void * | timer_data |
| static int __noinit | coop_high_state |
| static int __noinit | coop_low_state |
| static int __noinit | task_high_state |
| static int __noinit | task_low_state |
| static int __noinit | counter |
| #define COOP_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define FIFO_TEST_END 20 |
| #define FIFO_TEST_START 10 |
| #define FOURTH_SECOND (250) |
| #define HALF_SECOND (500) |
| #define LIFO_TEST_END 60 |
| #define LIFO_TEST_START 50 |
| #define NON_NULL_PTR ((void *)0x12345678) |
| #define NUM_SECONDS | ( | x | ) | ((x) * 1000) |
| #define OFFLOAD_WORKQUEUE_PRIORITY (-1) |
| #define OFFLOAD_WORKQUEUE_STACK_SIZE 1024 |
| #define PREEM_STACKSIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define SEM_TEST_END 40 |
| #define SEM_TEST_START 30 |
| #define THIRD_SECOND (333) |
|
static |
|
static |
|
static |
|
static |
| K_THREAD_DEFINE | ( | TASK_HIGH | , |
| (1024+CONFIG_TEST_EXTRA_STACK_SIZE) | , | ||
| task_high | , | ||
| NULL | , | ||
| NULL | , | ||
| NULL | , | ||
| 5 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| K_THREAD_DEFINE | ( | TASK_LOW | , |
| (1024+CONFIG_TEST_EXTRA_STACK_SIZE) | , | ||
| task_low | , | ||
| NULL | , | ||
| NULL | , | ||
| NULL | , | ||
| 7 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
|
static |
|
static |
|
static |
|
static |
| void task_high | ( | void | ) |
| void task_low | ( | void | ) |
|
static |
| ZTEST_SUITE | ( | pending | , |
| NULL | , | ||
| NULL | , | ||
| ztest_simple_1cpu_before | , | ||
| ztest_simple_1cpu_after | , | ||
| NULL | |||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct fifo_data fifo_test_data[4] |
|
static |
| struct lifo_data lifo_test_data[4] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |