Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Common Tests

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
 
#define CONSTRUCTOR_VALUE   1
 

Functions

 ZTEST_USER (atomic, test_atomic)
 Verify atomic functionalities.
 
void atomic_handler (void *p1, void *p2, void *p3)
 
 ZTEST (atomic, test_threads_access_atomic)
 Verify atomic operation with threads.
 
 ZTEST (atomic, test_atomic_overflow)
 Checks that the value of atomic_t will be the same in case of overflow if incremented in atomic and non-atomic manner.
 
void * common_setup (void)
 
 ZTEST_SUITE (atomic, NULL, common_setup, NULL, NULL, NULL)
 
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)
 
 ZTEST (bitarray, test_bitarray_declare)
 Test defining of bitarrays.
 
bool bitarray_bundles_is_zero (sys_bitarray_t *ba)
 
 ZTEST (bitarray, test_bitarray_set_clear)
 Test bitarrays set and clear.
 
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)
 
 ZTEST (bitarray, test_bitarray_alloc_free)
 Test bitarrays allocation and free.
 
 ZTEST (bitarray, test_bitarray_popcount_region)
 
 ZTEST (bitarray, test_bitarray_xor)
 
 ZTEST (bitarray, test_bitarray_find_nth_set)
 
 ZTEST (bitarray, test_bitarray_region_set_clear)
 
 ZTEST (bitarray, test_ffs)
 Test find MSB and LSB operations.
 
 ZTEST_SUITE (bitarray, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (bitfield, test_bitfield)
 Test bitfield operations.
 
 ZTEST_SUITE (bitfield, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (byteorder, test_byteorder_memcpy_swap)
 Test swapping for memory contents.
 
 ZTEST (byteorder, test_byteorder_mem_swap)
 Test sys_mem_swap() functionality.
 
 ZTEST (byteorder, test_sys_get_be64)
 Test sys_get_be64() functionality.
 
 ZTEST (byteorder, test_sys_put_be64)
 Test sys_put_be64() functionality.
 
 ZTEST (byteorder, test_sys_get_be40)
 Test sys_get_be40() functionality.
 
 ZTEST (byteorder, test_sys_put_be40)
 Test sys_put_be40() functionality.
 
 ZTEST (byteorder, test_sys_get_be48)
 Test sys_get_be48() functionality.
 
 ZTEST (byteorder, test_sys_put_be48)
 Test sys_put_be48() functionality.
 
 ZTEST (byteorder, test_sys_get_be32)
 Test sys_get_be32() functionality.
 
 ZTEST (byteorder, test_sys_put_be32)
 Test sys_put_be32() functionality.
 
 ZTEST (byteorder, test_sys_get_be24)
 Test sys_get_be24() functionality.
 
 ZTEST (byteorder, test_sys_put_be24)
 Test sys_put_be24() functionality.
 
 ZTEST (byteorder, test_sys_get_be16)
 Test sys_get_be16() functionality.
 
 ZTEST (byteorder, test_sys_put_be16)
 Test sys_put_be16() functionality.
 
 ZTEST (byteorder, test_sys_get_le16)
 Test sys_get_le16() functionality.
 
 ZTEST (byteorder, test_sys_put_le16)
 Test sys_put_le16() functionality.
 
 ZTEST (byteorder, test_sys_get_le24)
 Test sys_get_le24() functionality.
 
 ZTEST (byteorder, test_sys_put_le24)
 Test sys_put_le24() functionality.
 
 ZTEST (byteorder, test_sys_get_le32)
 Test sys_get_le32() functionality.
 
 ZTEST (byteorder, test_sys_put_le32)
 Test sys_put_le32() functionality.
 
 ZTEST (byteorder, test_sys_get_le40)
 Test sys_get_le40() functionality.
 
 ZTEST (byteorder, test_sys_put_le40)
 Test sys_put_le40() functionality.
 
 ZTEST (byteorder, test_sys_get_le48)
 Test sys_get_le48() functionality.
 
 ZTEST (byteorder, test_sys_put_le48)
 Test sys_put_le48() functionality.
 
 ZTEST (byteorder, test_sys_get_le64)
 Test sys_get_le64() functionality.
 
 ZTEST (byteorder, test_sys_put_le64)
 Test sys_put_le64() functionality.
 
 ZTEST (byteorder, test_sys_uint16_to_array)
 Test sys_uint16_to_array() functionality.
 
 ZTEST (byteorder, test_sys_uint32_to_array)
 Test sys_uint32_to_array() functionality.
 
 ZTEST (byteorder, test_sys_uint64_to_array)
 Test sys_uint64_to_array() functionality.
 
 ZTEST_SUITE (byteorder, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST_USER (clock, test_clock_uptime)
 Test clock uptime APIs functionality.
 
 ZTEST (clock, test_clock_cycle_32)
 Test 32-bit clock cycle functionality.
 
 ZTEST (clock, test_clock_cycle_64)
 Test 64-bit clock cycle functionality.
 
static void duration_expire (struct k_timer *timer)
 
static void stop_expire (struct k_timer *timer)
 
static void init_data_count (void)
 
 ZTEST (clock, test_ms_time_duration)
 Test millisecond time duration.
 
 ZTEST_SUITE (clock, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (constructor, test_constructor)
 
 ZTEST_SUITE (constructor, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (common, test_version)
 Test sys_kernel_version_get() functionality.
 
 ZTEST (multilib, test_multilib)
 Test if correct multilib is selected.
 
 ZTEST_SUITE (multilib, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (printk, test_printk)
 Test printk() functionality.
 
 ZTEST_SUITE (printk, NULL, common_setup, NULL, NULL, NULL)
 
 ZTEST (common_1cpu, test_timeout_order)
 Test timeout ordering.
 
 ZTEST_SUITE (common_1cpu, NULL, common_setup, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL)
 
 ZTEST (fatal_exception, test_fatal)
 Test the kernel fatal error handling works correctly.
 
 ZTEST (fatal_no_mt, test_fatal)
 Test the kernel fatal error handling works correctly.
 
 ZTEST (smp, test_fatal_on_smp)
 Test fatal error can be triggered on different core.
 
 ZTEST (smp, test_workq_on_smp)
 Test system workq run on different core.
 

Variables

static int constructor_value
 Test if constructors work.
 

Detailed Description

Macro Definition Documentation

◆ CONSTRUCTOR_VALUE

#define CONSTRUCTOR_VALUE   1

◆ FAIL_ALLOC_MSG_FMT

#define FAIL_ALLOC_MSG_FMT   "sys_bitarray_alloc with region size %i allocated incorrectly"

◆ FAIL_ALLOC_OFFSET_MSG_FMT

#define FAIL_ALLOC_OFFSET_MSG_FMT   "sys_bitarray_alloc with region size %i gave incorrect offset"

◆ FAIL_ALLOC_RET_MSG_FMT

#define FAIL_ALLOC_RET_MSG_FMT   "sys_bitarray_alloc with region size %i returned incorrect result"

◆ FAIL_FREE_MSG_FMT

#define FAIL_FREE_MSG_FMT   "sys_bitarray_free with region size %i and offset %i failed"

◆ FREE

#define FREE   0U

Function Documentation

◆ alloc_and_free_interval()

void alloc_and_free_interval ( void  )

◆ alloc_and_free_loop()

void alloc_and_free_loop ( int  divisor)

◆ alloc_and_free_predefined()

void alloc_and_free_predefined ( void  )

◆ atomic_handler()

void atomic_handler ( void *  p1,
void *  p2,
void *  p3 
)

◆ bitarray_bundles_is_zero()

bool bitarray_bundles_is_zero ( sys_bitarray_t ba)

◆ cmp_u32_arrays()

static bool cmp_u32_arrays ( uint32_t a1,
uint32_t a2,
size_t  sz 
)
static

◆ common_setup()

void * common_setup ( void  )
extern

◆ count_bits()

static size_t count_bits ( uint32_t  val)
inlinestatic

◆ duration_expire()

static void duration_expire ( struct k_timer *  timer)
static

◆ get_bitarray_popcnt()

size_t get_bitarray_popcnt ( sys_bitarray_t ba)

◆ init_data_count()

static void init_data_count ( void  )
static

◆ stop_expire()

static void stop_expire ( struct k_timer *  timer)
static

◆ validate_bitarray_define()

void validate_bitarray_define ( sys_bitarray_t ba,
size_t  num_bits 
)

◆ ZTEST() [1/52]

ZTEST ( atomic  ,
test_atomic_overflow   
)

#include <tests/kernel/common/src/atomic.c>

Checks that the value of atomic_t will be the same in case of overflow if incremented in atomic and non-atomic manner.

According to C standard the value of a signed variable is undefined in case of overflow. This test checks that the value of atomic_t will be the same in case of overflow if incremented in atomic and non-atomic manner. This allows us to increment an atomic variable in a non-atomic manner (as long as it is logically safe) and expect its value to match the result of the similar atomic increment.

◆ ZTEST() [2/52]

ZTEST ( atomic  ,
test_threads_access_atomic   
)

#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.

◆ ZTEST() [3/52]

ZTEST ( bitarray  ,
test_bitarray_alloc_free   
)

#include <tests/kernel/common/src/bitarray.c>

Test bitarrays allocation and free.

See also
sys_bitarray_alloc()
sys_bitarray_free()

◆ ZTEST() [4/52]

ZTEST ( bitarray  ,
test_bitarray_declare   
)

#include <tests/kernel/common/src/bitarray.c>

Test defining of bitarrays.

See also
SYS_BITARRAY_DEFINE()

◆ ZTEST() [5/52]

ZTEST ( bitarray  ,
test_bitarray_find_nth_set   
)

◆ ZTEST() [6/52]

ZTEST ( bitarray  ,
test_bitarray_popcount_region   
)

◆ ZTEST() [7/52]

ZTEST ( bitarray  ,
test_bitarray_region_set_clear   
)

◆ ZTEST() [8/52]

◆ ZTEST() [9/52]

ZTEST ( bitarray  ,
test_bitarray_xor   
)

◆ ZTEST() [10/52]

ZTEST ( bitarray  ,
test_ffs   
)

#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.

See also
find_msb_set(), find_lsb_set()

◆ ZTEST() [11/52]

◆ ZTEST() [12/52]

ZTEST ( byteorder  ,
test_byteorder_mem_swap   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_mem_swap() functionality.

Test if sys_mem_swap() reverses the contents

See also
sys_mem_swap()

◆ ZTEST() [13/52]

ZTEST ( byteorder  ,
test_byteorder_memcpy_swap   
)

#include <tests/kernel/common/src/byteorder.c>

Test swapping for memory contents.

Verify the functionality provided by sys_memcpy_swap()

See also
sys_memcpy_swap()

◆ ZTEST() [14/52]

ZTEST ( byteorder  ,
test_sys_get_be16   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be16() functionality.

Test if sys_get_be16() correctly handles endianness.

See also
sys_get_be16()

◆ ZTEST() [15/52]

ZTEST ( byteorder  ,
test_sys_get_be24   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be24() functionality.

Test if sys_get_be24() correctly handles endianness.

See also
sys_get_be24()

◆ ZTEST() [16/52]

ZTEST ( byteorder  ,
test_sys_get_be32   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be32() functionality.

Test if sys_get_be32() correctly handles endianness.

See also
sys_get_be32()

◆ ZTEST() [17/52]

ZTEST ( byteorder  ,
test_sys_get_be40   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be40() functionality.

Test if sys_get_be40() correctly handles endianness.

See also
sys_get_be40()

◆ ZTEST() [18/52]

ZTEST ( byteorder  ,
test_sys_get_be48   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be48() functionality.

Test if sys_get_be48() correctly handles endianness.

See also
sys_get_be48()

◆ ZTEST() [19/52]

ZTEST ( byteorder  ,
test_sys_get_be64   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_be64() functionality.

Test if sys_get_be64() correctly handles endianness.

See also
sys_get_be64()

◆ ZTEST() [20/52]

ZTEST ( byteorder  ,
test_sys_get_le16   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le16() functionality.

Test if sys_get_le16() correctly handles endianness.

See also
sys_get_le16()

◆ ZTEST() [21/52]

ZTEST ( byteorder  ,
test_sys_get_le24   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le24() functionality.

Test if sys_get_le24() correctly handles endianness.

See also
sys_get_le24()

◆ ZTEST() [22/52]

ZTEST ( byteorder  ,
test_sys_get_le32   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le32() functionality.

Test if sys_get_le32() correctly handles endianness.

See also
sys_get_le32()

◆ ZTEST() [23/52]

ZTEST ( byteorder  ,
test_sys_get_le40   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le40() functionality.

Test if sys_get_le40() correctly handles endianness.

See also
sys_get_le40()

◆ ZTEST() [24/52]

ZTEST ( byteorder  ,
test_sys_get_le48   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le48() functionality.

Test if sys_get_le48() correctly handles endianness.

See also
sys_get_le48()

◆ ZTEST() [25/52]

ZTEST ( byteorder  ,
test_sys_get_le64   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_get_le64() functionality.

Test if sys_get_le64() correctly handles endianness.

See also
sys_get_le64()

◆ ZTEST() [26/52]

ZTEST ( byteorder  ,
test_sys_put_be16   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be16() functionality.

Test if sys_put_be16() correctly handles endianness.

See also
sys_put_be16()

◆ ZTEST() [27/52]

ZTEST ( byteorder  ,
test_sys_put_be24   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be24() functionality.

Test if sys_put_be24() correctly handles endianness.

See also
sys_put_be24()

◆ ZTEST() [28/52]

ZTEST ( byteorder  ,
test_sys_put_be32   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be32() functionality.

Test if sys_put_be32() correctly handles endianness.

See also
sys_put_be32()

◆ ZTEST() [29/52]

ZTEST ( byteorder  ,
test_sys_put_be40   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be40() functionality.

Test if sys_put_be40() correctly handles endianness.

See also
sys_put_be40()

◆ ZTEST() [30/52]

ZTEST ( byteorder  ,
test_sys_put_be48   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be48() functionality.

Test if sys_put_be48() correctly handles endianness.

See also
sys_put_be48()

◆ ZTEST() [31/52]

ZTEST ( byteorder  ,
test_sys_put_be64   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_be64() functionality.

Test if sys_put_be64() correctly handles endianness.

See also
sys_put_be64()

◆ ZTEST() [32/52]

ZTEST ( byteorder  ,
test_sys_put_le16   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le16() functionality.

Test if sys_put_le16() correctly handles endianness.

See also
sys_put_le16()

◆ ZTEST() [33/52]

ZTEST ( byteorder  ,
test_sys_put_le24   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le24() functionality.

Test if sys_put_le24() correctly handles endianness.

See also
sys_put_le24()

◆ ZTEST() [34/52]

ZTEST ( byteorder  ,
test_sys_put_le32   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le32() functionality.

Test if sys_put_le32() correctly handles endianness.

See also
sys_put_le32()

◆ ZTEST() [35/52]

ZTEST ( byteorder  ,
test_sys_put_le40   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le40() functionality.

Test if sys_put_le40() correctly handles endianness.

See also
sys_put_le40()

◆ ZTEST() [36/52]

ZTEST ( byteorder  ,
test_sys_put_le48   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le48() functionality.

Test if sys_put_le48() correctly handles endianness.

See also
sys_put_le48()

◆ ZTEST() [37/52]

ZTEST ( byteorder  ,
test_sys_put_le64   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_put_le64() functionality.

Test if sys_put_le64() correctly handles endianness.

See also
sys_put_le64()

◆ ZTEST() [38/52]

ZTEST ( byteorder  ,
test_sys_uint16_to_array   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_uint16_to_array() functionality.

Test if sys_uint16_to_array() correctly handles endianness.

See also
sys_uint16_to_array()

◆ ZTEST() [39/52]

ZTEST ( byteorder  ,
test_sys_uint32_to_array   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_uint32_to_array() functionality.

Test if sys_uint32_to_array() correctly handles endianness.

See also
sys_uint32_to_array()

◆ ZTEST() [40/52]

ZTEST ( byteorder  ,
test_sys_uint64_to_array   
)

#include <tests/kernel/common/src/byteorder.c>

Test sys_uint64_to_array() functionality.

Test if sys_uint64_to_array() correctly handles endianness.

See also
sys_uint64_to_array()

◆ ZTEST() [41/52]

ZTEST ( clock  ,
test_clock_cycle_32   
)

#include <tests/kernel/common/src/clock.c>

Test 32-bit clock cycle functionality.

Test Objective:

Testing techniques

  • Functional and black box testing

Prerequisite Condition:

  • N/A

Input Specifications:

  • N/A

Expected Test Result:

  • The timer increases monotonically

Pass/Fail criteria:

  • Success if cycles increase monotonically, failure otherwise.

Test Procedure:

  1. At milli-second boundary, get cycles repeatedly by k_cycle_get_32() till cycles increased
  2. At milli-second boundary, get cycles repeatedly by k_uptime_get_32() till cycles increased
  3. Cross check cycles gotten by k_cycle_get_32() and k_uptime_get_32(), the delta cycle should be greater than 1 milli-second.

Assumptions and Constraints

  • N/A
See also
k_cycle_get_32(), k_uptime_get_32()

TESTPOINT: cycle elapse

TESTPOINT: cycle/uptime cross check

◆ ZTEST() [42/52]

ZTEST ( clock  ,
test_clock_cycle_64   
)

#include <tests/kernel/common/src/clock.c>

Test 64-bit clock cycle functionality.

◆ ZTEST() [43/52]

ZTEST ( clock  ,
test_ms_time_duration   
)

#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.

See also
k_timer_init(), k_timer_start(), k_timer_stop(), k_busy_wait()

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

◆ ZTEST() [44/52]

ZTEST ( common  ,
test_version   
)

◆ ZTEST() [45/52]

ZTEST ( common_1cpu  ,
test_timeout_order   
)

#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.

See also
k_timer_start()

◆ ZTEST() [46/52]

ZTEST ( constructor  ,
test_constructor   
)

◆ ZTEST() [47/52]

ZTEST ( fatal_exception  ,
test_fatal   
)

#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.

◆ ZTEST() [48/52]

ZTEST ( fatal_no_mt  ,
test_fatal   
)

#include <tests/kernel/fatal/no-multithreading/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.

◆ ZTEST() [49/52]

ZTEST ( multilib  ,
test_multilib   
)

#include <tests/kernel/common/src/multilib.c>

Test if correct multilib is selected.

◆ ZTEST() [50/52]

ZTEST ( printk  ,
test_printk   
)

#include <tests/kernel/common/src/printk.c>

Test printk() functionality.

See also
printk(), __printk_get_hook(), __printk_hook_install(), snprintk()

◆ ZTEST() [51/52]

ZTEST ( smp  ,
test_fatal_on_smp   
)

#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.

◆ ZTEST() [52/52]

ZTEST ( smp  ,
test_workq_on_smp   
)

#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.

◆ ZTEST_SUITE() [1/9]

ZTEST_SUITE ( atomic  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [2/9]

ZTEST_SUITE ( bitarray  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [3/9]

ZTEST_SUITE ( bitfield  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [4/9]

ZTEST_SUITE ( byteorder  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [5/9]

ZTEST_SUITE ( clock  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [6/9]

ZTEST_SUITE ( common_1cpu  ,
NULL  ,
common_setup  ,
ztest_simple_1cpu_before  ,
ztest_simple_1cpu_after  ,
NULL   
)

◆ ZTEST_SUITE() [7/9]

ZTEST_SUITE ( constructor  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [8/9]

ZTEST_SUITE ( multilib  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [9/9]

ZTEST_SUITE ( printk  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_USER() [1/2]

ZTEST_USER ( atomic  ,
test_atomic   
)

#include <tests/kernel/common/src/atomic.c>

Verify atomic functionalities.

Test Objective:

  • Test the function of the atomic operation API is correct.

Test techniques:

  • Dynamic analysis and testing
  • Functional and black box testing
  • Interface testing

Prerequisite Conditions:

  • N/A

Input Specifications:

  • N/A

Test Procedure:

  1. Call the API interface of the following atomic operations in turn, judge the change of function return value and target operands.

Expected Test Result:

  • The change of function return value and target operands is correct.

Pass/Fail Criteria:

  • Successful if check points in test procedure are all passed, otherwise failure.

Assumptions and Constraints:

  • N/A
See also
atomic_cas(), atomic_add(), atomic_sub(), atomic_inc(), atomic_dec(), atomic_get(), atomic_set(), atomic_clear(), atomic_or(), atomic_and(), atomic_xor(), atomic_nand(), atomic_test_bit(), atomic_test_and_clear_bit(), atomic_test_and_set_bit(), atomic_clear_bit(), atomic_set_bit(), ATOMIC_DEFINE

◆ ZTEST_USER() [2/2]

ZTEST_USER ( clock  ,
test_clock_uptime   
)

#include <tests/kernel/common/src/clock.c>

Test clock uptime APIs functionality.

See also
k_uptime_get(), k_uptime_get_32(), k_uptime_delta()

TESTPOINT: uptime elapse

TESTPOINT: uptime elapse lower 32-bit

TESTPOINT: uptime straddled ms boundary

TESTPOINT: uptime delta

Variable Documentation

◆ constructor_value

int constructor_value
static

#include <tests/kernel/common/src/constructor.c>

Test if constructors work.