Zephyr Project API
3.1.0
A Scalable Open Source RTOS
|
Tests for queue. More...
Macros | |
#define | QUEUE_NUM 10 |
Verify that multiple queues can be defined simultaneously. More... | |
Functions | |
void | test_queue_thread2thread (void) |
Verify data passing between threads using queue. More... | |
void | test_queue_thread2isr (void) |
Verify data passing between thread and ISR. More... | |
void | test_queue_isr2thread (void) |
Verify data passing between ISR and thread. More... | |
void | test_queue_get_2threads (void) |
Verify k_queue_get() More... | |
void | test_queue_alloc (void) |
Test queue alloc append and prepend. More... | |
void | test_queue_multithread_competition (void) |
Test multi-threads to get data from a queue. More... | |
void | test_queue_unique_append (void) |
Verify k_queue_unique_append() More... | |
void | test_queue_get_fail (void) |
Test k_queue_get() failure scenario. More... | |
void | test_queue_append_list_error (void) |
Test k_queue_append_list() failure scenario. More... | |
void | test_queue_merge_list_error (void) |
Test k_queue_merge_slist() failure scenario. More... | |
void | test_queue_init_null (void) |
Test k_queue_init() failure scenario. More... | |
void | test_queue_alloc_append_null (void) |
Test k_queue_alloc_append() failure scenario. More... | |
void | test_queue_alloc_prepend_null (void) |
Test k_queue_alloc_prepend() failure scenario. More... | |
void | test_queue_get_null (void) |
Test k_queue_get() failure scenario. More... | |
void | test_queue_is_empty_null (void) |
Test k_queue_is_empty() failure scenario. More... | |
void | test_queue_peek_head_null (void) |
Test k_queue_peek_head() failure scenario. More... | |
void | test_queue_peek_tail_null (void) |
Test k_queue_peek_tail() failure scenario. More... | |
void | test_queue_cancel_wait_error (void) |
Test k_queue_merge_slist() failure scenario. More... | |
void | test_queue_loop (void) |
Test queue operations in loop. More... | |
void | test_queue_supv_to_user (void) |
Verify queue elements and cancel wait from a user thread. More... | |
void | test_queue_alloc_prepend_user (void) |
verify allocate and feature "Last In, First Out" More... | |
void | test_queue_alloc_append_user (void) |
verify feature of queue "First In, First Out" More... | |
void | test_auto_free (void) |
Test to verify free of allocated elements of queue. More... | |
Tests for queue.
#define QUEUE_NUM 10 |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify that multiple queues can be defined simultaneously.
define multiple queues to verify they can work.
void test_auto_free | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_user.c>
Test to verify free of allocated elements of queue.
void test_queue_alloc | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Test queue alloc append and prepend.
void test_queue_alloc_append_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_alloc_append() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_alloc_append_user | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_user.c>
verify feature of queue "First In, First Out"
Create a new queue And allocated memory for the queue Initialize and insert data item in sequence. Verify the feather "First in,First out"
void test_queue_alloc_prepend_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_alloc_prepend() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_alloc_prepend_user | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_user.c>
verify allocate and feature "Last In, First Out"
Create a new queue And allocated memory for the queue Initialize and insert data item in sequence. Verify the feather "Last in,First out"
void test_queue_append_list_error | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_append_list() failure scenario.
According to the API k_queue_append_list to design some error condition to verify error branch of the API.
void test_queue_cancel_wait_error | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_merge_slist() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_get_2threads | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify k_queue_get()
TESTPOINT: test k_queue_init queue
void test_queue_get_fail | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_get() failure scenario.
TESTPOINT: queue get returns NULL
void test_queue_get_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_get() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_init_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_init() failure scenario.
Verify that the parameter of API k_queue_init() is NULL, what will happen.
void test_queue_is_empty_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_is_empty() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_isr2thread | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify data passing between ISR and thread.
Create a new ISR and ready for getting data And current thread is used for inserting data Verify if the rx_data is equal insert-data address.
TESTPOINT: test k_queue_init queue
TESTPOINT: test K_QUEUE_DEFINE queue
void test_queue_loop | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_loop.c>
Test queue operations in loop.
void test_queue_merge_list_error | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_merge_slist() failure scenario.
Verify the API k_queue_merge_slist when a slist is empty or a slist's tail is null.
void test_queue_multithread_competition | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Test multi-threads to get data from a queue.
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:
void test_queue_peek_head_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_peek_head() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_peek_tail_null | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_fail.c>
Test k_queue_peek_tail() failure scenario.
Verify that the parameter of the API is NULL, what will happen.
void test_queue_supv_to_user | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_user.c>
Verify queue elements and cancel wait from a user thread.
The test adds elements to queue and then verified by the child user thread. Get data from a empty queue,and use K_FORVER to wait for available And to cancel wait from current thread.
void test_queue_thread2isr | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify data passing between thread and ISR.
Create a new ISR to insert data And current thread is used for getting data Verify if the rx_data is equal insert-data address. If the received data address is the same as the created array, prove that the queue data structures are stored within the provided data items.
TESTPOINT: init via k_queue_init
TESTPOINT: test K_QUEUE_DEFINEed queue
void test_queue_thread2thread | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify data passing between threads using queue.
Static define and Dynamic define queues, Then initialize them. Create a new thread to wait for reading data. Current thread will append item into queue. Verify if rx_data is equal insert-data address. Verify queue can be define at compile time.
TESTPOINT: init via k_queue_init
TESTPOINT: test K_QUEUE_DEFINEed queue
void test_queue_unique_append | ( | void | ) |
#include <tests/kernel/queue/src/test_queue_contexts.c>
Verify k_queue_unique_append()
Append the same data to the queue repeatedly, see if it returns expected value. And verify operation succeed if append different data to the queue.