From f0d6862e9efdf2f3a997f22f6aa35587fed5fe06 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 4 Jun 2020 16:58:18 +0200 Subject: spec: Add object name to id actions --- spec/req/rtems/barrier/ident.yml | 13 ++ spec/req/rtems/barrier/val/ident.yml | 47 +++++++ spec/req/rtems/ident-local.yml | 162 ++++++++++++++++++++++ spec/req/rtems/ident.yml | 253 +++++++++++++++++++++++++++++++++++ spec/req/rtems/message/ident.yml | 13 ++ spec/req/rtems/message/val/ident.yml | 49 +++++++ spec/req/rtems/part/ident.yml | 13 ++ spec/req/rtems/part/val/ident.yml | 51 +++++++ spec/req/rtems/ratemon/ident.yml | 13 ++ spec/req/rtems/ratemon/val/ident.yml | 45 +++++++ spec/req/rtems/sem/ident.yml | 13 ++ spec/req/rtems/sem/val/ident.yml | 49 +++++++ spec/req/rtems/tasks/ident.yml | 120 +++++++++++++++++ spec/req/rtems/timer/ident.yml | 13 ++ spec/req/rtems/timer/val/ident.yml | 45 +++++++ spec/req/rtems/userext/ident.yml | 13 ++ spec/req/rtems/userext/val/ident.yml | 47 +++++++ 17 files changed, 959 insertions(+) create mode 100644 spec/req/rtems/barrier/ident.yml create mode 100644 spec/req/rtems/barrier/val/ident.yml create mode 100644 spec/req/rtems/ident-local.yml create mode 100644 spec/req/rtems/ident.yml create mode 100644 spec/req/rtems/message/ident.yml create mode 100644 spec/req/rtems/message/val/ident.yml create mode 100644 spec/req/rtems/part/ident.yml create mode 100644 spec/req/rtems/part/val/ident.yml create mode 100644 spec/req/rtems/ratemon/ident.yml create mode 100644 spec/req/rtems/ratemon/val/ident.yml create mode 100644 spec/req/rtems/sem/ident.yml create mode 100644 spec/req/rtems/sem/val/ident.yml create mode 100644 spec/req/rtems/tasks/ident.yml create mode 100644 spec/req/rtems/timer/ident.yml create mode 100644 spec/req/rtems/timer/val/ident.yml create mode 100644 spec/req/rtems/userext/ident.yml create mode 100644 spec/req/rtems/userext/val/ident.yml (limited to 'spec') diff --git a/spec/req/rtems/barrier/ident.yml b/spec/req/rtems/barrier/ident.yml new file mode 100644 index 00000000..c54b7e37 --- /dev/null +++ b/spec/req/rtems/barrier/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/barrier/ident +requirement-type: functional +text: | + The ${/if/rtems/barrier/ident:/name} directive shall identify an Classic API + barrier class object by its name as specified by ${../ident-local}. +type: requirement diff --git a/spec/req/rtems/barrier/val/ident.yml b/spec/req/rtems/barrier/val/ident.yml new file mode 100644 index 00000000..ad4f2341 --- /dev/null +++ b/spec/req/rtems/barrier/val/ident.yml @@ -0,0 +1,47 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident-local.h +target: testsuites/validation/tc-barrier-ident.c +actions: +- action: | + ${../../ident-local:/test-run}( + id_local_object, + ClassicBarrierIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API parition class + objects defined by ${../../ident-local}. + links: [] +brief: Test the ${/if/rtems/barrier/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Barrier Ident +prologue: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_barrier_create( + ClassicObjectLocalIdentName, + RTEMS_DEFAULT_ATTRIBUTES, + 1, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicBarrierIdentAction( + rtems_name name, + rtems_id *id + ) + { + return rtems_barrier_ident( name, id ); + } +type: test-case diff --git a/spec/req/rtems/ident-local.yml b/spec/req/rtems/ident-local.yml new file mode 100644 index 00000000..38bf9cdd --- /dev/null +++ b/spec/req/rtems/ident-local.yml @@ -0,0 +1,162 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: action +links: [] +post-conditions: +- name: Status + states: + - name: Ok + test-code: | + T_rsc( ctx->status, RTEMS_SUCCESSFUL ); + text: | + The status shall be RTEMS_SUCCESSFUL. + - name: InvAddr + test-code: | + T_rsc( ctx->status, RTEMS_INVALID_ADDRESS ); + text: | + The status shall be RTEMS_INVALID_ADDRESS. + - name: InvName + test-code: | + T_rsc( ctx->status, RTEMS_INVALID_NAME ); + text: | + The status shall be RTEMS_INVALID_NAME. + test-epilogue: null + test-prologue: null +- name: Id + states: + - name: Nop + test-code: | + T_eq_ptr( ctx->id, &ctx->id_value ); + T_eq_u32( ctx->id_value, 0xffffffff ); + text: | + The value of the object identifier referenced by the id parameter shall + be the value before the action. + - name: NullPtr + test-code: | + T_null( ctx->id ) + text: | + The id parameter shall be NULL. + - name: Id + test-code: | + T_eq_ptr( ctx->id, &ctx->id_value ); + T_eq_u32( ctx->id_value, ctx->id_local_object ); + text: | + The value of the object identifier referenced by the id parameter shall + be the identifier of a local object of the specified class with a name + equal to the name parameter. If more than one local object of the + specified class with such a name exists, then it shall be the identifier + of the object with the lowest object index. + test-epilogue: null + test-prologue: null +pre-conditions: +- name: Name + states: + - name: Invalid + test-code: | + ctx->name = 1; + text: | + The name parameter shall not equal to a name of an active Classic API + object of the specified class. + - name: Valid + test-code: | + ctx->name = ClassicObjectLocalIdentName; + text: | + The name parameter shall equal to a name of an active Classic API object + of the specified class. + test-epilogue: null + test-prologue: null +- name: Id + states: + - name: NullPtr + test-code: | + ctx->id = NULL; + text: | + The id parameter shall be NULL. + - name: Valid + test-code: | + ctx->id_value = 0xffffffff; + ctx->id = &ctx->id_value; + text: | + The id parameter shall point to an object identifier. + test-epilogue: null + test-prologue: null +requirement-type: functional +test-action: | + ctx->status = ( *ctx->action )( ctx->name, ctx->id ); +test-brief: null +test-context: +- brief: null + description: null + member: rtems_status_code status +- brief: null + description: null + member: rtems_name name +- brief: null + description: null + member: rtems_id *id +- brief: null + description: null + member: rtems_id id_value +test-description: null +test-header: + code: | + #define ClassicObjectLocalIdentName \ + rtems_build_name( 'I', 'D', 'N', 'T' ) + includes: + - rtems.h + local-includes: [] + run-params: + - description: | + is the identifier of an active object of the class under test with the + name ClassicObjectLocalIdentName. + dir: null + name: id_local_object + specifier: rtems_id ${.:name} + - description: | + is the action handler. + dir: null + name: action + specifier: rtems_status_code ( *${.:name} )( rtems_name, rtems_id * ) + target: testsuites/validation/support-object-ident-local.h +test-includes: [] +test-local-includes: +- support-object-ident-local.h +test-name: Classic Object Local Ident +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/support-object-ident-local.c +test-teardown: null +transition-map: +- enabled-by: true + post-conditions: + Id: NullPtr + Status: InvAddr + pre-conditions: + Id: + - NullPtr + Name: all +- enabled-by: true + post-conditions: + Id: Nop + Status: InvName + pre-conditions: + Id: + - Valid + Name: + - Invalid +- enabled-by: true + post-conditions: + Id: Id + Status: Ok + pre-conditions: + Id: + - Valid + Name: + - Valid +rationale: null +references: [] +text: ${.:text-template} +type: requirement diff --git a/spec/req/rtems/ident.yml b/spec/req/rtems/ident.yml new file mode 100644 index 00000000..b56603bd --- /dev/null +++ b/spec/req/rtems/ident.yml @@ -0,0 +1,253 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: action +links: [] +post-conditions: +- name: Status + states: + - name: Ok + test-code: | + T_rsc(ctx->status, RTEMS_SUCCESSFUL); + text: | + The status shall be RTEMS_SUCCESSFUL. + - name: InvAddr + test-code: | + T_rsc(ctx->status, RTEMS_INVALID_ADDRESS); + text: | + The status shall be RTEMS_INVALID_ADDRESS. + - name: InvName + test-code: | + T_rsc(ctx->status, RTEMS_INVALID_NAME); + text: | + The status shall be RTEMS_INVALID_NAME. + - name: InvNode + test-code: | + T_rsc(ctx->status, RTEMS_INVALID_NODE); + text: | + The status shall be RTEMS_INVALID_NODE. + test-epilogue: null + test-prologue: null +- name: Id + states: + - name: Nop + test-code: | + T_eq_ptr(ctx->id, &ctx->id_value); + T_eq_u32(ctx->id_value, 0xffffffff); + text: | + The value of the object identifier referenced by the id parameter shall + be the value before the action. + - name: NullPtr + test-code: | + T_null(ctx->id) + text: | + The id parameter shall be NULL. + - name: LocalObj + test-code: | + T_eq_ptr(ctx->id, &ctx->id_value); + T_eq_u32(ctx->id_value, ctx->id_local_object); + text: | + The value of the object identifier referenced by the id parameter shall + be the identifier of a local object of the specified class with a name + equal to the name parameter. If more than one local object of the + specified class with such a name exists, then it shall be the identifier + of the object with the lowest object index. + - name: RemoteObj + test-code: | + T_eq_ptr(ctx->id, &ctx->id_value); + T_eq_u32(ctx->id_value, ctx->id_remote_object); + text: | + The value of the object identifier referenced by the id parameter shall + be the identifier of a remote object of the specified class on a eligible + node defined by the node parameter with a name equal to the name + parameter. If more than one local object of the specified class with + such a name exists, then it shall be the identifier of the object with + the lowest object index. Otherwise, if more than one object of the + specified class with such a name exists on remote eligible nodes, then it + shall be the identifier of the object with the lowest node index and the + lowest object index on this node. + test-epilogue: null + test-prologue: null +pre-conditions: +- name: Name + states: + - name: Invalid + test-code: | + ctx->name = 1; + text: | + The name parameter shall not equal to a name of an active Classic API + object of the specified class. + - name: Valid + test-code: | + ctx->name = ClassicObjectIdentName; + text: | + The name parameter shall equal to a name of an active Classic API object + of the specified class. + test-epilogue: null + test-prologue: null +- name: Node + states: + - name: Local + test-code: | + ctx->node = 1; + text: | + The node parameter shall be the local node number. + - name: Remote + test-code: | + ctx->node = 2; + text: | + The node parameter shall be a remote node number. + - name: Invalid + test-code: | + ctx->node = 256; + text: | + The node parameter shall be an invalid node number. + - name: SearchAll + test-code: | + ctx->node = RTEMS_SEARCH_ALL_NODES; + text: | + The node parameter shall be RTEMS_SEARCH_ALL_NODES. + - name: SearchOther + test-code: | + ctx->node = RTEMS_SEARCH_OTHER_NODES; + text: | + The node parameter shall be RTEMS_SEARCH_OTHER_NODES. + - name: SearchLocal + test-code: | + ctx->node = RTEMS_SEARCH_LOCAL_NODE; + text: | + The node parameter shall be RTEMS_SEARCH_LOCAL_NODE. + test-epilogue: null + test-prologue: null +- name: Id + states: + - name: NullPtr + test-code: | + ctx->id = NULL; + text: | + The id parameter shall be NULL. + - name: Valid + test-code: | + ctx->id_value = 0xffffffff; + ctx->id = &ctx->id_value; + text: | + The id parameter shall point to an object identifier. + test-epilogue: null + test-prologue: null +requirement-type: functional +test-action: | + ctx->status = ( *ctx->action )( ctx->name, ctx->node, ctx->id ); +test-brief: null +test-context: +- brief: null + description: null + member: | + rtems_status_code status +- brief: null + description: null + member: rtems_name name +- brief: null + description: null + member: uint32_t node +- brief: null + description: null + member: rtems_id *id +- brief: null + description: null + member: rtems_id id_value +- brief: null + description: null + member: rtems_id id_remote_object +test-description: null +test-header: + code: | + #define ClassicObjectIdentName \ + rtems_build_name( 'I', 'D', 'N', 'T' ) + includes: + - rtems.h + local-includes: [] + run-params: + - description: | + is the identifier of an active object of the class under test with the + name ClassicObjectIdentName. + dir: null + name: id_local_object + specifier: rtems_id ${.:name} + - description: | + is the action handler. + dir: null + name: action + specifier: rtems_status_code ( *${.:name} )( rtems_name, uint32_t, rtems_id * ) + target: testsuites/validation/support-object-ident.h +test-includes: [] +test-local-includes: +- support-object-ident.h +test-name: Classic Object Ident +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/support-object-ident.c +test-teardown: null +transition-map: +- enabled-by: true + post-conditions: + Id: LocalObj + Status: Ok + pre-conditions: + Id: + - Valid + Name: + - Valid + Node: + - SearchAll + - SearchLocal + - Local +- enabled-by: true + post-conditions: + Id: Nop + Status: InvName + pre-conditions: + Id: + - Valid + Name: + - Valid + Node: + - Invalid + - SearchOther + - Remote +- enabled-by: true + post-conditions: + Id: Nop + Status: InvName + pre-conditions: + Id: + - Valid + Name: + - Invalid + Node: all +- enabled-by: true + post-conditions: + Id: NullPtr + Status: InvAddr + pre-conditions: + Id: + - NullPtr + Name: all + Node: all +- enabled-by: RTEMS_MULTIPROCESSING + post-conditions: + Id: RemoteObj + Status: Ok + pre-conditions: + Id: + - Valid + Name: + - Valid + Node: + - SearchOther + - Remote +rationale: null +references: [] +text: ${.:text-template} +type: requirement diff --git a/spec/req/rtems/message/ident.yml b/spec/req/rtems/message/ident.yml new file mode 100644 index 00000000..970a22f8 --- /dev/null +++ b/spec/req/rtems/message/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/message/ident +requirement-type: functional +text: | + The ${/if/rtems/message/ident:/name} directive shall identify an Classic API + message queue class object by its name as specified by ${../ident}. +type: requirement diff --git a/spec/req/rtems/message/val/ident.yml b/spec/req/rtems/message/val/ident.yml new file mode 100644 index 00000000..3d3590c6 --- /dev/null +++ b/spec/req/rtems/message/val/ident.yml @@ -0,0 +1,49 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident.h +target: testsuites/validation/tc-message-ident.c +actions: +- action: | + ${../../ident:/test-run}( + id_local_object, + ClassicMessageIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API message queue + class objects defined by ${../../ident}. + links: [] +brief: Test the ${/if/rtems/message/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Message Ident +prologue: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_message_queue_create( + ClassicObjectIdentName, + 1, + 1, + RTEMS_DEFAULT_ATTRIBUTES, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicMessageIdentAction( + rtems_name name, + uint32_t node, + rtems_id *id + ) + { + return rtems_message_queue_ident( name, node, id ); + } +type: test-case diff --git a/spec/req/rtems/part/ident.yml b/spec/req/rtems/part/ident.yml new file mode 100644 index 00000000..671b73be --- /dev/null +++ b/spec/req/rtems/part/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/part/ident +requirement-type: functional +text: | + The ${/if/rtems/part/ident:/name} directive shall identify an Classic API + partition class object by its name as specified by ${../ident}. +type: requirement diff --git a/spec/req/rtems/part/val/ident.yml b/spec/req/rtems/part/val/ident.yml new file mode 100644 index 00000000..51aba7cc --- /dev/null +++ b/spec/req/rtems/part/val/ident.yml @@ -0,0 +1,51 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident.h +target: testsuites/validation/tc-part-ident.c +actions: +- action: | + ${../../ident:/test-run}( + id_local_object, + ClassicPartIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API partition class + objects defined by ${../../ident}. + links: [] +brief: Test the ${/if/rtems/part/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Part Ident +prologue: | + static long area[32]; + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_partition_create( + ClassicObjectIdentName, + area, + sizeof( area ), + sizeof( area ), + RTEMS_DEFAULT_ATTRIBUTES, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicPartIdentAction( + rtems_name name, + uint32_t node, + rtems_id *id + ) + { + return rtems_partition_ident( name, node, id ); + } +type: test-case diff --git a/spec/req/rtems/ratemon/ident.yml b/spec/req/rtems/ratemon/ident.yml new file mode 100644 index 00000000..b31ced60 --- /dev/null +++ b/spec/req/rtems/ratemon/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/ratemon/ident +requirement-type: functional +text: | + The ${/if/rtems/ratemon/ident:/name} directive shall identify an Classic API + rate monotonic class object by its name as specified by ${../ident-local}. +type: requirement diff --git a/spec/req/rtems/ratemon/val/ident.yml b/spec/req/rtems/ratemon/val/ident.yml new file mode 100644 index 00000000..7561c8c4 --- /dev/null +++ b/spec/req/rtems/ratemon/val/ident.yml @@ -0,0 +1,45 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident-local.h +target: testsuites/validation/tc-ratemon-ident.c +actions: +- action: | + ${../../ident-local:/test-run}( + id_local_object, + ClassicRatemonIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API rate monotonic + class objects defined by ${../../ident-local}. + links: [] +brief: Test the ${/if/rtems/part/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Ratemon Ident +prologue: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_rate_monotonic_create( + ClassicObjectLocalIdentName, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicRatemonIdentAction( + rtems_name name, + rtems_id *id + ) + { + return rtems_rate_monotonic_ident( name, id ); + } +type: test-case diff --git a/spec/req/rtems/sem/ident.yml b/spec/req/rtems/sem/ident.yml new file mode 100644 index 00000000..6af7fcea --- /dev/null +++ b/spec/req/rtems/sem/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/sem/ident +requirement-type: functional +text: | + The ${/if/rtems/sem/ident:/name} directive shall identify an Classic API + semaphore class object by its name as specified by ${../ident}. +type: requirement diff --git a/spec/req/rtems/sem/val/ident.yml b/spec/req/rtems/sem/val/ident.yml new file mode 100644 index 00000000..b97d470b --- /dev/null +++ b/spec/req/rtems/sem/val/ident.yml @@ -0,0 +1,49 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident.h +target: testsuites/validation/tc-sem-ident.c +actions: +- action: | + ${../../ident:/test-run}( + id_local_object, + ClassicSemIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API semaphore class + objects defined by ${../../ident}. + links: [] +brief: Test the ${/if/rtems/sem/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Sem Ident +prologue: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_semaphore_create( + ClassicObjectIdentName, + 0, + RTEMS_DEFAULT_ATTRIBUTES, + 0, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicSemIdentAction( + rtems_name name, + uint32_t node, + rtems_id *id + ) + { + return rtems_semaphore_ident( name, node, id ); + } +type: test-case diff --git a/spec/req/rtems/tasks/ident.yml b/spec/req/rtems/tasks/ident.yml new file mode 100644 index 00000000..0a8171df --- /dev/null +++ b/spec/req/rtems/tasks/ident.yml @@ -0,0 +1,120 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: action +links: +- role: interface-function + uid: /if/rtems/tasks/ident +post-conditions: +- name: Post + states: + - name: OkAndSelfId + test-code: | + T_rsc(ctx->status, RTEMS_SUCCESSFUL); + T_eq_ptr(ctx->id, &ctx->id_value); + T_eq_u32(ctx->id_value, rtems_task_self()); + text: | + The status shall be RTEMS_SUCCESSFUL. The value of the object identifier + referenced by the id parameter shall be the identifier of the executing + thread. + - name: Generic + test-code: | + /* Checks performed by ${../ident:/test-run}() */ + text: | + The post-condition status shall be specified by ${../ident}. + test-epilogue: null + test-prologue: null +pre-conditions: +- name: Pre + states: + - name: Self + test-code: | + ctx->id_value = 0xffffffff; + ctx->id = &ctx->id_value; + text: | + The name parameter shall be RTEMS_SELF. + - name: Generic + test-code: | + ctx->id = NULL; + /* Preparation performed by ${../ident:/test-run}() */ + text: | + The pre-condition status shall be specified by ${../ident}. + test-epilogue: null + test-prologue: null +requirement-type: functional +test-action: | + if ( ctx->id != NULL ) { + ctx->status = rtems_task_ident( RTEMS_SELF, 0xdeadbeef, ctx->id ); + } else { + ${../ident:/test-run}( + ctx->id_local_object, + ClassicTaskIdentAction + ); + } +test-brief: null +test-context: +- brief: null + description: null + member: rtems_status_code status +- brief: null + description: null + member: rtems_id *id +- brief: null + description: null + member: rtems_id id_value +- brief: null + description: null + member: rtems_id id_local_object +test-description: null +test-header: null +test-includes: [] +test-local-includes: +- support-object-ident.h +test-name: Classic Task Ident +test-setup: + brief: null + code: | + static char task_storage[ RTEMS_MINIMUM_STACK_SIZE ]; + static const rtems_task_config task_config = { + .name = ClassicObjectIdentName, + .initial_priority = 1, + .stack_area = task_storage, + .stack_size = sizeof( task_storage ), + .initial_modes = RTEMS_DEFAULT_MODES, + .attribute_set = RTEMS_DEFAULT_ATTRIBUTES + }; + rtems_status_code sc; + + sc = rtems_task_build( &task_config, &ctx->id_local_object ); + T_assert_rsc_success( sc ); + description: null +test-stop: null +test-support: | + static rtems_status_code ClassicTaskIdentAction( + rtems_name name, + uint32_t node, + rtems_id *id + ) + { + return rtems_task_ident( name, node, id ); + } +test-target: testsuites/validation/tc-task-ident.c +test-teardown: null +transition-map: +- enabled-by: true + post-conditions: + Post: OkAndSelfId + pre-conditions: + Pre: + - Self +- enabled-by: true + post-conditions: + Post: Generic + pre-conditions: + Pre: + - Generic +rationale: null +references: [] +text: ${.:text-template} +type: requirement diff --git a/spec/req/rtems/timer/ident.yml b/spec/req/rtems/timer/ident.yml new file mode 100644 index 00000000..ad36228c --- /dev/null +++ b/spec/req/rtems/timer/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/timer/ident +requirement-type: functional +text: | + The ${/if/rtems/timer/ident:/name} directive shall identify an Classic API + timer class object by its name as specified by ${../ident-local}. +type: requirement diff --git a/spec/req/rtems/timer/val/ident.yml b/spec/req/rtems/timer/val/ident.yml new file mode 100644 index 00000000..3dee2ec5 --- /dev/null +++ b/spec/req/rtems/timer/val/ident.yml @@ -0,0 +1,45 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident-local.h +target: testsuites/validation/tc-timer-ident.c +actions: +- action: | + ${../../ident-local:/test-run}( + id_local_object, + ClassicTimerIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API timer class + objects defined by ${../../ident-local}. + links: [] +brief: Test the ${/if/rtems/timer/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic Timer Ident +prologue: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_timer_create( + ClassicObjectLocalIdentName, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicTimerIdentAction( + rtems_name name, + rtems_id *id + ) + { + return rtems_timer_ident( name, id ); + } +type: test-case diff --git a/spec/req/rtems/userext/ident.yml b/spec/req/rtems/userext/ident.yml new file mode 100644 index 00000000..89e2ddd2 --- /dev/null +++ b/spec/req/rtems/userext/ident.yml @@ -0,0 +1,13 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +functional-type: function +links: +- role: interface-function + uid: /if/rtems/userext/ident +requirement-type: functional +text: | + The ${/if/rtems/userext/ident:/name} directive shall identify an Classic API + user extension class object by its name as specified by ${../ident-local}. +type: requirement diff --git a/spec/req/rtems/userext/val/ident.yml b/spec/req/rtems/userext/val/ident.yml new file mode 100644 index 00000000..d98298df --- /dev/null +++ b/spec/req/rtems/userext/val/ident.yml @@ -0,0 +1,47 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +includes: [] +links: +- role: validation + uid: ../ident +local-includes: +- support-object-ident-local.h +target: testsuites/validation/tc-userext-ident.c +actions: +- action: | + ${../../ident-local:/test-run}( + id_local_object, + ClassicUserExtIdentAction + ); + checks: [] + description: | + Run the generic object identification tests for Classic API user extension + class objects defined by ${../../ident-local}. + links: [] +brief: Test the ${/if/rtems/userext/ident:/name} directive. +description: null +epilogue: null +fixture: null +name: Classic UserExt Ident +prologue: | + static const rtems_extensions_table table; + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_extension_create( + ClassicObjectLocalIdentName, + &table, + &id_local_object + ); + T_assert_rsc_success( sc ); +support: | + static rtems_status_code ClassicUserExtIdentAction( + rtems_name name, + rtems_id *id + ) + { + return rtems_extension_ident( name, id ); + } +type: test-case -- cgit v1.2.3