[rtems-central commit] spec: Use individual names for ident tests

Sebastian Huber sebh at rtems.org
Wed Mar 30 06:55:49 UTC 2022


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 29 16:33:39 2022 +0200

spec: Use individual names for ident tests

---

 spec/rtems/barrier/val/ident.yml |  5 ++++-
 spec/rtems/message/val/ident.yml |  5 ++++-
 spec/rtems/part/val/ident.yml    |  5 ++++-
 spec/rtems/ratemon/val/ident.yml |  5 ++++-
 spec/rtems/req/ident-local.yml   | 14 ++++++++------
 spec/rtems/req/ident.yml         | 14 ++++++++------
 spec/rtems/sem/val/ident.yml     |  5 ++++-
 spec/rtems/task/req/ident.yml    | 27 +++------------------------
 spec/rtems/timer/val/ident.yml   |  5 ++++-
 spec/rtems/userext/val/ident.yml |  5 ++++-
 10 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/spec/rtems/barrier/val/ident.yml b/spec/rtems/barrier/val/ident.yml
index df4359c..c8a4ea1 100644
--- a/spec/rtems/barrier/val/ident.yml
+++ b/spec/rtems/barrier/val/ident.yml
@@ -14,7 +14,7 @@ test-actions:
     rtems_id          id_local_object;
 
     sc = rtems_barrier_create(
-      ClassicObjectLocalIdentName,
+      NAME_LOCAL_OBJECT,
       RTEMS_DEFAULT_ATTRIBUTES,
       1,
       &id_local_object
@@ -23,6 +23,7 @@ test-actions:
 
     ${../../req/ident-local:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicBarrierIdentAction
     );
 
@@ -41,6 +42,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'B', 'A', 'R', 'R' )
+
   static rtems_status_code ClassicBarrierIdentAction(
     rtems_name name,
     rtems_id  *id
diff --git a/spec/rtems/message/val/ident.yml b/spec/rtems/message/val/ident.yml
index a4ca45c..0495aad 100644
--- a/spec/rtems/message/val/ident.yml
+++ b/spec/rtems/message/val/ident.yml
@@ -21,6 +21,7 @@ test-actions:
 
     ${../../req/ident:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicMessageIdentAction
     );
 
@@ -39,10 +40,12 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'M', 'E', 'S', 'Q' )
+
   static RTEMS_MESSAGE_QUEUE_BUFFER( 1 ) ClassicMessageIdentBuffers[ 1 ];
 
   static rtems_message_queue_config ClassicObjectIdentConfig = {
-    .name = ClassicObjectIdentName,
+    .name = NAME_LOCAL_OBJECT,
     .maximum_pending_messages = RTEMS_ARRAY_SIZE( ClassicMessageIdentBuffers ),
     .maximum_message_size = 1,
     .storage_area = ClassicMessageIdentBuffers,
diff --git a/spec/rtems/part/val/ident.yml b/spec/rtems/part/val/ident.yml
index 1762872..cc4a7ba 100644
--- a/spec/rtems/part/val/ident.yml
+++ b/spec/rtems/part/val/ident.yml
@@ -15,7 +15,7 @@ test-actions:
     rtems_id                                               id_local_object;
 
     sc = rtems_partition_create(
-      ClassicObjectIdentName,
+      NAME_LOCAL_OBJECT,
       area,
       sizeof( area ),
       sizeof( area ),
@@ -26,6 +26,7 @@ test-actions:
 
     ${../../req/ident:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicPartIdentAction
     );
 
@@ -44,6 +45,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'P', 'A', 'R', 'T' )
+
   static rtems_status_code ClassicPartIdentAction(
     rtems_name name,
     uint32_t   node,
diff --git a/spec/rtems/ratemon/val/ident.yml b/spec/rtems/ratemon/val/ident.yml
index 223adb7..d15a38d 100644
--- a/spec/rtems/ratemon/val/ident.yml
+++ b/spec/rtems/ratemon/val/ident.yml
@@ -14,13 +14,14 @@ test-actions:
     rtems_id          id_local_object;
 
     sc = rtems_rate_monotonic_create(
-      ClassicObjectLocalIdentName,
+      NAME_LOCAL_OBJECT,
       &id_local_object
     );
     T_assert_rsc_success( sc );
 
     ${../../req/ident-local:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicRatemonIdentAction
     );
 
@@ -39,6 +40,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'R', 'A', 'T', 'E' )
+
   static rtems_status_code ClassicRatemonIdentAction(
     rtems_name name,
     rtems_id  *id
diff --git a/spec/rtems/req/ident-local.yml b/spec/rtems/req/ident-local.yml
index 13829dc..af3b682 100644
--- a/spec/rtems/req/ident-local.yml
+++ b/spec/rtems/req/ident-local.yml
@@ -63,7 +63,7 @@ pre-conditions:
       the specified class .
   - name: Valid
     test-code: |
-      ctx->name = ClassicObjectLocalIdentName;
+      ctx->name = ctx->name_local_object;
     text: |
       While the ``name`` parameter is associated with an active object of the
       specified class .
@@ -109,21 +109,23 @@ test-context:
 test-context-support: null
 test-description: null
 test-header:
-  code: |
-    #define ClassicObjectLocalIdentName \
-      rtems_build_name( 'I', 'D', 'N', 'T' )
+  code: null
   freestanding: false
   includes:
   - rtems.h
   local-includes: []
   run-params:
   - description: |
-      is the identifier of an active object of the class under test with the
-      name ClassicObjectLocalIdentName.
+      is the identifier of an active object of the class under test.
     dir: null
     name: id_local_object
     specifier: rtems_id ${.:name}
   - description: |
+      is the name of the active object of the class under test.
+    dir: null
+    name: name_local_object
+    specifier: rtems_name ${.:name}
+  - description: |
       is the action handler.
     dir: null
     name: action
diff --git a/spec/rtems/req/ident.yml b/spec/rtems/req/ident.yml
index c11f551..725e074 100644
--- a/spec/rtems/req/ident.yml
+++ b/spec/rtems/req/ident.yml
@@ -88,7 +88,7 @@ pre-conditions:
       the specified class .
   - name: Valid
     test-code: |
-      ctx->name = ClassicObjectIdentName;
+      ctx->name = ctx->name_local_object;
     text: |
       While the ``name`` parameter is associated with an active object of the
       specified class .
@@ -175,21 +175,23 @@ test-context:
 test-context-support: null
 test-description: null
 test-header:
-  code: |
-    #define ClassicObjectIdentName \
-      rtems_build_name( 'I', 'D', 'N', 'T' )
+  code: null
   freestanding: false
   includes:
   - rtems.h
   local-includes: []
   run-params:
   - description: |
-      is the identifier of an active object of the class under test with the
-      name ClassicObjectIdentName.
+      is the identifier of an active object of the class under test.
     dir: null
     name: id_local_object
     specifier: rtems_id ${.:name}
   - description: |
+      is the name of the active object of the class under test.
+    dir: null
+    name: name_local_object
+    specifier: rtems_name ${.:name}
+  - description: |
       is the action handler.
     dir: null
     name: action
diff --git a/spec/rtems/sem/val/ident.yml b/spec/rtems/sem/val/ident.yml
index ea67493..f995707 100644
--- a/spec/rtems/sem/val/ident.yml
+++ b/spec/rtems/sem/val/ident.yml
@@ -14,7 +14,7 @@ test-actions:
     rtems_id          id_local_object;
 
     sc = rtems_semaphore_create(
-      ClassicObjectIdentName,
+      NAME_LOCAL_OBJECT,
       0,
       RTEMS_DEFAULT_ATTRIBUTES,
       0,
@@ -24,6 +24,7 @@ test-actions:
 
     ${../../req/ident:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicSemIdentAction
     );
 
@@ -42,6 +43,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'S', 'E', 'M', 'A' )
+
   static rtems_status_code ClassicSemIdentAction(
     rtems_name name,
     uint32_t   node,
diff --git a/spec/rtems/task/req/ident.yml b/spec/rtems/task/req/ident.yml
index 17b2b52..ba81544 100644
--- a/spec/rtems/task/req/ident.yml
+++ b/spec/rtems/task/req/ident.yml
@@ -62,6 +62,7 @@ test-action: |
   } else {
     ${../../req/ident:/test-run}(
       ctx->id_local_object,
+      DefaultTaskConfig.name,
       ClassicTaskIdentAction
     );
   }
@@ -86,7 +87,7 @@ test-header: null
 test-includes: []
 test-local-includes:
 - tr-object-ident.h
-- ts-config.h
+- tx-support.h
 test-prepare: null
 test-setup:
   brief: null
@@ -94,7 +95,7 @@ test-setup:
     rtems_status_code sc;
 
     sc = rtems_task_construct(
-      &ClassicTaskIdentConfig,
+      &DefaultTaskConfig,
       &ctx->id_local_object
     );
     T_assert_rsc_success( sc );
@@ -109,28 +110,6 @@ test-support: |
   {
     return rtems_task_ident( name, node, id );
   }
-
-  #define TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
-
-  #define MAX_TLS_SIZE RTEMS_ALIGN_UP( 64, RTEMS_TASK_STORAGE_ALIGNMENT )
-
-  RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
-  static char ClassicTaskIdentStorage[
-    RTEMS_TASK_STORAGE_SIZE(
-      MAX_TLS_SIZE + TEST_MINIMUM_STACK_SIZE,
-      TASK_ATTRIBUTES
-    )
-  ];
-
-  static const rtems_task_config ClassicTaskIdentConfig = {
-    .name = ClassicObjectIdentName,
-    .initial_priority = 1,
-    .storage_area = ClassicTaskIdentStorage,
-    .storage_size = sizeof( ClassicTaskIdentStorage ),
-    .maximum_thread_local_storage_size = MAX_TLS_SIZE,
-    .initial_modes = RTEMS_DEFAULT_MODES,
-    .attributes = TASK_ATTRIBUTES
-  };
 test-target: testsuites/validation/tc-task-ident.c
 test-teardown:
   brief: null
diff --git a/spec/rtems/timer/val/ident.yml b/spec/rtems/timer/val/ident.yml
index ca16871..0190f7e 100644
--- a/spec/rtems/timer/val/ident.yml
+++ b/spec/rtems/timer/val/ident.yml
@@ -14,13 +14,14 @@ test-actions:
     rtems_id          id_local_object;
 
     sc = rtems_timer_create(
-      ClassicObjectLocalIdentName,
+      NAME_LOCAL_OBJECT,
       &id_local_object
     );
     T_assert_rsc_success( sc );
 
     ${../../req/ident-local:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicTimerIdentAction
     );
 
@@ -39,6 +40,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'T', 'I', 'M', 'R' )
+
   static rtems_status_code ClassicTimerIdentAction(
     rtems_name name,
     rtems_id  *id
diff --git a/spec/rtems/userext/val/ident.yml b/spec/rtems/userext/val/ident.yml
index 16f7497..beb1890 100644
--- a/spec/rtems/userext/val/ident.yml
+++ b/spec/rtems/userext/val/ident.yml
@@ -15,7 +15,7 @@ test-actions:
     rtems_id                            id_local_object;
 
     sc = rtems_extension_create(
-      ClassicObjectLocalIdentName,
+      NAME_LOCAL_OBJECT,
       &table,
       &id_local_object
     );
@@ -23,6 +23,7 @@ test-actions:
 
     ${../../req/ident-local:/test-run}(
       id_local_object,
+      NAME_LOCAL_OBJECT,
       ClassicUserExtIdentAction
     );
 
@@ -41,6 +42,8 @@ test-local-includes:
 test-setup: null
 test-stop: null
 test-support: |
+  #define NAME_LOCAL_OBJECT rtems_build_name( 'U', 'E', 'X', 'T' )
+
   static rtems_status_code ClassicUserExtIdentAction(
     rtems_name name,
     rtems_id  *id



More information about the vc mailing list