Zephyr Project API
3.1.0
A Scalable Open Source RTOS
|
Macros | |
#define | FAIL_ALLOC_MSG_FMT "sys_bitarray_alloc with region size %i allocated incorrectly" |
#define | FAIL_ALLOC_RET_MSG_FMT "sys_bitarray_alloc with region size %i returned incorrect result" |
#define | FAIL_ALLOC_OFFSET_MSG_FMT "sys_bitarray_alloc with region size %i gave incorrect offset" |
#define | FAIL_FREE_MSG_FMT "sys_bitarray_free with region size %i and offset %i failed" |
#define | FREE 0U |
Functions | |
void | test_atomic (void) |
Verify atomic functionalities. More... | |
void | atomic_handler (void *p1, void *p2, void *p3) |
void | test_threads_access_atomic (void) |
Verify atomic operation with threads. More... | |
static bool | cmp_u32_arrays (uint32_t *a1, uint32_t *a2, size_t sz) |
void | validate_bitarray_define (sys_bitarray_t *ba, size_t num_bits) |
void | test_bitarray_declare (void) |
Test defining of bitarrays. More... | |
bool | bitarray_bundles_is_zero (sys_bitarray_t *ba) |
void | test_bitarray_set_clear (void) |
Test bitarrays set and clear. More... | |
void | alloc_and_free_predefined (void) |
static size_t | count_bits (uint32_t val) |
size_t | get_bitarray_popcnt (sys_bitarray_t *ba) |
void | alloc_and_free_loop (int divisor) |
void | alloc_and_free_interval (void) |
void | test_bitarray_alloc_free (void) |
Test bitarrays allocation and free. More... | |
void | test_bitarray_region_set_clear (void) |
void | test_ffs (void) |
Test find MSB and LSB operations. More... | |
void | test_bitfield (void) |
Test bitfield operations. More... | |
void | test_byteorder_memcpy_swap (void) |
Test swapping for memory contents. More... | |
void | test_byteorder_mem_swap (void) |
Test sys_mem_swap() functionality. More... | |
void | test_sys_get_be64 (void) |
Test sys_get_be64() functionality. More... | |
void | test_sys_put_be64 (void) |
Test sys_put_be64() functionality. More... | |
void | test_sys_get_be48 (void) |
Test sys_get_be48() functionality. More... | |
void | test_sys_put_be48 (void) |
Test sys_put_be48() functionality. More... | |
void | test_sys_get_be32 (void) |
Test sys_get_be32() functionality. More... | |
void | test_sys_put_be32 (void) |
Test sys_put_be32() functionality. More... | |
void | test_sys_get_be24 (void) |
Test sys_get_be24() functionality. More... | |
void | test_sys_put_be24 (void) |
Test sys_put_be24() functionality. More... | |
void | test_sys_get_be16 (void) |
Test sys_get_be16() functionality. More... | |
void | test_sys_put_be16 (void) |
Test sys_put_be16() functionality. More... | |
void | test_sys_get_le16 (void) |
Test sys_get_le16() functionality. More... | |
void | test_sys_put_le16 (void) |
Test sys_put_le16() functionality. More... | |
void | test_sys_get_le24 (void) |
Test sys_get_le24() functionality. More... | |
void | test_sys_put_le24 (void) |
Test sys_put_le24() functionality. More... | |
void | test_sys_get_le32 (void) |
Test sys_get_le32() functionality. More... | |
void | test_sys_put_le32 (void) |
Test sys_put_le32() functionality. More... | |
void | test_sys_get_le48 (void) |
Test sys_get_le48() functionality. More... | |
void | test_sys_put_le48 (void) |
Test sys_put_le48() functionality. More... | |
void | test_sys_get_le64 (void) |
Test sys_get_le64() functionality. More... | |
void | test_sys_put_le64 (void) |
Test sys_put_le64() functionality. More... | |
void | test_clock_uptime (void) |
Test clock uptime APIs functionality. More... | |
void | test_clock_cycle_32 (void) |
Test 32-bit clock cycle functionality. More... | |
void | test_clock_cycle_64 (void) |
Test 64-bit clock cycle functionality. More... | |
static void | duration_expire (struct k_timer *timer) |
static void | stop_expire (struct k_timer *timer) |
static void | init_data_count (void) |
void | test_ms_time_duration (void) |
Test millisecond time duration. More... | |
__no_optimization void | test_nop (void) |
Test the arch_nop() by invoking and measure it. More... | |
static void | test_version (void) |
Test sys_kernel_version_get() functionality. More... | |
void | test_multilib (void) |
Test if correct multilib is selected. More... | |
void | test_printk (void) |
Test printk() functionality. More... | |
void | test_timeout_order (void) |
Test timeout ordering. More... | |
void | test_fatal (void) |
Test the kernel fatal error handling works correctly. More... | |
void | test_fatal_on_smp (void) |
Test fatal error can be triggered on different core. More... | |
void | test_workq_on_smp (void) |
Test system workq run on different core. More... | |
#define FAIL_ALLOC_MSG_FMT "sys_bitarray_alloc with region size %i allocated incorrectly" |
#include <tests/kernel/common/src/bitarray.c>
#define FAIL_ALLOC_OFFSET_MSG_FMT "sys_bitarray_alloc with region size %i gave incorrect offset" |
#include <tests/kernel/common/src/bitarray.c>
#define FAIL_ALLOC_RET_MSG_FMT "sys_bitarray_alloc with region size %i returned incorrect result" |
#include <tests/kernel/common/src/bitarray.c>
#define FAIL_FREE_MSG_FMT "sys_bitarray_free with region size %i and offset %i failed" |
#include <tests/kernel/common/src/bitarray.c>
#define FREE 0U |
#include <tests/kernel/common/src/bitarray.c>
void alloc_and_free_interval | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
void alloc_and_free_loop | ( | int | divisor | ) |
#include <tests/kernel/common/src/bitarray.c>
void alloc_and_free_predefined | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
void atomic_handler | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
#include <tests/kernel/common/src/atomic.c>
bool bitarray_bundles_is_zero | ( | sys_bitarray_t * | ba | ) |
#include <tests/kernel/common/src/bitarray.c>
#include <tests/kernel/common/src/bitarray.c>
|
inlinestatic |
#include <tests/kernel/common/src/bitarray.c>
|
static |
#include <tests/kernel/common/src/clock.c>
size_t get_bitarray_popcnt | ( | sys_bitarray_t * | ba | ) |
#include <tests/kernel/common/src/bitarray.c>
|
static |
#include <tests/kernel/common/src/clock.c>
|
static |
#include <tests/kernel/common/src/clock.c>
void test_atomic | ( | void | ) |
#include <tests/kernel/common/src/atomic.c>
Verify atomic functionalities.
Test Objective:
Test techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
void test_bitarray_alloc_free | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
Test bitarrays allocation and free.
void test_bitarray_declare | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
Test defining of bitarrays.
void test_bitarray_region_set_clear | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
void test_bitarray_set_clear | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
Test bitarrays set and clear.
void test_bitfield | ( | void | ) |
#include <tests/kernel/common/src/bitfield.c>
Test bitfield operations.
void test_byteorder_mem_swap | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_mem_swap() functionality.
Test if sys_mem_swap() reverses the contents
void test_byteorder_memcpy_swap | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test swapping for memory contents.
Verify the functionality provided by sys_memcpy_swap()
void test_clock_cycle_32 | ( | void | ) |
#include <tests/kernel/common/src/clock.c>
Test 32-bit clock cycle functionality.
Test Objective:
Testing techniques
Prerequisite Condition:
Input Specifications:
Expected Test Result:
Pass/Fail criteria:
Test Procedure:
Assumptions and Constraints
TESTPOINT: cycle elapse
TESTPOINT: cycle/uptime cross check
void test_clock_cycle_64 | ( | void | ) |
#include <tests/kernel/common/src/clock.c>
Test 64-bit clock cycle functionality.
void test_clock_uptime | ( | void | ) |
#include <tests/kernel/common/src/clock.c>
Test clock uptime APIs functionality.
TESTPOINT: uptime elapse
TESTPOINT: uptime elapse lower 32-bit
TESTPOINT: uptime straddled ms boundary
TESTPOINT: uptime delta
void test_fatal | ( | void | ) |
#include <tests/kernel/fatal/exception/src/main.c>
Test the kernel fatal error handling works correctly.
Manually trigger the crash with various ways and check that the kernel is handling that properly or not. Also the crash reason should match. Check for stack sentinel feature by overflowing the thread's stack and check for the exception.
Manually trigger the crash with various ways and check that the kernel is handling that properly or not. Also the crash reason should match.
void test_fatal_on_smp | ( | void | ) |
#include <tests/kernel/smp/src/main.c>
Test fatal error can be triggered on different core.
When CONFIG_SMP is enabled, on some multiprocessor platforms, exception can be triggered on different core at the same time.
void test_ffs | ( | void | ) |
#include <tests/kernel/common/src/bitarray.c>
Test find MSB and LSB operations.
Verify the functions that find out the most significant bit and least significant bit work as expected.
void test_ms_time_duration | ( | void | ) |
#include <tests/kernel/common/src/clock.c>
Test millisecond time duration.
initialize a timer, then providing time duration in millisecond, and check the duration time whether correct.
TESTPOINT: waiting time less than duration and check the count
TESTPOINT: proving duration in millisecond
TESTPOINT: waiting time more than duration and check the count
cleanup environment
void test_multilib | ( | void | ) |
#include <tests/kernel/common/src/multilib.c>
Test if correct multilib is selected.
__no_optimization void test_nop | ( | void | ) |
#include <tests/kernel/common/src/irq_offload.c>
Test the arch_nop() by invoking and measure it.
This test is mainly for coverage of the code. arch_nop() is a special implementation and it will behave differently on different platforms. By the way, this also measures how many cycles it spends for platforms that support it.
FYI: The potential uses of arch_nop() could be:
Our test here mainly aims at the 4th scenario mentioned above but also potentially tests the 1st scenario. So no optimization here to prevent arch_nop() has optimized by the compiler is necessary.
void test_printk | ( | void | ) |
#include <tests/kernel/common/src/printk.c>
Test printk() functionality.
void test_sys_get_be16 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_be16() functionality.
Test if sys_get_be16() correctly handles endianness.
void test_sys_get_be24 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_be24() functionality.
Test if sys_get_be24() correctly handles endianness.
void test_sys_get_be32 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_be32() functionality.
Test if sys_get_be32() correctly handles endianness.
void test_sys_get_be48 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_be48() functionality.
Test if sys_get_be48() correctly handles endianness.
void test_sys_get_be64 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_be64() functionality.
Test if sys_get_be64() correctly handles endianness.
void test_sys_get_le16 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_le16() functionality.
Test if sys_get_le16() correctly handles endianness.
void test_sys_get_le24 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_le24() functionality.
Test if sys_get_le24() correctly handles endianness.
void test_sys_get_le32 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_le32() functionality.
Test if sys_get_le32() correctly handles endianness.
void test_sys_get_le48 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_le48() functionality.
Test if sys_get_le48() correctly handles endianness.
void test_sys_get_le64 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_get_le64() functionality.
Test if sys_get_le64() correctly handles endianness.
void test_sys_put_be16 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_be16() functionality.
Test if sys_put_be16() correctly handles endianness.
void test_sys_put_be24 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_be24() functionality.
Test if sys_put_be24() correctly handles endianness.
void test_sys_put_be32 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_be32() functionality.
Test if sys_put_be32() correctly handles endianness.
void test_sys_put_be48 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_be48() functionality.
Test if sys_put_be48() correctly handles endianness.
void test_sys_put_be64 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_be64() functionality.
Test if sys_put_be64() correctly handles endianness.
void test_sys_put_le16 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_le16() functionality.
Test if sys_put_le16() correctly handles endianness.
void test_sys_put_le24 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_le24() functionality.
Test if sys_put_le24() correctly handles endianness.
void test_sys_put_le32 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_le32() functionality.
Test if sys_put_le32() correctly handles endianness.
void test_sys_put_le48 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_le48() functionality.
Test if sys_put_le48() correctly handles endianness.
void test_sys_put_le64 | ( | void | ) |
#include <tests/kernel/common/src/byteorder.c>
Test sys_put_le64() functionality.
Test if sys_put_le64() correctly handles endianness.
void test_threads_access_atomic | ( | void | ) |
#include <tests/kernel/common/src/atomic.c>
Verify atomic operation with threads.
Creat two preempt threads with equal priority to atomically access the same atomic value. Because these preempt threads are of equal priority, so enable time slice to make them scheduled. The thread will execute for some time. In this time, the two sub threads will be scheduled separately according to the time slice.
void test_timeout_order | ( | void | ) |
#include <tests/kernel/common/src/timeout_order.c>
Test timeout ordering.
Timeouts, when expiring on the same tick, should be handled in the same order they were queued.
|
static |
#include <tests/kernel/common/src/main.c>
Test sys_kernel_version_get() functionality.
void test_workq_on_smp | ( | void | ) |
#include <tests/kernel/smp/src/main.c>
Test system workq run on different core.
When macro CONFIG_SMP is enabled, workq can be run on different core.
void validate_bitarray_define | ( | sys_bitarray_t * | ba, |
size_t | num_bits | ||
) |
#include <tests/kernel/common/src/bitarray.c>