Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Clock Operations

Functions

void test_clock_uptime (void)
 Test clock uptime APIs functionality.
 
void test_clock_cycle_32 (void)
 Test 32-bit clock cycle functionality.
 
void test_clock_cycle_64 (void)
 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)
 
void test_ms_time_duration (void)
 Test millisecond time duration.
 

Detailed Description

Function Documentation

◆ duration_expire()

static void duration_expire ( struct k_timer * timer)
static

◆ init_data_count()

static void init_data_count ( void )
static

◆ stop_expire()

static void stop_expire ( struct k_timer * timer)
static

◆ test_clock_cycle_32()

void test_clock_cycle_32 ( void )

#include </home/runner/work/safety-doc/zephyr/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

◆ test_clock_cycle_64()

void test_clock_cycle_64 ( void )

#include </home/runner/work/safety-doc/zephyr/tests/kernel/common/src/clock.c>

Test 64-bit clock cycle functionality.

◆ test_clock_uptime()

void test_clock_uptime ( void )

#include </home/runner/work/safety-doc/zephyr/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

◆ test_ms_time_duration()

void test_ms_time_duration ( void )

#include </home/runner/work/safety-doc/zephyr/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