Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Tests for the FIFO kernel object. More...
Functions | |
ZTEST (fifo_api_1cpu, test_fifo_cancel_wait) | |
Test cancel waiting on a FIFO queue. | |
ZTEST (fifo_api_1cpu, test_fifo_thread2thread) | |
Test thread to thread data passing via fifo. | |
ZTEST (fifo_api, test_fifo_thread2isr) | |
Test isr to thread data passing via fifo. | |
ZTEST (fifo_api, test_fifo_isr2thread) | |
Test thread to isr data passing via fifo. | |
ZTEST (fifo_api, test_fifo_is_empty_thread) | |
Test empty fifo. | |
ZTEST (fifo_api, test_fifo_is_empty_isr) | |
Test empty fifo in interrupt context. | |
ZTEST (fifo_api, test_fifo_get_fail) | |
Test FIFO get fail. | |
ZTEST (fifo_api_1cpu, test_fifo_loop) | |
Verify zephyr fifo continuous read write in loop. | |
ZTEST (fifo_timeout_1cpu, test_timeout_empty_fifo) | |
Test empty fifo with timeout and K_NO_WAIT. | |
ZTEST (fifo_timeout, test_timeout_non_empty_fifo) | |
Test non empty fifo with timeout and K_NO_WAIT. | |
ZTEST (fifo_timeout_1cpu, test_timeout_fifo_thread) | |
Test fifo with timeout and K_NO_WAIT. | |
ZTEST (fifo_timeout_1cpu, test_timeout_threads_pend_on_fifo) | |
Test fifo with different timeouts. | |
ZTEST (fifo_timeout_1cpu, test_timeout_threads_pend_on_dual_fifos) | |
Test multiple fifos with different timeouts. | |
ZTEST (fifo_timeout_1cpu, test_timeout_threads_pend_fail_on_fifo) | |
Test same fifo with different timeouts. | |
static void * | test_timeout_setup (void) |
Test fifo init. | |
ZTEST (fifo_usage, test_single_fifo_play) | |
Tests single fifo get and put operation in thread context. | |
ZTEST (fifo_usage, test_dual_fifo_play) | |
Tests dual fifo get and put operation in thread context. | |
ZTEST (fifo_usage, test_isr_fifo_play) | |
Tests fifo put and get operation in interrupt context. | |
Tests for the FIFO kernel object.
Verify zephyr fifo apis under different context
|
static |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test fifo init.
ZTEST | ( | fifo_api | , |
test_fifo_get_fail | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_fail.c>
Test FIFO get fail.
test zephyr fifo_get when no data to read, it should returns NULL.
TESTPOINT: fifo get returns NULL
ZTEST | ( | fifo_api | , |
test_fifo_is_empty_isr | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c>
Test empty fifo in interrupt context.
TESTPOINT: check fifo is empty from isr
ZTEST | ( | fifo_api | , |
test_fifo_is_empty_thread | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c>
Test empty fifo.
TESTPOINT: k_fifo_is_empty after init
TESTPONT: check fifo is empty from thread
ZTEST | ( | fifo_api | , |
test_fifo_isr2thread | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c>
Test thread to isr data passing via fifo.
TESTPOINT: test k_fifo_init fifo
TESTPOINT: test K_FIFO_DEFINE fifo
ZTEST | ( | fifo_api | , |
test_fifo_thread2isr | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c>
Test isr to thread data passing via fifo.
TESTPOINT: init via k_fifo_init
TESTPOINT: test K_FIFO_DEFINEed fifo
ZTEST | ( | fifo_api_1cpu | , |
test_fifo_cancel_wait | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c>
Test cancel waiting on a FIFO queue.
This routine causes first thread pending on fifo (if any), to return from k_fifo_get() with NULL value (as if timeout expired).
TESTPOINT: init via k_fifo_init
TESTPOINT: test K_FIFO_DEFINEed fifo
ZTEST | ( | fifo_api_1cpu | , |
test_fifo_loop | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_loop.c>
Verify zephyr fifo continuous read write in loop.
ZTEST | ( | fifo_api_1cpu | , |
test_fifo_thread2thread | |||
) |
#include <tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c>
Test thread to thread data passing via fifo.
TESTPOINT: init via k_fifo_init
TESTPOINT: test K_FIFO_DEFINEed fifo
ZTEST | ( | fifo_timeout | , |
test_timeout_non_empty_fifo | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test non empty fifo with timeout and K_NO_WAIT.
ZTEST | ( | fifo_timeout_1cpu | , |
test_timeout_empty_fifo | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test empty fifo with timeout and K_NO_WAIT.
ZTEST | ( | fifo_timeout_1cpu | , |
test_timeout_fifo_thread | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test fifo with timeout and K_NO_WAIT.
In first scenario test fifo with some timeout where child thread puts data on the fifo on time. In second scenario test k_fifo_get with timeout of K_NO_WAIT and the fifo should be filled by the child thread based on the data availability on another fifo. In third scenario test k_fifo_get with timeout of K_FOREVER and the fifo should be filled by the child thread based on the data availability on another fifo.
ZTEST | ( | fifo_timeout_1cpu | , |
test_timeout_threads_pend_fail_on_fifo | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test same fifo with different timeouts.
test multiple threads pending on the same fifo with different timeouts but getting the data in time
ZTEST | ( | fifo_timeout_1cpu | , |
test_timeout_threads_pend_on_dual_fifos | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test multiple fifos with different timeouts.
test multiple threads pending on different fifos with different timeouts
ZTEST | ( | fifo_timeout_1cpu | , |
test_timeout_threads_pend_on_fifo | |||
) |
#include <tests/kernel/fifo/fifo_timeout/src/main.c>
Test fifo with different timeouts.
test multiple threads pending on the same fifo with different timeouts
ZTEST | ( | fifo_usage | , |
test_dual_fifo_play | |||
) |
#include <tests/kernel/fifo/fifo_usage/src/main.c>
Tests dual fifo get and put operation in thread context.
test Thread enters an item into fifo2, starts a Child Thread and extract an item from fifo1 once the item is there. The Child Thread will extract an item from fifo2 once the item is there and enter an item to fifo1. The flow of control goes from Test Thread to Child Thread and so forth.
ZTEST | ( | fifo_usage | , |
test_isr_fifo_play | |||
) |
#include <tests/kernel/fifo/fifo_usage/src/main.c>
Tests fifo put and get operation in interrupt context.
Tests the ISR interfaces. Test thread puts items into fifo2 and gives control to the Child thread. Child thread gets items from fifo2 and then puts items into fifo1. Child thread gives back control to the Test thread and Test thread gets the items from fifo1. All the Push and Pop operations happen in ISR Context.
ZTEST | ( | fifo_usage | , |
test_single_fifo_play | |||
) |
#include <tests/kernel/fifo/fifo_usage/src/main.c>
Tests single fifo get and put operation in thread context.
Test Thread enters items into a fifo, starts the Child Thread and waits for a semaphore. Child thread extracts all items from the fifo and enters some items back into the fifo. Child Thread gives the semaphore for Test Thread to continue. Once the control is returned back to Test Thread, it extracts all items from the fifo.