[rtems-central commit] spec: timer_initiate_server test more independent

Sebastian Huber sebh at rtems.org
Mon May 17 06:10:56 UTC 2021


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

Author:    Frank Kühndel <frank.kuehndel at embedded-brains.de>
Date:      Thu Apr 22 15:40:45 2021 +0200

spec: timer_initiate_server test more independent

Factoring out the direct use of _Timer_server. The access to RTEMS
internals should be bundled in one place and not spread over many
files in the validation tests.

---

 spec/rtems/timer/req/initiate-server.yml | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/spec/rtems/timer/req/initiate-server.yml b/spec/rtems/timer/req/initiate-server.yml
index 5fc4c4c..9fe48ed 100644
--- a/spec/rtems/timer/req/initiate-server.yml
+++ b/spec/rtems/timer/req/initiate-server.yml
@@ -298,19 +298,21 @@ test-stop: null
 test-support: |
   static bool ExistTimerServer( void )
   {
-    return _Timer_server != NULL;
+    return GetTimerServerTaskId() != RTEMS_INVALID_ID;
   }
 
   static rtems_task_priority GetTimerServerPriority( void )
   {
-    return GetPriority( _Timer_server->server_id );
+    return GetPriority( GetTimerServerTaskId() );
   }
 
   static size_t GetTimerServerStackSize( void )
   {
     rtems_tcb *tcb;
-    T_true( ExistTimerServer() );
-    tcb = GetThread( _Timer_server->server_id );
+    rtems_id server_task_id;
+    server_task_id = GetTimerServerTaskId();
+    T_ne_u32( server_task_id, RTEMS_INVALID_ID );
+    tcb = GetThread( server_task_id );
     T_not_null( tcb );
     return tcb->Start.Initial_stack.size;
   }
@@ -318,8 +320,10 @@ test-support: |
   static bool HasTimerServerFloatingPoint( void )
   {
     rtems_tcb *tcb;
-    T_true( ExistTimerServer() );
-    tcb = GetThread( _Timer_server->server_id );
+    rtems_id server_task_id;
+    server_task_id = GetTimerServerTaskId();
+    T_ne_u32( server_task_id, RTEMS_INVALID_ID );
+    tcb = GetThread( server_task_id );
     T_not_null( tcb );
     return tcb->is_fp;
   }



More information about the vc mailing list