source: rtems-central/rtemsspec/tests/spec-validation/directive.yml @ e49c759

Last change on this file since e49c759 was e49c759, checked in by Sebastian Huber <sebastian.huber@…>, on 07/15/20 at 08:04:25

Rename "rtemsqual" in "rtemsspec"

  • Property mode set to 100644
File size: 7.2 KB
Line 
1SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
2copyrights:
3- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
4enabled-by: true
5functional-type: action
6links: []
7post-conditions:
8- name: Status
9  states:
10  - name: Ok
11    test-code: |
12      T_rsc(ctx->status, RTEMS_SUCCESSFUL);
13    text: |
14      The status shall be RTEMS_SUCCESSFUL.
15  - name: InvAddr
16    test-code: |
17      T_rsc(ctx->status, RTEMS_INVALID_ADDRESS);
18    text: |
19      The status shall be RTEMS_INVALID_ADDRESS.
20  - name: InvName
21    test-code: |
22      T_rsc(ctx->status, RTEMS_INVALID_NAME);
23    text: |
24      The status shall be RTEMS_INVALID_NAME.
25  - name: InvNode
26    test-code: |
27      T_rsc(ctx->status, RTEMS_INVALID_NODE);
28    text: |
29      The status shall be RTEMS_INVALID_NODE.
30  - name: InvId
31    test-code: |
32      T_rsc(ctx->status, RTEMS_INVALID_ID);
33    text: |
34      The status shall be RTEMS_INVALID_ID.
35  test-epilogue: null
36  test-prologue: null
37- name: Id
38  states:
39  - name: Nop
40    test-code: |
41      T_eq_ptr(ctx->id, &ctx->id_value);
42      T_eq_u32(ctx->id_value, 0xffffffff);
43    text: |
44      The value of the object identifier referenced by the id parameter shall
45      be the value before the call to rtems_task_ident().
46  - name: NullPtr
47    test-code: |
48      T_null(ctx->id)
49    text: |
50      The id parameter shall be NULL.
51  - name: Self
52    test-code: |
53      T_eq_ptr(ctx->id, &ctx->id_value);
54      T_eq_u32(ctx->id_value, rtems_task_self());
55    text: |
56      The value of the object identifier referenced by the id parameter shall
57      be the identifier of the executing thread.
58  - name: LocalTask
59    test-code: |
60      T_eq_ptr(ctx->id, &ctx->id_value);
61      T_eq_u32(ctx->id_value, ctx->id_local_task);
62    text: |
63      The value of the object identifier referenced by the id parameter shall
64      be the identifier of a local task with a name equal to the name
65      parameter.  If more than one local task with such a name exists, then it
66      shall be the identifier of the task with the lowest object index.
67  - name: RemoteTask
68    test-code: |
69      T_eq_ptr(ctx->id, &ctx->id_value);
70      T_eq_u32(ctx->id_value, ctx->id_remote_task);
71    text: |
72      The value of the object identifier referenced by the id parameter shall
73      be the identifier of a remote task on a eligible node defined by the node
74      parameter with a name equal to the name parameter.  If more than one task
75      with such a name exists on the same node, then it shall be the identifier
76      of the task with the lowest object index.  If more than one task with
77      such a name exists on different eligible nodes, then it shall be the
78      identifier of the task with the lowest node index.
79  test-epilogue: null
80  test-prologue: null
81pre-conditions:
82- name: Name
83  states:
84  - name: Invalid
85    test-code: |
86      ctx->name = 1;
87    text: |
88      The name parameter shall not equal to a name of an active Classic API
89      task object and not equal to RTEMS_SELF.
90  - name: Self
91    test-code: |
92      ctx->name = RTEMS_SELF;
93    text: |
94      The name parameter shall be RTEMS_SELF.
95  - name: Valid
96    test-code: |
97      ctx->name = rtems_build_name( 'T', 'A', 'S', 'K' );
98    text: |
99      The name parameter shall equal to a name of an active Classic API task
100      object.
101  test-epilogue: |
102    /* Epilogue */
103  test-prologue: |
104    /* Prologue */
105- name: Node
106  states:
107  - name: Local
108    test-code: |
109      ctx->node = 1;
110    text: |
111      The node parameter shall be the local node number.
112  - name: Remote
113    test-code: |
114      ctx->node = 2;
115    text: |
116      The node parameter shall be a remote node number.
117  - name: Invalid
118    test-code: |
119      ctx->node = 256;
120    text: |
121      The node parameter shall be an invalid node number.
122  - name: SearchAll
123    test-code: |
124      ctx->node = RTEMS_SEARCH_ALL_NODES;
125    text: |
126      The node parameter shall be RTEMS_SEARCH_ALL_NODES.
127  - name: SearchOther
128    test-code: |
129      ctx->node = RTEMS_SEARCH_OTHER_NODES;
130    text: |
131      The node parameter shall be RTEMS_SEARCH_OTHER_NODES.
132  - name: SearchLocal
133    test-code: |
134      ctx->node = RTEMS_SEARCH_LOCAL_NODE;
135    text: |
136      The node parameter shall be RTEMS_SEARCH_LOCAL_NODE.
137  test-epilogue: null
138  test-prologue: null
139- name: Id
140  states:
141  - name: NullPtr
142    test-code: |
143      ctx->id = NULL;
144    text: |
145      The id parameter shall be NULL.
146  - name: Valid
147    test-code: |
148      ctx->id_value = 0xffffffff;
149      ctx->id = &ctx->id_value;
150    text: |
151      The id parameter shall point to an object identifier.
152  test-epilogue: null
153  test-prologue: null
154requirement-type: functional
155test-action: |
156  ctx->status = rtems_task_ident( ctx->name, ctx->node, ctx->id );
157test-brief: Test rtems_task_ident() brief description.
158test-context:
159- brief: |
160    Brief context member description.
161  description: |
162    Context member description.
163  member: |
164    rtems_status_code status
165- brief: null
166  description: null
167  member: |
168    rtems_name name
169- brief: null
170  description: null
171  member: |
172    uint32_t node
173- brief: null
174  description: null
175  member: |
176    rtems_id *id
177- brief: null
178  description: null
179  member: |
180    rtems_id id_value
181- brief: null
182  description: null
183  member: |
184    rtems_id id_local_task
185- brief: null
186  description: null
187  member: |
188    rtems_id id_remote_task
189test-description: Test rtems_task_ident() description.
190test-includes:
191- rtems.h
192test-local-includes:
193- x.h
194test-name: Classic Task Identification
195test-setup:
196  brief: |
197    Setup brief description.
198  code: |
199    rtems_status_code sc;
200
201    sc = rtems_task_create(
202      rtems_build_name( 'T', 'A', 'S', 'K' ),
203      1,
204      RTEMS_MINIMUM_STACK_SIZE,
205      RTEMS_DEFAULT_MODES,
206      RTEMS_DEFAULT_ATTRIBUTES,
207      &ctx->id_local_task
208    );
209    T_assert_rsc_success( sc );
210  description: |
211    Setup description.
212test-stop: null
213test-support: |
214  /* Test rtems_task_ident() support */
215test-header: null
216test-target: tc12.c
217test-teardown:
218  brief: null
219  code: |
220    rtems_status_code sc;
221
222    if ( ctx->id_local_task != 0 ) {
223      sc = rtems_task_delete( ctx->id_local_task );
224      T_rsc_success( sc );
225    }
226  description: null
227transition-map:
228- enabled-by: true
229  post-conditions:
230    Id: Self
231    Status: Ok
232  pre-conditions:
233    Id:
234    - Valid
235    Name:
236    - Self
237    Node: all
238- enabled-by: true
239  post-conditions:
240    Id: LocalTask
241    Status: Ok
242  pre-conditions:
243    Id:
244    - Valid
245    Name:
246    - Valid
247    Node:
248    - SearchAll
249    - SearchLocal
250    - Local
251- enabled-by: true
252  post-conditions:
253    Id: Nop
254    Status: InvName
255  pre-conditions:
256    Id:
257    - Valid
258    Name:
259    - Valid
260    Node:
261    - Invalid
262    - SearchOther
263    - Remote
264- enabled-by: true
265  post-conditions:
266    Id: Nop
267    Status: InvName
268  pre-conditions:
269    Id:
270    - Valid
271    Name:
272    - Invalid
273    Node: all
274- enabled-by: true
275  post-conditions:
276    Id: NullPtr
277    Status: InvAddr
278  pre-conditions:
279    Id:
280    - NullPtr
281    Name: all
282    Node: all
283- enabled-by: RTEMS_MULTIPROCESSING
284  post-conditions:
285    Id: RemoteTask
286    Status: Ok
287  pre-conditions:
288    Id:
289    - Valid
290    Name:
291    - Valid
292    Node:
293    - SearchOther
294    - Remote
295rationale: null
296references: []
297text: |
298  Calling the rtems_task_ident() directive shall yield the specified
299  post-conditions under the specified pre-conditions.
300type: requirement
Note: See TracBrowser for help on using the repository browser.