1 | SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause |
---|
2 | copyrights: |
---|
3 | - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) |
---|
4 | enabled-by: true |
---|
5 | functional-type: action |
---|
6 | links: |
---|
7 | - role: interface-function |
---|
8 | uid: /if/rtems/tasks/ident |
---|
9 | post-conditions: |
---|
10 | - name: Post |
---|
11 | states: |
---|
12 | - name: OkAndSelfId |
---|
13 | test-code: | |
---|
14 | T_rsc(ctx->status, RTEMS_SUCCESSFUL); |
---|
15 | T_eq_ptr(ctx->id, &ctx->id_value); |
---|
16 | T_eq_u32(ctx->id_value, rtems_task_self()); |
---|
17 | text: | |
---|
18 | The status shall be RTEMS_SUCCESSFUL. The value of the object identifier |
---|
19 | referenced by the id parameter shall be the identifier of the executing |
---|
20 | thread. |
---|
21 | - name: Generic |
---|
22 | test-code: | |
---|
23 | /* Checks performed by ${../ident:/test-run}() */ |
---|
24 | text: | |
---|
25 | The post-condition status shall be specified by ${../ident}. |
---|
26 | test-epilogue: null |
---|
27 | test-prologue: null |
---|
28 | pre-conditions: |
---|
29 | - name: Pre |
---|
30 | states: |
---|
31 | - name: Self |
---|
32 | test-code: | |
---|
33 | ctx->id_value = 0xffffffff; |
---|
34 | ctx->id = &ctx->id_value; |
---|
35 | text: | |
---|
36 | The name parameter shall be RTEMS_SELF. |
---|
37 | - name: Generic |
---|
38 | test-code: | |
---|
39 | ctx->id = NULL; |
---|
40 | /* Preparation performed by ${../ident:/test-run}() */ |
---|
41 | text: | |
---|
42 | The pre-condition status shall be specified by ${../ident}. |
---|
43 | test-epilogue: null |
---|
44 | test-prologue: null |
---|
45 | rationale: null |
---|
46 | references: [] |
---|
47 | requirement-type: functional |
---|
48 | skip-reasons: {} |
---|
49 | test-action: | |
---|
50 | if ( ctx->id != NULL ) { |
---|
51 | ctx->status = rtems_task_ident( RTEMS_SELF, 0xdeadbeef, ctx->id ); |
---|
52 | } else { |
---|
53 | ${../ident:/test-run}( |
---|
54 | ctx->id_local_object, |
---|
55 | ClassicTaskIdentAction |
---|
56 | ); |
---|
57 | } |
---|
58 | test-brief: null |
---|
59 | test-cleanup: null |
---|
60 | test-context: |
---|
61 | - brief: null |
---|
62 | description: null |
---|
63 | member: rtems_status_code status |
---|
64 | - brief: null |
---|
65 | description: null |
---|
66 | member: rtems_id *id |
---|
67 | - brief: null |
---|
68 | description: null |
---|
69 | member: rtems_id id_value |
---|
70 | - brief: null |
---|
71 | description: null |
---|
72 | member: rtems_id id_local_object |
---|
73 | test-context-support: null |
---|
74 | test-description: null |
---|
75 | test-header: null |
---|
76 | test-includes: [] |
---|
77 | test-local-includes: |
---|
78 | - tr-object-ident.h |
---|
79 | test-prepare: null |
---|
80 | test-setup: |
---|
81 | brief: null |
---|
82 | code: | |
---|
83 | static char task_storage[ RTEMS_MINIMUM_STACK_SIZE ]; |
---|
84 | static const rtems_task_config task_config = { |
---|
85 | .name = ClassicObjectIdentName, |
---|
86 | .initial_priority = 1, |
---|
87 | .stack_area = task_storage, |
---|
88 | .stack_size = sizeof( task_storage ), |
---|
89 | .initial_modes = RTEMS_DEFAULT_MODES, |
---|
90 | .attribute_set = RTEMS_DEFAULT_ATTRIBUTES |
---|
91 | }; |
---|
92 | rtems_status_code sc; |
---|
93 | |
---|
94 | sc = rtems_task_build( &task_config, &ctx->id_local_object ); |
---|
95 | T_assert_rsc_success( sc ); |
---|
96 | description: null |
---|
97 | test-stop: null |
---|
98 | test-support: | |
---|
99 | static rtems_status_code ClassicTaskIdentAction( |
---|
100 | rtems_name name, |
---|
101 | uint32_t node, |
---|
102 | rtems_id *id |
---|
103 | ) |
---|
104 | { |
---|
105 | return rtems_task_ident( name, node, id ); |
---|
106 | } |
---|
107 | test-target: testsuites/validation/tc-task-ident.c |
---|
108 | test-teardown: null |
---|
109 | text: ${.:text-template} |
---|
110 | transition-map: |
---|
111 | - enabled-by: true |
---|
112 | post-conditions: |
---|
113 | Post: OkAndSelfId |
---|
114 | pre-conditions: |
---|
115 | Pre: |
---|
116 | - Self |
---|
117 | - enabled-by: true |
---|
118 | post-conditions: |
---|
119 | Post: Generic |
---|
120 | pre-conditions: |
---|
121 | Pre: |
---|
122 | - Generic |
---|
123 | type: requirement |
---|