[rtems-central commit] spec: Improve RTEMS_DEFINE_GLOBAL_SYMBOL() tests

Sebastian Huber sebh at rtems.org
Mon Sep 18 08:31:35 UTC 2023


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Sep 18 08:51:03 2023 +0200

spec: Improve RTEMS_DEFINE_GLOBAL_SYMBOL() tests

Assign the symbol address to an object.  Check that it has the expected
value.

---

 spec/rtems/basedefs/val/basedefs.yml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/spec/rtems/basedefs/val/basedefs.yml b/spec/rtems/basedefs/val/basedefs.yml
index a0732956..b48d8301 100644
--- a/spec/rtems/basedefs/val/basedefs.yml
+++ b/spec/rtems/basedefs/val/basedefs.yml
@@ -1357,6 +1357,21 @@ test-actions:
     - role: validation
       uid: ../req/zero-length-array-0
   links: []
+- action-brief: |
+    Use the ${../if/define-global-symbol:/name} macro at the beginning of this
+    file and assign the address of the symbol to an object.
+  action-code: |
+    /* No action */
+  checks:
+  - brief: |
+      Check that the ${../if/define-global-symbol:/name} macro defines a global
+      symbol with the correct value.
+    code: |
+      T_step_eq_uptr( ${.:/step}, (uintptr_t) global_symbol_2_object, 0x123 );
+    links:
+    - role: validation
+      uid: ../req/define-global-symbol-1
+  links: []
 test-brief: |
   Tests the basedefs macros of the Classic API.
 test-context: []
@@ -1469,6 +1484,12 @@ test-support: |
     RTEMS_SYMBOL_NAME( global_symbol_base ) + GLOBAL_SYMBOL_VALULE( abc )
   );
 
+  RTEMS_DECLARE_GLOBAL_SYMBOL( global_symbol_2 );
+
+  RTEMS_DEFINE_GLOBAL_SYMBOL( global_symbol_2, 0x123 );
+
+  static const char * const volatile global_symbol_2_object = global_symbol_2;
+
   static int deprecated_func( int i ) RTEMS_DEPRECATED;
   static int deprecated_func( int i )
   {



More information about the vc mailing list