source: rtems-central/spec/rtems/task/val/task.yml @ cd9d0ad

Last change on this file since cd9d0ad was cd9d0ad, checked in by Sebastian Huber <sebastian.huber@…>, on 11/18/21 at 08:01:02

spec: Specify RTEMS_CONFIGURED_MINIMUM_STACK_SIZE

  • Property mode set to 100644
File size: 5.7 KB
Line 
1SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
2copyrights:
3- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
4enabled-by: true
5links: []
6test-actions:
7- action-brief: |
8    Call ${../if/self:/name} check the returned value.
9  action-code: |
10    rtems_id id;
11
12    id = rtems_task_self();
13  checks:
14  - brief: |
15      Check that the returned value is equal to the object identifier of the
16      calling task.
17    code: |
18      T_step_eq_u32( ${step}, id, 0x0a010001 );
19    links: []
20  links:
21  - role: validation
22    uid: ../req/self
23- action-brief: |
24    Call ${../if/iterate:/name} with a visitor which always returns
25    ${/c/if/false:/name}.
26  action-code: |
27    TaskIterateContext ctx;
28    uint32_t           task_count;
29
30    task_count = rtems_scheduler_get_processor_maximum();
31
32    if ( task_count > 4 ) {
33      task_count = 4;
34    }
35
36    ++task_count;
37
38    memset( &ctx, 0, sizeof( ctx ) );
39    ctx.owner_before = _RTEMS_Allocator_is_owner();
40    rtems_task_iterate( TaskVisitor, &ctx );
41    ctx.owner_after = _RTEMS_Allocator_is_owner();
42  checks:
43  - brief: |
44      Check that the all counter is equal to the count of tasks.  Check that
45      the calling task was visited exacly once.  Firstly, this shows that
46      ${../if/iterate:/name} used the parameters specified by
47      ${../if/iterate:/params[0]/name} and ${../if/iterate:/params[1]/name}.
48      Secondly, this shows that the iteration was done over all tasks.
49    code: |
50      T_step_eq_u32( ${step}, ctx.counter_all, task_count );
51      T_step_eq_u32( ${step}, ctx.counter_self, 1 );
52    links:
53    - role: validation
54      uid: ../req/iterate-visit
55    - role: validation
56      uid: ../req/iterate-done
57  - brief: |
58      Check that the object alloctor mutex was not owned before and after the
59      call.  Check that the object alloctor mutex was owned during the
60      iteration.
61    code: |
62      T_step_false( ${step}, ctx.owner_before );
63      T_step_true( ${step}, ctx.owner_in_visitor );
64      T_step_false( ${step}, ctx.owner_after );
65    links:
66    - role: validation
67      uid: ../req/iterate-start
68    - role: validation
69      uid: ../req/iterate-done
70  links:
71  - role: validation
72    uid: ../req/iterate-start
73- action-brief: |
74    Call ${../if/iterate:/name} with a visitor which returns
75    ${/c/if/true:/name}.
76  action-code: |
77    TaskIterateContext ctx;
78
79    memset( &ctx, 0, sizeof( ctx ) );
80    ctx.done = true;
81    rtems_task_iterate( TaskVisitor, &ctx );
82  checks:
83  - brief: |
84      Check that the all counter is equal to one.  This shows that the
85      iteration stops when the visitor returns ${/c/if/true:/name}.
86    code: |
87      T_step_eq_u32( ${step}, ctx.counter_all, 1 );
88    links:
89    - role: validation
90      uid: ../req/iterate-stop
91  links: []
92- action-brief: |
93    Assert that ${../if/storage-alignment:/name} is a constant expression which
94    evaluates to the expected value.
95  action-code: |
96    RTEMS_STATIC_ASSERT(
97      RTEMS_TASK_STORAGE_ALIGNMENT == CPU_STACK_ALIGNMENT,
98      STORAGE_ALIGNMENT
99    );
100  checks: []
101  links:
102  - role: validation
103    uid: ../req/storage-alignment
104- action-brief: |
105    Assert that ${../if/no-priority:/name} is a constant expression which
106    evaluates to the expected value.
107  action-code: |
108    RTEMS_STATIC_ASSERT(
109      RTEMS_NO_PRIORITY == RTEMS_CURRENT_PRIORITY,
110      NO_PRIORITY
111    );
112  checks: []
113  links:
114  - role: validation
115    uid: ../req/no-priority
116- action-brief: |
117    Assert that ${../if/minimum-stack-size:/name} is a constant expression which
118    evaluates to the expected value.
119  action-code: |
120    RTEMS_STATIC_ASSERT(
121      RTEMS_MINIMUM_STACK_SIZE == STACK_MINIMUM_SIZE,
122      MINIMUM_STACK_SIZE
123    );
124  checks: []
125  links:
126  - role: validation
127    uid: ../req/minimum-stack-size
128- action-brief: |
129    Assert that ${../if/configured-minimum-stack-size:/name} is a constant
130    expression which evaluates to the expected value.
131  action-code: |
132    RTEMS_STATIC_ASSERT(
133      RTEMS_CONFIGURED_MINIMUM_STACK_SIZE == 0,
134      CONFIGURED_MINIMUM_STACK_SIZE
135    );
136  checks: []
137  links:
138  - role: validation
139    uid: ../req/configured-minimum-stack-size
140- action-brief: |
141    Assert that ${../if/minimum-priority:/name} is a constant expression which
142    evaluates to the expected value.
143  action-code: |
144    RTEMS_STATIC_ASSERT( RTEMS_MINIMUM_PRIORITY == 1, MINIMUM_PRIORITY );
145  checks: []
146  links:
147  - role: validation
148    uid: ../req/minimum-priority
149- action-brief: |
150    Validate ${../if/self-define:/name} using a sample directive call.
151  action-code: |
152    rtems_status_code sc;
153  checks:
154  - brief: |
155      Check that ${../if/is-suspended:/name} returns the expected status if
156      called with a task identifier parameter of ${../if/self-define:/name}.
157    code: |
158      sc = rtems_task_is_suspended( RTEMS_SELF );
159      T_step_rsc_success( ${step}, sc );
160    links:
161    - role: validation
162      uid: ../req/self-define
163  links: []
164test-brief: |
165  This test case collection provides validation test cases for requirements of
166  the ${../if/group:/name}.
167test-context: []
168test-context-support: null
169test-description: null
170test-header: null
171test-includes:
172- rtems.h
173- string.h
174- rtems/score/apimutex.h
175test-local-includes: []
176test-setup: null
177test-stop: null
178test-support: |
179  typedef struct {
180    bool     owner_before;
181    bool     owner_in_visitor;
182    bool     owner_after;
183    uint32_t counter_all;
184    uint32_t counter_self;
185    bool     done;
186  } TaskIterateContext;
187
188  static bool TaskVisitor( rtems_tcb *tcb, void *arg )
189  {
190    TaskIterateContext *ctx;
191
192    ctx = arg;
193    ++ctx->counter_all;
194
195    if ( rtems_task_self() == tcb->Object.id ) {
196      ++ctx->counter_self;
197    }
198
199    ctx->owner_in_visitor = _RTEMS_Allocator_is_owner();
200
201    return ctx->done;
202  }
203test-target: testsuites/validation/tc-task.c
204test-teardown: null
205type: test-case
Note: See TracBrowser for help on using the repository browser.