[rtems-central commit] spec: Improve user extension specification
Sebastian Huber
sebh at rtems.org
Fri Aug 6 12:21:44 UTC 2021
Module: rtems-central
Branch: master
Commit: d03280cce4ec926505925882c4ad28185533dbbe
Changeset: http://git.rtems.org/rtems-central/commit/?id=d03280cce4ec926505925882c4ad28185533dbbe
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Aug 4 08:51:17 2021 +0200
spec: Improve user extension specification
---
spec/rtems/userext/req/fatal-iterate-remove.yml | 16 +++++++
spec/rtems/userext/req/fatal-order.yml | 15 +++++++
spec/score/interr/req/terminate-userext.yml | 6 +--
spec/score/interr/val/terminate.yml | 55 ++++++++++++++++++++-----
4 files changed, 79 insertions(+), 13 deletions(-)
diff --git a/spec/rtems/userext/req/fatal-iterate-remove.yml b/spec/rtems/userext/req/fatal-iterate-remove.yml
new file mode 100644
index 0000000..0621a82
--- /dev/null
+++ b/spec/rtems/userext/req/fatal-iterate-remove.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: requirement-refinement
+ uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+ While the ${/glossary/userextensions:/term} are iterated to invoke the fatal
+ extensions, when an extension set is removed, the removed extension set shall
+ not be a next extension set for any iteration in progress after the removal.
+type: requirement
diff --git a/spec/rtems/userext/req/fatal-order.yml b/spec/rtems/userext/req/fatal-order.yml
new file mode 100644
index 0000000..caf3fd3
--- /dev/null
+++ b/spec/rtems/userext/req/fatal-order.yml
@@ -0,0 +1,15 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: requirement-refinement
+ uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+ The fatal ${/glossary/userextensions:/term} shall be invoked in
+ ${/glossary/extension-forward-order:/term}.
+type: requirement
diff --git a/spec/score/interr/req/terminate-userext.yml b/spec/score/interr/req/terminate-userext.yml
index ba880d1..c4392be 100644
--- a/spec/score/interr/req/terminate-userext.yml
+++ b/spec/score/interr/req/terminate-userext.yml
@@ -10,7 +10,7 @@ rationale: null
references: []
requirement-type: functional
text: |
- When ${../if/terminate:/name} is called, the fatal extensions shall be
- invoked in ${/glossary/extension-forward-order:/term} with the fatal source
- and fatal code specified by the respective parameter.
+ When ${../if/terminate:/name} is called, the fatal
+ ${/glossary/userextensions:/term} shall be invoked with the fatal source and
+ fatal code specified by the respective parameter.
type: requirement
diff --git a/spec/score/interr/val/terminate.yml b/spec/score/interr/val/terminate.yml
index 9aa2a2b..4cb9465 100644
--- a/spec/score/interr/val/terminate.yml
+++ b/spec/score/interr/val/terminate.yml
@@ -5,8 +5,9 @@ enabled-by: true
links: []
test-actions:
- action-brief: |
- Create two dynamic extensions. Call the system termination procedure.
- Delete the two dynamic extensions.
+ Create three dynamic extensions. Call the system termination procedure.
+ Delete one dynamic extension during the fatal extension invocation. Delete
+ the two remaining dynamic extensions.
action-code: |
rtems_status_code sc;
rtems_extensions_table table;
@@ -38,6 +39,14 @@ test-actions:
);
T_step_rsc_success( ${step}, sc );
+ table.fatal = FatalExtension4;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '4' ),
+ &table,
+ &extension_id_4
+ );
+ T_step_rsc_success( ${step}, sc );
+
test_case_active = true;
if ( setjmp( before_terminate ) == 0 ) {
@@ -53,8 +62,7 @@ test-actions:
T_step_rsc_success( ${step}, sc );
checks:
- brief: |
- Check that the fatal user extensions were called with the expected
- source.
+ Check that the fatal extensions were invoked with the expected source.
code: |
T_step_eq_int(
${step},
@@ -80,8 +88,8 @@ test-actions:
- role: validation
uid: ../req/terminate-userext
- brief: |
- Check that the fatal user extensions were called with the expected always
- set to false argument.
+ Check that the fatal extensions were invoked with the expected always set
+ to false argument.
code: |
T_step_false( ${step}, info[ 0 ].always_set_to_false );
T_step_false( ${step}, info[ 1 ].always_set_to_false );
@@ -91,7 +99,7 @@ test-actions:
- role: validation
uid: ../req/terminate-userext
- brief: |
- Check that the fatal user extensions were called with the expected code.
+ Check that the fatal extensions were invoked with the expected code.
code: |
T_step_eq_ulong( ${step}, info[ 0 ].code, 123456 );
T_step_eq_ulong( ${step}, info[ 1 ].code, 123456 );
@@ -101,7 +109,7 @@ test-actions:
- role: validation
uid: ../req/terminate-userext
- brief: |
- Check that the fatal user extensions were called in forward order.
+ Check that the fatal extensions were invoked in forward order.
code: |
T_step_eq_uint( ${step}, info[ 0 ].counter, 1 );
T_step_eq_uint( ${step}, info[ 1 ].counter, 2 );
@@ -109,7 +117,18 @@ test-actions:
T_step_eq_uint( ${step}, info[ 3 ].counter, 4 );
links:
- role: validation
- uid: ../req/terminate-userext
+ uid: /rtems/userext/req/fatal-order
+ - brief: |
+ Check that the fatal extension in the deleted extension set was not
+ invoked.
+ code: |
+ T_step_eq_int( ${step}, info[ 4 ].source, 0 );
+ T_step_false( ${step}, info[ 4 ].always_set_to_false );
+ T_step_eq_ulong( ${step}, info[ 4 ].code, 0 );
+ T_step_eq_uint( ${step}, info[ 4 ].counter, 0 );
+ links:
+ - role: validation
+ uid: /rtems/userext/req/fatal-iterate-remove
- brief: |
Check that the system state is terminated.
code: |
@@ -187,7 +206,7 @@ test-support: |
static Atomic_Uint counter;
- static FatalInfo info[ 4 ];
+ static FatalInfo info[ 5 ];
static bool test_case_active;
@@ -201,6 +220,8 @@ test-support: |
static rtems_fatal_code halt_code;
+ static rtems_id extension_id_4;
+
static unsigned int GetCounter( void )
{
return _Atomic_Fetch_add_uint( &counter, 1, ATOMIC_ORDER_RELAXED ) + 1;
@@ -272,6 +293,20 @@ test-support: |
rtems_fatal_code code
)
{
+ rtems_status_code sc;
+
+ FatalExtension( source, always_set_to_false, code, 3 );
+
+ sc = rtems_extension_delete( extension_id_4 );
+ T_quiet_rsc_success( sc );
+ }
+
+ static void FatalExtension4(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+ )
+ {
FatalExtension( source, always_set_to_false, code, 3 );
}
test-target: testsuites/validation/tc-terminate.c
More information about the vc
mailing list