[rtems-central commit] spec: Specify support directives

Sebastian Huber sebh at rtems.org
Mon Jul 26 13:21:25 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    d77baf885470c0fe79d7c0ee8d12dbae60318eca
Changeset: http://git.rtems.org/rtems-central/commit/?id=d77baf885470c0fe79d7c0ee8d12dbae60318eca

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jul 26 14:40:26 2021 +0200

spec: Specify support directives

---

 spec/rtems/support/req/is-name-valid.yml        | 90 +++++++++++++++++++++++++
 spec/rtems/support/req/name-to-characters-1.yml | 17 +++++
 spec/rtems/support/req/name-to-characters-2.yml | 17 +++++
 spec/rtems/support/req/name-to-characters-3.yml | 17 +++++
 spec/rtems/support/req/name-to-characters-4.yml | 16 +++++
 spec/rtems/support/val/support.yml              | 61 +++++++++++++++++
 6 files changed, 218 insertions(+)

diff --git a/spec/rtems/support/req/is-name-valid.yml b/spec/rtems/support/req/is-name-valid.yml
new file mode 100644
index 0000000..866b92d
--- /dev/null
+++ b/spec/rtems/support/req/is-name-valid.yml
@@ -0,0 +1,90 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+functional-type: action
+links:
+- role: interface-function
+  uid: ../if/is-name-valid
+post-conditions:
+- name: Result
+  states:
+  - name: 'True'
+    test-code: |
+      T_true( ctx->result );
+    text: |
+      The return value of ${../if/is-name-valid:/name} shall be
+      ${/c/if/true:/name}.
+  - name: 'False'
+    test-code: |
+      T_false( ctx->result );
+    text: |
+      The return value of ${../if/is-name-valid:/name} shall be
+      ${/c/if/false:/name}.
+  test-epilogue: null
+  test-prologue: null
+pre-conditions:
+- name: Name
+  states:
+  - name: Valid
+    test-code: |
+      ctx->name = 1;
+    text: |
+      While the ${../if/is-name-valid:/params[0]/name} parameter is not equal
+      to zero.
+  - name: Invalid
+    test-code: |
+      ctx->name = 0;
+    text: |
+      While the ${../if/is-name-valid:/params[0]/name} parameter is
+      equal to zero.
+  test-epilogue: null
+  test-prologue: null
+rationale: null
+references: []
+requirement-type: functional
+skip-reasons: {}
+test-action: |
+  ctx->result = rtems_is_name_valid( ctx->name );
+test-brief: null
+test-cleanup: null
+test-context:
+- brief: |
+    This member contains the return value of the ${../if/is-name-valid:/name}
+    call.
+  description: null
+  member: |
+    bool result
+- brief: |
+    This member specifies if the ${../if/is-name-valid:/params[0]/name}
+    parameter value.
+  description: null
+  member: |
+    rtems_name name
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes: []
+test-prepare: null
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-support-is-name-valid.c
+test-teardown: null
+text: ${.:text-template}
+transition-map:
+- enabled-by: true
+  post-conditions:
+    Result: 'True'
+  pre-conditions:
+    Name:
+    - Valid
+- enabled-by: true
+  post-conditions:
+    Result: 'False'
+  pre-conditions:
+    Name:
+    - Invalid
+type: requirement
diff --git a/spec/rtems/support/req/name-to-characters-1.yml b/spec/rtems/support/req/name-to-characters-1.yml
new file mode 100644
index 0000000..ad50304
--- /dev/null
+++ b/spec/rtems/support/req/name-to-characters-1.yml
@@ -0,0 +1,17 @@
+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: interface-function
+  uid: ../if/name-to-characters
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the call to ${../if/name-to-characters:/name} returned, the object
+  referenced by the ${../if/name-to-characters:/params[1]/name} parameter shall
+  be set the value of ${../if/name-to-characters:/params[0]/name} divided by
+  16777216 modulo 256.
+type: requirement
diff --git a/spec/rtems/support/req/name-to-characters-2.yml b/spec/rtems/support/req/name-to-characters-2.yml
new file mode 100644
index 0000000..b16ac04
--- /dev/null
+++ b/spec/rtems/support/req/name-to-characters-2.yml
@@ -0,0 +1,17 @@
+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: interface-function
+  uid: ../if/name-to-characters
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the call to ${../if/name-to-characters:/name} returned, the object
+  referenced by the ${../if/name-to-characters:/params[2]/name} parameter shall
+  be set the value of ${../if/name-to-characters:/params[0]/name} divided by
+  65536 modulo 256.
+type: requirement
diff --git a/spec/rtems/support/req/name-to-characters-3.yml b/spec/rtems/support/req/name-to-characters-3.yml
new file mode 100644
index 0000000..2b16171
--- /dev/null
+++ b/spec/rtems/support/req/name-to-characters-3.yml
@@ -0,0 +1,17 @@
+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: interface-function
+  uid: ../if/name-to-characters
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the call to ${../if/name-to-characters:/name} returned, the object
+  referenced by the ${../if/name-to-characters:/params[3]/name} parameter shall
+  be set the value of ${../if/name-to-characters:/params[0]/name} divided by
+  256 modulo 256.
+type: requirement
diff --git a/spec/rtems/support/req/name-to-characters-4.yml b/spec/rtems/support/req/name-to-characters-4.yml
new file mode 100644
index 0000000..e112da5
--- /dev/null
+++ b/spec/rtems/support/req/name-to-characters-4.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: interface-function
+  uid: ../if/name-to-characters
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the call to ${../if/name-to-characters:/name} returned, the object
+  referenced by the ${../if/name-to-characters:/params[4]/name} parameter shall
+  be set the value of ${../if/name-to-characters:/params[0]/name} modulo 256.
+type: requirement
diff --git a/spec/rtems/support/val/support.yml b/spec/rtems/support/val/support.yml
new file mode 100644
index 0000000..c84f6df
--- /dev/null
+++ b/spec/rtems/support/val/support.yml
@@ -0,0 +1,61 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links: []
+test-actions:
+- action-brief: |
+    Validates the characters returned by the ${../if/name-to-characters:/name}
+    directive.
+  action-code: |
+    char c1;
+    char c2;
+    char c3;
+    char c4;
+
+    rtems_name_to_characters( 0x01020304, &c1, &c2, &c3, &c4 );
+  checks:
+  - brief: |
+      Check that the first character is equal to 0x01.
+    code: |
+      T_step_eq_char( ${step}, c1, 0x01 );
+    links:
+    - role: validation
+      uid: ../req/name-to-characters-1
+  - brief: |
+      Check that the second character is equal to 0x02.
+    code: |
+      T_step_eq_char( ${step}, c2, 0x02 );
+    links:
+    - role: validation
+      uid: ../req/name-to-characters-2
+  - brief: |
+      Check that the third character is equal to 0x03.
+    code: |
+      T_step_eq_char( ${step}, c3, 0x03 );
+    links:
+    - role: validation
+      uid: ../req/name-to-characters-3
+  - brief: |
+      Check that the fourth character is equal to 0x04.
+    code: |
+      T_step_eq_char( ${step}, c4, 0x04 );
+    links:
+    - role: validation
+      uid: ../req/name-to-characters-4
+  links: []
+test-brief: |
+  Tests some ${../if/group:/name} directives.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes: []
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-support.c
+test-teardown: null
+type: test-case



More information about the vc mailing list