summaryrefslogtreecommitdiffstats
path: root/spec/rtems/clock/val/clock.yml
blob: 7a9eace5832d4872883d8b677067b1eccdba8a0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG
enabled-by: true
links: []
test-actions:
- action-brief: |
    Use the ${../if/get-ticks-since-boot-macro:/name} directive before and
    after exactly one clock tick.
  action-code: |
    rtems_interval result_0;
    rtems_interval result_1;

    result_0 = rtems_clock_get_ticks_since_boot();
    ClockTick();
    result_1 = rtems_clock_get_ticks_since_boot();
  checks:
  - brief: |
      Check that ${/glossary/clock-tick:/term} gets incremented.
    code: |
      T_step_eq_u32( ${.:/step}, result_1 - result_0, 1 );
    links:
    - role: validation
      uid: ../req/get-ticks-since-boot-macro
  links: []
- action-brief: |
    Use the ${../if/get-ticks-since-boot:/name} directive before and after
    exactly one clock tick.
  action-code: |
    rtems_interval result_0;
    rtems_interval result_1;

    #undef rtems_clock_get_ticks_since_boot

    result_0 = rtems_clock_get_ticks_since_boot();
    ClockTick();
    result_1 = rtems_clock_get_ticks_since_boot();
  checks:
  - brief: |
      Check that ${/glossary/clock-tick:/term} gets incremented.
    code: |
      T_step_eq_u32( ${.:/step}, result_1 - result_0, 1 );
    links:
    - role: validation
      uid: ../req/get-ticks-since-boot
  links: []
- action-brief: |
    Use the ${../if/get-ticks-per-second-macro:/name} directive.
  action-code: |
    rtems_interval result;

    result = rtems_clock_get_ticks_per_second();
  checks:
  - brief: |
      Check that ${../if/get-ticks-per-second:/name} actually returns
      1us / CONFIGURE_MICROSECONDS_PER_TICK.
    code: |
      T_step_eq_u32( ${.:/step}, result, 1000000UL / TEST_MICROSECONDS_PER_TICK );
    links:
    - role: validation
      uid: ../req/get-ticks-per-second-macro
  links: []
- action-brief: |
    Use the ${../if/get-ticks-per-second:/name} directive.
  action-code: |
    rtems_interval result;

    #undef rtems_clock_get_ticks_per_second

    result = rtems_clock_get_ticks_per_second();
  checks:
  - brief: |
      Check that ${../if/get-ticks-per-second:/name} actually returns
      1us / CONFIGURE_MICROSECONDS_PER_TICK.
    code: |
      T_step_eq_u32( ${.:/step}, result, 1000000UL / TEST_MICROSECONDS_PER_TICK );
    links:
    - role: validation
      uid: ../req/get-ticks-per-second
  links: []
test-brief: |
  Tests some ${../if/group:/name} directives.
test-context: []
test-context-support: null
test-description: null
test-header: null
test-includes:
- rtems.h
test-local-includes:
- ts-config.h
- tx-support.h
test-setup: null
test-stop: null
test-support: null
test-target: testsuites/validation/tc-clock.c
test-teardown: null
type: test-case