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

Last change on this file since f0d6862 was f0d6862, checked in by Sebastian Huber <sebastian.huber@…>, on 06/04/20 at 14:58:18

spec: Add object name to id actions

  • 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
45requirement-type: functional
46test-action: |
47  if ( ctx->id != NULL ) {
48    ctx->status = rtems_task_ident( RTEMS_SELF, 0xdeadbeef, ctx->id );
49  } else {
50    ${../ident:/test-run}(
51      ctx->id_local_object,
52      ClassicTaskIdentAction
53    );
54  }
55test-brief: null
56test-context:
57- brief: null
58  description: null
59  member: rtems_status_code status
60- brief: null
61  description: null
62  member: rtems_id *id
63- brief: null
64  description: null
65  member: rtems_id id_value
66- brief: null
67  description: null
68  member: rtems_id id_local_object
69test-description: null
70test-header: null
71test-includes: []
72test-local-includes:
73- support-object-ident.h
74test-name: Classic Task Ident
75test-setup:
76  brief: null
77  code: |
78    static char task_storage[ RTEMS_MINIMUM_STACK_SIZE ];
79    static const rtems_task_config task_config = {
80      .name = ClassicObjectIdentName,
81      .initial_priority = 1,
82      .stack_area = task_storage,
83      .stack_size = sizeof( task_storage ),
84      .initial_modes = RTEMS_DEFAULT_MODES,
85      .attribute_set = RTEMS_DEFAULT_ATTRIBUTES
86    };
87    rtems_status_code sc;
88
89    sc = rtems_task_build( &task_config, &ctx->id_local_object );
90    T_assert_rsc_success( sc );
91  description: null
92test-stop: null
93test-support: |
94  static rtems_status_code ClassicTaskIdentAction(
95    rtems_name name,
96    uint32_t   node,
97    rtems_id  *id
98  )
99  {
100    return rtems_task_ident( name, node, id );
101  }
102test-target: testsuites/validation/tc-task-ident.c
103test-teardown: null
104transition-map:
105- enabled-by: true
106  post-conditions:
107    Post: OkAndSelfId
108  pre-conditions:
109    Pre:
110    - Self
111- enabled-by: true
112  post-conditions:
113    Post: Generic
114  pre-conditions:
115    Pre:
116    - Generic
117rationale: null
118references: []
119text: ${.:text-template}
120type: requirement
Note: See TracBrowser for help on using the repository browser.