[rtems-central commit] spec: Specify rtems_build_name() function

Sebastian Huber sebh at rtems.org
Fri Nov 19 07:51:57 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 18 09:38:03 2021 +0100

spec: Specify rtems_build_name() function

---

 spec/rtems/object/req/build-name.yml | 15 +++++++++++++++
 spec/rtems/object/val/object.yml     | 31 ++++++++++++++++++++++++++++---
 2 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/spec/rtems/object/req/build-name.yml b/spec/rtems/object/req/build-name.yml
new file mode 100644
index 0000000..ab91d6a
--- /dev/null
+++ b/spec/rtems/object/req/build-name.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: interface-function
+  uid: ../if/build-name
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/build-name:/name} directive is called, the directive shall
+  return the return value of a call to ${../if/build-name-macro:/name}.
+type: requirement
diff --git a/spec/rtems/object/val/object.yml b/spec/rtems/object/val/object.yml
index a9e3dd6..4fcfed6 100644
--- a/spec/rtems/object/val/object.yml
+++ b/spec/rtems/object/val/object.yml
@@ -5,7 +5,8 @@ enabled-by: true
 links: []
 test-actions:
 - action-brief: |
-    Validate the results of rtems_build_name() for a sample set of parameters.
+    Validate the results of ${../if/build-name:/name} (function) and
+    ${../if/build-name-macro:/name} (macro) for a sample set of parameters.
   action-code: |
     static const uint16_t chars[] = { 0, 255, 257 };
     rtems_name            accumulated_name;
@@ -52,13 +53,22 @@ test-actions:
             T_quiet_eq_u32( actual_name, expected_name )
             accumulated_name += actual_name;
 
-            actual_name = rtems_build_name(
+            actual_name = BuildName(
               chars[ i ],
               chars[ j ],
               chars[ k ],
               chars[ r ]
             );
             T_quiet_eq_u32( actual_name, expected_name );
+
+            actual_name = BuildNameMacro(
+              chars[ i ],
+              chars[ j ],
+              chars[ k ],
+              chars[ r ]
+            );
+            T_quiet_eq_u32( actual_name, expected_name );
+
             accumulated_name += actual_name;
           }
         }
@@ -71,9 +81,13 @@ test-actions:
       T_step_eq_u32( ${step}, accumulated_name, 0x51515100 );
     links:
     - role: validation
+      uid: ../req/build-name
+    - role: validation
       uid: ../req/build-name-macro
   links:
   - role: validation
+    uid: ../req/build-name
+  - role: validation
     uid: ../req/build-name-macro
 - action-brief: |
     Validate the result of ${../if/get-local-node:/name}.
@@ -101,7 +115,18 @@ test-includes:
 test-local-includes: []
 test-setup: null
 test-stop: null
-test-support: null
+test-support: |
+  static rtems_name BuildNameMacro( char c1, char c2, char c3, char c4 )
+  {
+    return rtems_build_name( c1, c2, c3, c4 );
+  }
+
+  #undef rtems_build_name
+
+  static rtems_name BuildName( char c1, char c2, char c3, char c4 )
+  {
+    return rtems_build_name( c1, c2, c3, c4 );
+  }
 test-target: testsuites/validation/tc-object.c
 test-teardown: null
 type: test-case



More information about the vc mailing list