Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Functions | |
void | test_pipe_on_single_elements (void) |
Verify pipe with 1 element insert. More... | |
void | test_pipe_on_multiple_elements (void) |
Test when multiple items are present in the pipe. More... | |
void | test_pipe_forever_wait (void) |
Test when multiple items are present with wait. More... | |
void | test_pipe_timeout (void) |
Test pipes with timeout. More... | |
void | test_pipe_get_on_empty_pipe (void) |
Test pipe get from a empty pipe. More... | |
void | test_pipe_forever_timeout (void) |
Test the pipe_get with K_FOREVER as timeout. More... | |
void | test_pipe_get_timeout (void) |
k_pipe_get timeout test More... | |
void | test_pipe_get_invalid_size (void) |
Test pipe get of invalid size. More... | |
void | test_pipe_get_min_xfer (void) |
Test pipe get returns immediately if >= min_xfer is available. More... | |
void | test_pipe_put_min_xfer (void) |
Test pipe put returns immediately if >= min_xfer is available. More... | |
void | test_pipe_define_at_runtime (void) |
Test defining and initializing pipes at run time. More... | |
void | test_pipe_thread2thread (void) |
Test pipe data passing between threads. More... | |
void | test_pipe_user_thread2thread (void) |
Test data passing using pipes between user threads. More... | |
void | test_resource_pool_auto_free (void) |
Test resource pool free. More... | |
static void | tThread_half_pipe_put (void *p1, void *p2, void *p3) |
static void | tThread_half_pipe_get (void *p1, void *p2, void *p3) |
void | test_half_pipe_put_get (void) |
Test put/get with smaller pipe buffer. More... | |
void | test_pipe_get_put (void) |
void | test_pipe_get_large (void) |
void | test_pipe_reader_wait (void) |
Test pending reader in pipe. More... | |
void | test_pipe_put_fail (void) |
Test pipe put failure scenario. More... | |
void | test_pipe_user_put_fail (void) |
Test pipe put by a user thread. More... | |
void | test_pipe_get_fail (void) |
Test pipe get failure scenario. More... | |
void | test_pipe_user_get_fail (void) |
Test pipe get by a user thread. More... | |
void | test_pipe_alloc_not_init (void) |
Test k_pipe_alloc_init() failure scenario. More... | |
void | test_pipe_get_null (void) |
Test k_pipe_get() failure scenario. More... | |
void | test_pipe_get_unreach_data (void) |
Test k_pipe_get() failure scenario. More... | |
void | test_pipe_get_unreach_size (void) |
Test k_pipe_get() failure scenario. More... | |
void | test_pipe_put_null (void) |
Test k_pipe_put() failure scenario. More... | |
void | test_pipe_put_unreach_data (void) |
Test k_pipe_put() failure scenario. More... | |
void | test_pipe_put_unreach_size (void) |
Test k_pipe_put() failure scenario. More... | |
void | test_pipe_read_avail_null (void) |
Test k_pipe_read_avail() failure scenario. More... | |
void | test_pipe_write_avail_null (void) |
Test k_pipe_write_avail() failure scenario. More... | |
static ZTEST_DMEM unsigned char | data [] = "abcdefgh" |
Tests for the Pipe read / write availability. More... | |
static struct k_pipe | pipe |
static struct k_pipe | bufferless |
static struct k_pipe | bufferless1 |
void | test_pipe_avail_no_buffer (void) |
Pipes with no buffer or size 0 should return 0 bytes available. More... | |
void | test_pipe_avail_r_lt_w (void) |
Test available read / write space for r < w. More... | |
void | test_pipe_avail_w_lt_r (void) |
Test available read / write space for w < r. More... | |
void | test_pipe_avail_r_eq_w_empty (void) |
Test available read / write space for r == w and an empty buffer. More... | |
void | test_pipe_avail_r_eq_w_full (void) |
Test available read / write space for r == w and a full buffer. More... | |
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
Test put/get with smaller pipe buffer.
TESTPOINT: thread-thread data passing via pipe
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_alloc_init() failure scenario.
See what will happen if an uninitialized k_pipe is passed to k_pipe_alloc_init().
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Pipes with no buffer or size 0 should return 0 bytes available.
Pipes can be created to be bufferless (i.e. k_pipe::buffer is NULL
or k_pipe::size is 0).
If either of those conditions is true, then k_pipe_read_avail and k_pipe_write_avail should return 0.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Test available read / write space for r == w
and an empty buffer.
This test case is for buffered k_pipe objects and covers the case where k_pipe::read_index is equal to k_pipe::write_index and k_pipe::bytes_used is zero.
In this case, k_pipe::bytes_used is relevant because the read and write indeces are equal.
r w |a|b|c|d|e|f|g|h| |0|1|2|3|4|5|6|7|
Regardless of whether the buffer is full or empty, the following holds:
r_avail = bytes_used w_avail = N - bytes_used
Thus: r_avail = 0 would read:
w_avail = N - 0 = 8 would overwrite: e f g h a b c d
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Test available read / write space for r == w
and a full buffer.
This test case is for buffered k_pipe objects and covers the case where k_pipe::read_index is equal to k_pipe::write_index and k_pipe::bytes_used is equal to k_pipe::size.
In this case, k_pipe::bytes_used is relevant because the read and write indeces are equal.
r w |a|b|c|d|e|f|g|h| |0|1|2|3|4|5|6|7|
Regardless of whether the buffer is full or empty, the following holds:
r_avail = bytes_used w_avail = N - bytes_used
Thus r_avail = N = 8 would read: e f g h a b c d
w_avail = N - 8 = 0 would overwrite:
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Test available read / write space for r < w.
This test case is for buffered k_pipe objects and covers the case where k_pipe::read_index is less than k_pipe::write_index.
In this case, k_pipe::bytes_used is not relevant.
r w |a|b|c|d|e|f|g|h| |0|1|2|3|4|5|6|7|
As shown above, the pipe will be able to read 3 bytes without blocking and write 5 bytes without blocking.
Thus r_avail = w - r = 3 would read: a b c d
w_avail = N - (w - r) = 5 would overwrite: e f g h
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Test available read / write space for w < r.
This test case is for buffered k_pipe objects and covers the case where k_pipe::write_index is less than k_pipe::read_index.
In this case, k_pipe::bytes_used is not relevant.
w r |a|b|c|d|e|f|g|h| |0|1|2|3|4|5|6|7|
As shown above, the pipe will fbe able to read 5 bytes without blocking and write 3 bytes without blocking.
Thus r_avail = N - (r - w) = 5 would read: e f g h
w_avail = r - w = 3 would overwrite: a b c d
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test defining and initializing pipes at run time.
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test the pipe_get with K_FOREVER as timeout.
Testcase is similar to test_pipe_on_single_elements() but with K_FOREVER as timeout.
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test when multiple items are present with wait.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test pipe get failure scenario.
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test pipe get of invalid size.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
TESTPOINT: thread-thread data passing via pipe
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test pipe get returns immediately if >= min_xfer is available.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_get() failure scenario.
See what will happen if an uninitialized k_pipe is passed to k_pipe_get().
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test pipe get from a empty pipe.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
TESTPOINT: thread-thread data passing via pipe
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_get() failure scenario.
See what will happen if the parameter address is accessed deny to test k_pipe_get
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_get() failure scenario.
See what will happen if the parameter address is accessed deny to test k_pipe_get
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test when multiple items are present in the pipe.
transfer sequences of bytes of data in part.
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Verify pipe with 1 element insert.
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test pipe put failure scenario.
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test pipe put returns immediately if >= min_xfer is available.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_put() failure scenario.
See what will happen if a null pointer is passed into the k_pipe_put as a parameter
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_put() failure scenario.
See what will happen if the parameter address is accessed deny to test k_pipe_put
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_put() failure scenario.
See what will happen if the parameter address is accessed deny to test k_pipe_put
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_read_avail() failure scenario.
See what will happen if a null pointer is passed into the k_pipe_read_avail as a parameter
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
Test pending reader in pipe.
TESTPOINT: test k_pipe_block_put with semaphore
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
Test pipe data passing between threads.
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
TESTPOINT: test k_pipe_init pipe
TESTPOINT: test K_PIPE_DEFINE pipe
#include <tests/kernel/pipe/pipe/src/test_pipe.c>
Test pipes with timeout.
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test pipe get by a user thread.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test pipe put by a user thread.
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
Test data passing using pipes between user threads.
TESTPOINT: test k_object_alloc pipe
TESTPOINT: test k_pipe_alloc_init
#include <tests/kernel/pipe/pipe_api/src/test_pipe_fail.c>
Test k_pipe_write_avail() failure scenario.
See what will happen if a null pointer is passed into the k_pipe_write_avail as a parameter
#include <tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c>
Test resource pool free.
|
static |
|
static |
|
static |
#include <tests/kernel/pipe/pipe_api/src/test_pipe_avail.c>
Tests for the Pipe read / write availability.
|
static |