Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <toolchain.h>
#include <ztest.h>

Data Structures

struct  test_running_cancel_timer
 
struct  test_drain_wait_timer
 
struct  state_1cpu_basic_schedule_running
 

Macros

#define STACK_SIZE   (1024 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define COOPHI_PRIORITY   K_PRIO_COOP(0) /* = -4 */
 
#define COOPLO_PRIORITY   K_PRIO_COOP(3) /* = -1 */
 
#define PREEMPT_PRIORITY   K_PRIO_PREEMPT(1) /* = 1 */
 
#define DELAY_MS   100
 
#define DELAY_TIMEOUT   K_MSEC(DELAY_MS)
 

Functions

static K_THREAD_STACK_DEFINE (coophi_stack,(1024+CONFIG_TEST_EXTRA_STACKSIZE))
 
static int coophi_counter (void)
 
static K_THREAD_STACK_DEFINE (cooplo_stack,(1024+CONFIG_TEST_EXTRA_STACKSIZE))
 
static int cooplo_counter (void)
 
static int coop_counter (struct k_work_q *wq)
 
static K_THREAD_STACK_DEFINE (preempt_stack,(1024+CONFIG_TEST_EXTRA_STACKSIZE))
 
static int preempt_counter (void)
 
static int system_counter (void)
 
static void reset_counters (void)
 
static void counter_handler (struct k_work *work)
 
static void handler_release (void)
 
static void async_release_cb (struct k_timer *timer)
 
static K_TIMER_DEFINE (async_releaser, async_release_cb, NULL)
 
static void async_release (void)
 
static void rel_handler (struct k_work *work)
 
static void delay_handler (struct k_work *work)
 
static void test_work_init (void)
 
static void test_delayable_init (void)
 
static void test_legacy_delayed_init (void)
 
static void test_unstarted (void)
 
static void test_queue_start (void)
 
static void test_null_queue (void)
 
static void test_1cpu_simple_queue (void)
 
static void test_smp_simple_queue (void)
 
static void test_1cpu_sync_queue (void)
 
static void test_1cpu_reentrant_queue (void)
 
static void test_1cpu_queued_flush (void)
 
static void test_1cpu_running_flush (void)
 
static void test_1cpu_delayed_flush (void)
 
static void test_1cpu_queued_cancel (void)
 
static void test_1cpu_queued_cancel_sync (void)
 
static void test_1cpu_delayed_cancel (void)
 
static void test_1cpu_delayed_cancel_sync (void)
 
static void test_1cpu_delayed_cancel_sync_wait (void)
 
static void test_running_cancel_cb (struct k_timer *timer)
 
static void test_1cpu_running_cancel (void)
 
static void test_1cpu_running_cancel_sync (void)
 
static void test_smp_running_cancel (void)
 
static void test_drain_empty (void)
 
static void test_drain_wait_cb (struct k_timer *timer)
 
static void test_1cpu_drain_wait (void)
 
static void test_1cpu_plugged_drain (void)
 
static void test_1cpu_basic_schedule (void)
 
static void handle_1cpu_basic_schedule_running (struct k_work *work)
 
static void test_1cpu_basic_schedule_running (void)
 
static void test_1cpu_immed_schedule (void)
 
static void test_1cpu_basic_reschedule (void)
 
static void test_1cpu_immed_reschedule (void)
 
static bool try_queue_no_yield (struct k_work_q *wq)
 
static void test_1cpu_queue_no_yield (void)
 
static void test_1cpu_system_queue (void)
 
static void test_1cpu_system_schedule (void)
 
static void test_1cpu_system_reschedule (void)
 
static void test_1cpu_legacy_delayed_submit (void)
 
static void test_1cpu_legacy_delayed_resubmit (void)
 
static void test_1cpu_legacy_delayed_cancel (void)
 
static void test_nop (void)
 
void test_main (void)
 

Variables

static struct k_sem sync_sem
 
static struct k_sem rel_sem
 
static struct k_work work
 
static struct k_work_delayable dwork
 
static struct k_work_sync work_sync
 
static struct k_threadmain_thread
 
static atomic_t resubmits_left
 
static uint32_t volatile last_handle_ms
 
static struct k_work_q coophi_queue
 
static atomic_t coophi_ctr
 
static struct k_work_q cooplo_queue
 
static atomic_t cooplo_ctr
 
static struct k_work_q preempt_queue
 
static atomic_t preempt_ctr
 
static atomic_t system_ctr
 
static struct test_running_cancel_timer test_running_cancel_ctx
 
static struct test_drain_wait_timer test_drain_wait_ctx
 

Macro Definition Documentation

◆ COOPHI_PRIORITY

#define COOPHI_PRIORITY   K_PRIO_COOP(0) /* = -4 */

◆ COOPLO_PRIORITY

#define COOPLO_PRIORITY   K_PRIO_COOP(3) /* = -1 */

◆ DELAY_MS

#define DELAY_MS   100

◆ DELAY_TIMEOUT

#define DELAY_TIMEOUT   K_MSEC(DELAY_MS)

◆ PREEMPT_PRIORITY

#define PREEMPT_PRIORITY   K_PRIO_PREEMPT(1) /* = 1 */

◆ STACK_SIZE

#define STACK_SIZE   (1024 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ async_release()

static void async_release ( void  )
inlinestatic

◆ async_release_cb()

static void async_release_cb ( struct k_timer *  timer)
static

◆ coop_counter()

static int coop_counter ( struct k_work_q wq)
inlinestatic

◆ coophi_counter()

static int coophi_counter ( void  )
inlinestatic

◆ cooplo_counter()

static int cooplo_counter ( void  )
inlinestatic

◆ counter_handler()

static void counter_handler ( struct k_work work)
static

◆ delay_handler()

static void delay_handler ( struct k_work work)
static

◆ handle_1cpu_basic_schedule_running()

static void handle_1cpu_basic_schedule_running ( struct k_work work)
static

◆ handler_release()

static void handler_release ( void  )
inlinestatic

◆ K_THREAD_STACK_DEFINE() [1/3]

static K_THREAD_STACK_DEFINE ( coophi_stack  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ K_THREAD_STACK_DEFINE() [2/3]

static K_THREAD_STACK_DEFINE ( cooplo_stack  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ K_THREAD_STACK_DEFINE() [3/3]

static K_THREAD_STACK_DEFINE ( preempt_stack  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ K_TIMER_DEFINE()

static K_TIMER_DEFINE ( async_releaser  ,
async_release_cb  ,
NULL   
)
static

◆ preempt_counter()

static int preempt_counter ( void  )
inlinestatic

◆ rel_handler()

static void rel_handler ( struct k_work work)
static

◆ reset_counters()

static void reset_counters ( void  )
inlinestatic

◆ system_counter()

static int system_counter ( void  )
inlinestatic

◆ test_1cpu_basic_reschedule()

static void test_1cpu_basic_reschedule ( void  )
static

◆ test_1cpu_basic_schedule()

static void test_1cpu_basic_schedule ( void  )
static

◆ test_1cpu_basic_schedule_running()

static void test_1cpu_basic_schedule_running ( void  )
static

◆ test_1cpu_delayed_cancel()

static void test_1cpu_delayed_cancel ( void  )
static

◆ test_1cpu_delayed_cancel_sync()

static void test_1cpu_delayed_cancel_sync ( void  )
static

◆ test_1cpu_delayed_cancel_sync_wait()

static void test_1cpu_delayed_cancel_sync_wait ( void  )
static

◆ test_1cpu_delayed_flush()

static void test_1cpu_delayed_flush ( void  )
static

◆ test_1cpu_drain_wait()

static void test_1cpu_drain_wait ( void  )
static

◆ test_1cpu_immed_reschedule()

static void test_1cpu_immed_reschedule ( void  )
static

◆ test_1cpu_immed_schedule()

static void test_1cpu_immed_schedule ( void  )
static

◆ test_1cpu_legacy_delayed_cancel()

static void test_1cpu_legacy_delayed_cancel ( void  )
static

◆ test_1cpu_legacy_delayed_resubmit()

static void test_1cpu_legacy_delayed_resubmit ( void  )
static

◆ test_1cpu_legacy_delayed_submit()

static void test_1cpu_legacy_delayed_submit ( void  )
static

◆ test_1cpu_plugged_drain()

static void test_1cpu_plugged_drain ( void  )
static

◆ test_1cpu_queue_no_yield()

static void test_1cpu_queue_no_yield ( void  )
static

◆ test_1cpu_queued_cancel()

static void test_1cpu_queued_cancel ( void  )
static

◆ test_1cpu_queued_cancel_sync()

static void test_1cpu_queued_cancel_sync ( void  )
static

◆ test_1cpu_queued_flush()

static void test_1cpu_queued_flush ( void  )
static

◆ test_1cpu_reentrant_queue()

static void test_1cpu_reentrant_queue ( void  )
static

◆ test_1cpu_running_cancel()

static void test_1cpu_running_cancel ( void  )
static

◆ test_1cpu_running_cancel_sync()

static void test_1cpu_running_cancel_sync ( void  )
static

◆ test_1cpu_running_flush()

static void test_1cpu_running_flush ( void  )
static

◆ test_1cpu_simple_queue()

static void test_1cpu_simple_queue ( void  )
static

◆ test_1cpu_sync_queue()

static void test_1cpu_sync_queue ( void  )
static

◆ test_1cpu_system_queue()

static void test_1cpu_system_queue ( void  )
static

◆ test_1cpu_system_reschedule()

static void test_1cpu_system_reschedule ( void  )
static

◆ test_1cpu_system_schedule()

static void test_1cpu_system_schedule ( void  )
static

◆ test_delayable_init()

static void test_delayable_init ( void  )
static

◆ test_drain_empty()

static void test_drain_empty ( void  )
static

◆ test_drain_wait_cb()

static void test_drain_wait_cb ( struct k_timer *  timer)
static

◆ test_legacy_delayed_init()

static void test_legacy_delayed_init ( void  )
static

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_nop()

static void test_nop ( void  )
static

◆ test_null_queue()

static void test_null_queue ( void  )
static

◆ test_queue_start()

static void test_queue_start ( void  )
static

◆ test_running_cancel_cb()

static void test_running_cancel_cb ( struct k_timer *  timer)
static

◆ test_smp_running_cancel()

static void test_smp_running_cancel ( void  )
static

◆ test_smp_simple_queue()

static void test_smp_simple_queue ( void  )
static

◆ test_unstarted()

static void test_unstarted ( void  )
static

◆ test_work_init()

static void test_work_init ( void  )
static

◆ try_queue_no_yield()

static bool try_queue_no_yield ( struct k_work_q wq)
static

Variable Documentation

◆ coophi_ctr

atomic_t coophi_ctr
static

◆ coophi_queue

struct k_work_q coophi_queue
static

◆ cooplo_ctr

atomic_t cooplo_ctr
static

◆ cooplo_queue

struct k_work_q cooplo_queue
static

◆ dwork

struct k_work_delayable dwork
static

◆ last_handle_ms

uint32_t volatile last_handle_ms
static

◆ main_thread

struct k_thread* main_thread
static

◆ preempt_ctr

atomic_t preempt_ctr
static

◆ preempt_queue

struct k_work_q preempt_queue
static

◆ rel_sem

struct k_sem rel_sem
static

◆ resubmits_left

atomic_t resubmits_left
static

◆ sync_sem

struct k_sem sync_sem
static

◆ system_ctr

atomic_t system_ctr
static

◆ test_drain_wait_ctx

struct test_drain_wait_timer test_drain_wait_ctx
static

◆ test_running_cancel_ctx

struct test_running_cancel_timer test_running_cancel_ctx
static

◆ work

struct k_work work
static

◆ work_sync

struct k_work_sync work_sync
static