Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS

Tests for Kernel stack objects. More...

Functions

static void test_single_stack_play (void)
 Verify data passing between threads using single stack. More...
 
static void test_dual_stack_play (void)
 Verify data passing between threads using dual stack. More...
 
static void test_isr_stack_play (void)
 Verify data passing between thread and ISR. More...
 
void thread_entry_wait (void *p1, void *p2, void *p3)
 
void test_stack_pop_can_wait (void)
 Test that the stack pop can be waited if no item availablle. More...
 
void test_stack_thread2thread (void)
 Test to verify data passing between threads via stack. More...
 
void test_stack_user_thread2thread (void)
 Verifies data passing between user threads via stack. More...
 
void test_stack_thread2isr (void)
 Verifies data passing between thread and ISR via stack. More...
 
void test_stack_alloc_thread2thread (void)
 
static void low_prio_wait_for_stack (void *p1, void *p2, void *p3)
 
static void high_prio_t1_wait_for_stack (void *p1, void *p2, void *p3)
 
static void high_prio_t2_wait_for_stack (void *p1, void *p2, void *p3)
 
void test_stack_multithread_competition (void)
 Test multi-threads to get data from stack. More...
 
void tStack_pop_entry (void *p1, void *p2, void *p3)
 
void test_stack_pop_fail (void)
 Verifies stack pop functionality. More...
 
void test_stack_cleanup_error (void)
 Verifies cleanup a stack that still be needed by another thread. More...
 
void test_stack_push_full (void)
 Verifies push a data in the full stack. More...
 
void test_stack_user_pop_fail (void)
 Verifies stack pop from a user thread. More...
 
void test_stack_user_init_null (void)
 Verifies stack alloc and initialize a null pointer. More...
 
void test_stack_user_init_invalid_value (void)
 Verify that alloc and initialize a stack with 0 memory. More...
 
void test_stack_user_push_null (void)
 Verify that push some data into a NULL pointer. More...
 
void test_stack_user_pop_null (void)
 Verifies pop data from a NULL pointer. More...
 
void test_stack_user_pop_permission (void)
 Verifies cleanup a stack that its data still be waited by another thread. More...
 

Detailed Description

Tests for Kernel stack objects.

Function Documentation

◆ high_prio_t1_wait_for_stack()

static void high_prio_t1_wait_for_stack ( void p1,
void p2,
void p3 
)
static

◆ high_prio_t2_wait_for_stack()

static void high_prio_t2_wait_for_stack ( void p1,
void p2,
void p3 
)
static

◆ low_prio_wait_for_stack()

static void low_prio_wait_for_stack ( void p1,
void p2,
void p3 
)
static

◆ test_dual_stack_play()

static void test_dual_stack_play ( void  )
static

#include <tests/kernel/stack/stack/src/main.c>

Verify data passing between threads using dual stack.

See also
k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

◆ test_isr_stack_play()

static void test_isr_stack_play ( void  )
static

#include <tests/kernel/stack/stack/src/main.c>

Verify data passing between thread and ISR.

See also
k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

◆ test_single_stack_play()

static void test_single_stack_play ( void  )
static

#include <tests/kernel/stack/stack/src/main.c>

Verify data passing between threads using single stack.

See also
k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

◆ test_stack_alloc_thread2thread()

void test_stack_alloc_thread2thread ( void  )

#include <tests/kernel/stack/stack/src/test_stack_contexts.c>

See also
k_stack_alloc_init(), k_stack_push(), K_STACK_DEFINE(x), k_stack_pop(), k_stack_cleanup()

TESTPOINT: thread-thread data passing via stack

Requested buffer allocation from the test pool.

◆ test_stack_cleanup_error()

void test_stack_cleanup_error ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies cleanup a stack that still be needed by another thread.

See also
k_stack_cleanup()

◆ test_stack_multithread_competition()

void test_stack_multithread_competition ( void  )

#include <tests/kernel/stack/stack/src/test_stack_contexts.c>

Test multi-threads to get data from stack.

Define three threads, and set a higher priority for two of them, and set a lower priority for the last one. Then Add a delay between creating the two high priority threads. Test point:

  1. Any number of threads may wait(K_FOREVER set) on an empty stack simultaneously.
  2. When data is pushed, it is given to the highest priority thread that has waited longest.

◆ test_stack_pop_can_wait()

void test_stack_pop_can_wait ( void  )

#include <tests/kernel/stack/stack/src/main.c>

Test that the stack pop can be waited if no item availablle.

Create and initialize a new stack Set two timeout parameters to indicate the maximum amount of time the thread will wait.

See also
k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

◆ test_stack_pop_fail()

void test_stack_pop_fail ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies stack pop functionality.

See also
k_stack_init(), k_stack_pop()

◆ test_stack_push_full()

void test_stack_push_full ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies push a data in the full stack.

See also
k_stack_push()

◆ test_stack_thread2isr()

void test_stack_thread2isr ( void  )

#include <tests/kernel/stack/stack/src/test_stack_contexts.c>

Verifies data passing between thread and ISR via stack.

See also
k_stack_init(), k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

TESTPOINT: test k_stack_init stack

TESTPOINT: test K_STACK_DEFINE stack

◆ test_stack_thread2thread()

void test_stack_thread2thread ( void  )

#include <tests/kernel/stack/stack/src/test_stack_contexts.c>

Test to verify data passing between threads via stack.

Static define and Dynamic define stacks, Then initialize them. Current thread push or pop data item into the stack. Create a new thread pop or push data item into the stack. Controlled by semaphore. Verify data passing between threads via stack And verify stack can be define at compile time.

See also
k_stack_init(), k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

TESTPOINT: test k_stack_init stack

TESTPOINT: test K_STACK_DEFINE stack

◆ test_stack_user_init_invalid_value()

void test_stack_user_init_invalid_value ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verify that alloc and initialize a stack with 0 memory.

See also
k_stack_alloc_init()

◆ test_stack_user_init_null()

void test_stack_user_init_null ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies stack alloc and initialize a null pointer.

See also
k_stack_alloc_init()

◆ test_stack_user_pop_fail()

void test_stack_user_pop_fail ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies stack pop from a user thread.

See also
k_stack_init(), k_stack_pop()

◆ test_stack_user_pop_null()

void test_stack_user_pop_null ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies pop data from a NULL pointer.

See also
k_stack_pop()

◆ test_stack_user_pop_permission()

void test_stack_user_pop_permission ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verifies cleanup a stack that its data still be waited by another thread.

See also
k_stack_pop()

◆ test_stack_user_push_null()

void test_stack_user_push_null ( void  )

#include <tests/kernel/stack/stack/src/test_stack_fail.c>

Verify that push some data into a NULL pointer.

See also
k_stack_push()

◆ test_stack_user_thread2thread()

void test_stack_user_thread2thread ( void  )

#include <tests/kernel/stack/stack/src/test_stack_contexts.c>

Verifies data passing between user threads via stack.

See also
k_stack_init(), k_stack_push(), K_STACK_DEFINE(x), k_stack_pop()

◆ thread_entry_wait()

void thread_entry_wait ( void p1,
void p2,
void p3 
)

◆ tStack_pop_entry()

void tStack_pop_entry ( void p1,
void p2,
void p3 
)