summaryrefslogtreecommitdiffstats
path: root/spec/score/timecounter/unit/kern-tc.yml
blob: 0ec6d9555c70bc2aa488d65de094e5a6b49fb440 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:

#### _Timecounter_Getbintime() ################################################

- action-brief: |
    Call function _Timecounter_Getbintime().
  action-code: |
    struct bintime bt;
    _Timecounter_Getbintime( &bt );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( bt.sec, TOD_SECONDS_1970_THROUGH_1988 );
      T_eq_long( bt.frac, 0 );
    links: []
  links:
  - name: _Timecounter_Getbintime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Getbinuptime() ##############################################

- action-brief: |
    Call function _Timecounter_Getbinuptime().
  action-code: |
    struct bintime bt;
    _Timecounter_Getbinuptime( &bt );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( bt.sec, 1 );
      T_eq_long( bt.frac, 0 );
    links: []
  links:
  - name: _Timecounter_Getbinuptime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Getboottime() ##############$$$##############################

- action-brief: |
    Call function _Timecounter_Getboottime().
  action-code: |
    struct timeval tv;
    _Timecounter_Getboottime( &tv );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( tv.tv_sec, TOD_SECONDS_1970_THROUGH_1988 - 1 );
      T_eq_long( tv.tv_usec, 0 );
    links: []
  links:
  - name: _Timecounter_Getboottime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Getboottimebin() ############################################

- action-brief: |
    Call function _Timecounter_Getboottimebin().
  action-code: |
    struct bintime bt;
    _Timecounter_Getboottimebin( &bt );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( bt.sec, TOD_SECONDS_1970_THROUGH_1988 - 1 );
      T_eq_long( bt.frac, 0 );
    links: []
  links:
  - name: _Timecounter_Getboottimebin
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Getmicrotime() ##############################################

- action-brief: |
    Call function _Timecounter_Getmicrotime().
  action-code: |
    struct timeval tv;
    _Timecounter_Getmicrotime( &tv );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( tv.tv_sec, TOD_SECONDS_1970_THROUGH_1988 );
      T_eq_long( tv.tv_usec, 0 );
    links: []
  links:
  - name: _Timecounter_Getmicrotime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Getmicrouptime() ############################################

- action-brief: |
    Call function _Timecounter_Getmicrouptime().
  action-code: |
    struct timeval tv;
    _Timecounter_Getmicrouptime( &tv );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( tv.tv_sec, 1 );
      T_eq_long( tv.tv_usec, 0 );
    links: []
  links:
  - name: _Timecounter_Getmicrouptime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Microuptime() ##############################################

- action-brief: |
    Call function _Timecounter_Microuptime().
  action-code: |
    struct timeval tv;
    _Timecounter_Microuptime( &tv );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( tv.tv_sec, 1 );
      T_eq_long( tv.tv_usec, 0 );
    links: []
  links:
  - name: _Timecounter_Microuptime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Nanotime() #################################################

- action-brief: |
    Call function _Timecounter_Nanotime().
  action-code: |
    struct timespec ts;
    _Timecounter_Nanotime( &ts );
  checks:
  - brief: |
      Check value returned by function call.
    code: |
      T_eq_u64( ts.tv_sec, TOD_SECONDS_1970_THROUGH_1988 );
      T_eq_long( ts.tv_nsec, 0 );
    links: []
  links:
  - name: _Timecounter_Nanotime
    role: unit-test
    uid: ../../if/domain

#### _Timecounter_Tick_simple() ###############################################

- action-brief: |
    Call function _Timecounter_Tick_simple().
  action-code: |
    ISR_lock_Context lock_context;
    _Timecounter_Acquire( &lock_context );
    _Timecounter_Tick_simple( 0, 0, &lock_context );
  checks: []
  links:
  - name: _Timecounter_Tick_simple
    role: unit-test
    uid: ../../if/domain

###############################################################################

test-brief: |
  Unit tests for the time counter kern_tc part.
test-context: []
test-context-support: null
test-description: |
  Parts of the file ``cpukit/score/src/kern_tc.c``
  are only executed by the POSIX API and certain device driver code.  The
  space qualified code subset does not contain those features.  This test
  exercises the code parts otherwise not reached in order to achieve full
  code coverage.
test-header: null
test-includes:
- rtems/score/timecounter.h
- rtems/score/todimpl.h
test-local-includes: []
test-setup: null
test-stop: null
test-support: null
test-target: testsuites/unit/tc-score-kern-tc.c
test-teardown: null
type: test-case