Zephyr Project API
3.1.0
A Scalable Open Source RTOS
|
#include <stdbool.h>
#include <zephyr/toolchain.h>
#include <zephyr/zephyr.h>
#include <ztest.h>
#include <tc_util.h>
#include <zephyr/sys/util.h>
Data Structures | |
struct | delayed_test_item |
struct | triggered_test_item |
struct | triggered_from_msgq_test_item |
Macros | |
#define | NUM_TEST_ITEMS 6 |
#define | WORK_ITEM_WAIT 100 |
#define | WORK_ITEM_WAIT_ALIGNED k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(WORK_ITEM_WAIT) + _TICK_ALIGN) |
#define | SUBMIT_WAIT 50 |
#define | STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | CHECK_WAIT ((NUM_TEST_ITEMS + 1) * WORK_ITEM_WAIT_ALIGNED) |
#define | MSG_PROVIDER_THREAD_STACK_SIZE 0x400U |
#define | MSG_CONSUMER_WORKQ_STACK_SIZE 0x400U |
#define | MSG_PROVIDER_THREAD_PRIO K_PRIO_PREEMPT(8) |
#define | MSG_CONSUMER_WORKQ_PRIO K_PRIO_COOP(7) |
#define | MSG_SIZE 16U |
Functions | |
static | K_THREAD_STACK_DEFINE (co_op_stack,(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) |
static | K_THREAD_STACK_DEFINE (provider_thread_stack, 0x400U) |
static | K_THREAD_STACK_DEFINE (consumer_workq_stack, 0x400U) |
static void | work_handler (struct k_work *work) |
static void | delayed_test_items_init (void) |
static void | reset_results (void) |
static void | coop_work_main (int arg1, int arg2) |
static void | delayed_test_items_submit (void) |
static void | check_results (int num_tests) |
static void | test_sequence (void) |
Test work queue items submission sequence. More... | |
static void | resubmit_work_handler (struct k_work *work) |
static void | test_resubmit (void) |
Test work queue item resubmission. More... | |
static void | delayed_work_handler (struct k_work *work) |
static void | test_delayed_init (void) |
Test delayed work queue init. More... | |
static void | coop_delayed_work_main (int arg1, int arg2) |
static void | test_delayed_submit (void) |
Test delayed workqueue submit. More... | |
static void | coop_delayed_work_cancel_main (int arg1, int arg2) |
static void | test_delayed_cancel (void) |
Test work queue delayed cancel. More... | |
static void | test_delayed_pending (void) |
static void | test_delayed (void) |
Test delayed work items. More... | |
static void | triggered_work_handler (struct k_work *work) |
static void | test_triggered_init (void) |
Test triggered work queue init. More... | |
static void | test_triggered_submit (k_timeout_t timeout) |
Test triggered workqueue submit. More... | |
static void | test_triggered_trigger (void) |
Trigger triggered workqueue execution. More... | |
static void | test_triggered (void) |
Test triggered work items. More... | |
static void | test_already_triggered (void) |
Test already triggered work items. More... | |
static void | triggered_resubmit_work_handler (struct k_work *work) |
static void | test_triggered_resubmit (void) |
Test resubmission of triggered work queue item. More... | |
static void | test_triggered_no_wait (void) |
Test triggered work items with K_NO_WAIT timeout. More... | |
static void | test_triggered_no_wait_expired (void) |
Test expired triggered work items with K_NO_WAIT timeout. More... | |
static void | test_triggered_wait (void) |
Test triggered work items with arbitrary timeout. More... | |
static void | test_triggered_wait_expired (void) |
Test expired triggered work items with arbitrary timeout. More... | |
static void | msg_provider_thread (void *p1, void *p2, void *p3) |
static void | triggered_from_msgq_work_handler (struct k_work *work) |
static void | test_triggered_from_msgq_init (void) |
static void | test_triggered_from_msgq_start (void) |
static void | test_triggered_from_msgq (void) |
Test triggered work item, triggered by a msgq message. More... | |
void | test_delayed_work_define (void) |
Test delayed work queue define macro. More... | |
static void | test_triggered_cancel (void) |
Verify k_work_poll_cancel() More... | |
void | test_main (void) |
| |
Variables | |
static struct k_thread | co_op_data |
static struct delayed_test_item | delayed_tests [6] |
static struct triggered_test_item | triggered_tests [6] |
static int | results [6] |
static int | num_results |
static int | expected_poll_result |
static struct triggered_from_msgq_test_item | triggered_from_msgq_test |
#define CHECK_WAIT ((NUM_TEST_ITEMS + 1) * WORK_ITEM_WAIT_ALIGNED) |
#define MSG_CONSUMER_WORKQ_PRIO K_PRIO_COOP(7) |
#define MSG_CONSUMER_WORKQ_STACK_SIZE 0x400U |
#define MSG_PROVIDER_THREAD_PRIO K_PRIO_PREEMPT(8) |
#define MSG_PROVIDER_THREAD_STACK_SIZE 0x400U |
#define MSG_SIZE 16U |
#define NUM_TEST_ITEMS 6 |
#define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define SUBMIT_WAIT 50 |
#define WORK_ITEM_WAIT 100 |
#define WORK_ITEM_WAIT_ALIGNED k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(WORK_ITEM_WAIT) + _TICK_ALIGN) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void test_main | ( | void | ) |
test case main entry
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |