source: rtems-central/spec/req/rtems/tasks/ident.yml @ 1b4640d

Last change on this file since 1b4640d was 1b4640d, checked in by Sebastian Huber <sebastian.huber@…>, on 08/17/20 at 08:41:18

spec: Use tr-* file pattern for test runs

  • Property mode set to 100644
File size: 3.0 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:
7- role: interface-function
8  uid: /if/rtems/tasks/ident
9post-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
28pre-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
45rationale: null
46references: []
47requirement-type: functional
48skip-reasons: {}
49test-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  }
58test-brief: null
59test-cleanup: null
60test-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
73test-context-support: null
74test-description: null
75test-header: null
76test-includes: []
77test-local-includes:
78- tr-object-ident.h
79test-prepare: null
80test-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
97test-stop: null
98test-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  }
107test-target: testsuites/validation/tc-task-ident.c
108test-teardown: null
109text: ${.:text-template}
110transition-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
123type: requirement
Note: See TracBrowser for help on using the repository browser.