Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:53

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RtemsTimerReqServerFireAfter
0007  */
0008 
0009 /*
0010  * Copyright (C) 2021 embedded brains GmbH & Co. KG
0011  *
0012  * Redistribution and use in source and binary forms, with or without
0013  * modification, are permitted provided that the following conditions
0014  * are met:
0015  * 1. Redistributions of source code must retain the above copyright
0016  *    notice, this list of conditions and the following disclaimer.
0017  * 2. Redistributions in binary form must reproduce the above copyright
0018  *    notice, this list of conditions and the following disclaimer in the
0019  *    documentation and/or other materials provided with the distribution.
0020  *
0021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0024  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0025  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0026  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0027  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0030  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0031  * POSSIBILITY OF SUCH DAMAGE.
0032  */
0033 
0034 /*
0035  * This file is part of the RTEMS quality process and was automatically
0036  * generated.  If you find something that needs to be fixed or
0037  * worded better please post a report or patch to an RTEMS mailing list
0038  * or raise a bug report:
0039  *
0040  * https://www.rtems.org/bugs.html
0041  *
0042  * For information on updating and regenerating please refer to the How-To
0043  * section in the Software Requirements Engineering chapter of the
0044  * RTEMS Software Engineering manual.  The manual is provided as a part of
0045  * a release.  For development sources please refer to the online
0046  * documentation at:
0047  *
0048  * https://docs.rtems.org
0049  */
0050 
0051 #ifdef HAVE_CONFIG_H
0052 #include "config.h"
0053 #endif
0054 
0055 #include <rtems.h>
0056 
0057 #include "tx-support.h"
0058 
0059 #include <rtems/test.h>
0060 
0061 /**
0062  * @defgroup RtemsTimerReqServerFireAfter \
0063  *   spec:/rtems/timer/req/server-fire-after
0064  *
0065  * @ingroup TestsuitesValidationNoClock0
0066  *
0067  * @{
0068  */
0069 
0070 typedef enum {
0071   RtemsTimerReqServerFireAfter_Pre_Server_Init,
0072   RtemsTimerReqServerFireAfter_Pre_Server_NotInit,
0073   RtemsTimerReqServerFireAfter_Pre_Server_NA
0074 } RtemsTimerReqServerFireAfter_Pre_Server;
0075 
0076 typedef enum {
0077   RtemsTimerReqServerFireAfter_Pre_Ticks_Valid,
0078   RtemsTimerReqServerFireAfter_Pre_Ticks_Is0,
0079   RtemsTimerReqServerFireAfter_Pre_Ticks_NA
0080 } RtemsTimerReqServerFireAfter_Pre_Ticks;
0081 
0082 typedef enum {
0083   RtemsTimerReqServerFireAfter_Pre_Routine_Valid,
0084   RtemsTimerReqServerFireAfter_Pre_Routine_Null,
0085   RtemsTimerReqServerFireAfter_Pre_Routine_NA
0086 } RtemsTimerReqServerFireAfter_Pre_Routine;
0087 
0088 typedef enum {
0089   RtemsTimerReqServerFireAfter_Pre_Id_Valid,
0090   RtemsTimerReqServerFireAfter_Pre_Id_Invalid,
0091   RtemsTimerReqServerFireAfter_Pre_Id_NA
0092 } RtemsTimerReqServerFireAfter_Pre_Id;
0093 
0094 typedef enum {
0095   RtemsTimerReqServerFireAfter_Pre_Context_None,
0096   RtemsTimerReqServerFireAfter_Pre_Context_Interrupt,
0097   RtemsTimerReqServerFireAfter_Pre_Context_Server,
0098   RtemsTimerReqServerFireAfter_Pre_Context_NA
0099 } RtemsTimerReqServerFireAfter_Pre_Context;
0100 
0101 typedef enum {
0102   RtemsTimerReqServerFireAfter_Pre_Clock_None,
0103   RtemsTimerReqServerFireAfter_Pre_Clock_Ticks,
0104   RtemsTimerReqServerFireAfter_Pre_Clock_Realtime,
0105   RtemsTimerReqServerFireAfter_Pre_Clock_NA
0106 } RtemsTimerReqServerFireAfter_Pre_Clock;
0107 
0108 typedef enum {
0109   RtemsTimerReqServerFireAfter_Pre_State_Inactive,
0110   RtemsTimerReqServerFireAfter_Pre_State_Scheduled,
0111   RtemsTimerReqServerFireAfter_Pre_State_Pending,
0112   RtemsTimerReqServerFireAfter_Pre_State_NA
0113 } RtemsTimerReqServerFireAfter_Pre_State;
0114 
0115 typedef enum {
0116   RtemsTimerReqServerFireAfter_Post_Status_Ok,
0117   RtemsTimerReqServerFireAfter_Post_Status_InvId,
0118   RtemsTimerReqServerFireAfter_Post_Status_InvAddr,
0119   RtemsTimerReqServerFireAfter_Post_Status_InvNum,
0120   RtemsTimerReqServerFireAfter_Post_Status_IncStat,
0121   RtemsTimerReqServerFireAfter_Post_Status_NA
0122 } RtemsTimerReqServerFireAfter_Post_Status;
0123 
0124 typedef enum {
0125   RtemsTimerReqServerFireAfter_Post_Context_None,
0126   RtemsTimerReqServerFireAfter_Post_Context_Interrupt,
0127   RtemsTimerReqServerFireAfter_Post_Context_Server,
0128   RtemsTimerReqServerFireAfter_Post_Context_Nop,
0129   RtemsTimerReqServerFireAfter_Post_Context_NA
0130 } RtemsTimerReqServerFireAfter_Post_Context;
0131 
0132 typedef enum {
0133   RtemsTimerReqServerFireAfter_Post_Clock_None,
0134   RtemsTimerReqServerFireAfter_Post_Clock_Ticks,
0135   RtemsTimerReqServerFireAfter_Post_Clock_Realtime,
0136   RtemsTimerReqServerFireAfter_Post_Clock_Nop,
0137   RtemsTimerReqServerFireAfter_Post_Clock_NA
0138 } RtemsTimerReqServerFireAfter_Post_Clock;
0139 
0140 typedef enum {
0141   RtemsTimerReqServerFireAfter_Post_State_Scheduled,
0142   RtemsTimerReqServerFireAfter_Post_State_Nop,
0143   RtemsTimerReqServerFireAfter_Post_State_NA
0144 } RtemsTimerReqServerFireAfter_Post_State;
0145 
0146 typedef enum {
0147   RtemsTimerReqServerFireAfter_Post_Interval_Param,
0148   RtemsTimerReqServerFireAfter_Post_Interval_Nop,
0149   RtemsTimerReqServerFireAfter_Post_Interval_NA
0150 } RtemsTimerReqServerFireAfter_Post_Interval;
0151 
0152 typedef enum {
0153   RtemsTimerReqServerFireAfter_Post_Routine_Param,
0154   RtemsTimerReqServerFireAfter_Post_Routine_Nop,
0155   RtemsTimerReqServerFireAfter_Post_Routine_NA
0156 } RtemsTimerReqServerFireAfter_Post_Routine;
0157 
0158 typedef enum {
0159   RtemsTimerReqServerFireAfter_Post_UserData_Param,
0160   RtemsTimerReqServerFireAfter_Post_UserData_Nop,
0161   RtemsTimerReqServerFireAfter_Post_UserData_NA
0162 } RtemsTimerReqServerFireAfter_Post_UserData;
0163 
0164 typedef struct {
0165   uint32_t Skip : 1;
0166   uint32_t Pre_Server_NA : 1;
0167   uint32_t Pre_Ticks_NA : 1;
0168   uint32_t Pre_Routine_NA : 1;
0169   uint32_t Pre_Id_NA : 1;
0170   uint32_t Pre_Context_NA : 1;
0171   uint32_t Pre_Clock_NA : 1;
0172   uint32_t Pre_State_NA : 1;
0173   uint32_t Post_Status : 3;
0174   uint32_t Post_Context : 3;
0175   uint32_t Post_Clock : 3;
0176   uint32_t Post_State : 2;
0177   uint32_t Post_Interval : 2;
0178   uint32_t Post_Routine : 2;
0179   uint32_t Post_UserData : 2;
0180 } RtemsTimerReqServerFireAfter_Entry;
0181 
0182 typedef enum {
0183   PRE_NONE      = 0,
0184   PRE_INTERRUPT = 1,
0185   PRE_SERVER    = 2
0186 } PreConditionContext;
0187 
0188 typedef enum {
0189   SCHEDULE_NONE       = 0,
0190   SCHEDULE_VERY_SOON  = 1,
0191   SCHEDULE_SOON       = 2,
0192   SCHEDULE_LATER      = 3,
0193   SCHEDULE_MAX        = 5
0194 } Scheduling_Ticks;
0195 
0196 /**
0197  * @brief Test context for spec:/rtems/timer/req/server-fire-after test case.
0198  */
0199 typedef struct {
0200   /**
0201    * @brief This member contains a valid id of a timer.
0202    */
0203   rtems_id timer_id;
0204 
0205   /**
0206    * @brief This member contains a valid id of a second timer.
0207    *
0208    * This timer is used reach branch coverage in an if-statement which only
0209    * serves performance optimization.
0210    */
0211   rtems_id timer_cover_id;
0212 
0213   /**
0214    * @brief This member specifies the ``id`` parameter for the action.
0215    */
0216   rtems_id id_param;
0217 
0218   /**
0219    * @brief This member specifies the ``ticks`` parameter for the action.
0220    */
0221   rtems_interval ticks_param;
0222 
0223   /**
0224    * @brief This member specifies the ``routine`` parameter for the action.
0225    */
0226   rtems_timer_service_routine_entry routine_param;
0227 
0228   /**
0229    * @brief This member contains the returned status code of the action.
0230    */
0231   rtems_status_code status;
0232 
0233   /**
0234    * @brief This member contains a counter for invocations of the Timer Service
0235    *   Routine.
0236    */
0237   int invocations;
0238 
0239   /**
0240    * @brief Function TriggerTimer() is used to figure out how many ticks (see
0241    *   tick) are needed till the Timer Service Routine gets executed. This
0242    *   member contains the number of ticks needed to fire the Timer Service
0243    *   Routine.
0244    */
0245   Scheduling_Ticks ticks_till_fire;
0246 
0247   /**
0248    * @brief This member contains the user data given to the Timer Service
0249    *   Routine when called.
0250    */
0251   void *routine_user_data;
0252 
0253   /**
0254    * @brief This member specifies which pre-condition context (none, interrupt
0255    *   context, server context) must be created before the
0256    *   rtems_timer_server_fire_after() action gets executed.
0257    */
0258   PreConditionContext pre_cond_contex;
0259 
0260   /**
0261    * @brief This member stores internal clock and context settings of the timer
0262    *   before the execution of the test action.
0263    */
0264   Timer_Classes pre_class;
0265 
0266   /**
0267    * @brief This member stores the state of the timer before the execution of
0268    *   the test action.
0269    */
0270   Timer_States pre_state;
0271 
0272   /**
0273    * @brief This member stores the state of the timer after the execution of
0274    *   the test action.
0275    */
0276   Timer_States post_state;
0277 
0278   /**
0279    * @brief This member stores the scheduling data of the timer before the
0280    *   execution of the test action.
0281    */
0282   Timer_Scheduling_Data pre_scheduling_data;
0283 
0284   /**
0285    * @brief This member stores the scheduling data of the timer after the
0286    *   execution of the test action.
0287    */
0288   Timer_Scheduling_Data post_scheduling_data;
0289 
0290   struct {
0291     /**
0292      * @brief This member defines the pre-condition states for the next action.
0293      */
0294     size_t pcs[ 7 ];
0295 
0296     /**
0297      * @brief If this member is true, then the test action loop is executed.
0298      */
0299     bool in_action_loop;
0300 
0301     /**
0302      * @brief This member contains the next transition map index.
0303      */
0304     size_t index;
0305 
0306     /**
0307      * @brief This member contains the current transition map entry.
0308      */
0309     RtemsTimerReqServerFireAfter_Entry entry;
0310 
0311     /**
0312      * @brief If this member is true, then the current transition variant
0313      *   should be skipped.
0314      */
0315     bool skip;
0316   } Map;
0317 } RtemsTimerReqServerFireAfter_Context;
0318 
0319 static RtemsTimerReqServerFireAfter_Context
0320   RtemsTimerReqServerFireAfter_Instance;
0321 
0322 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Server[] = {
0323   "Init",
0324   "NotInit",
0325   "NA"
0326 };
0327 
0328 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Ticks[] = {
0329   "Valid",
0330   "Is0",
0331   "NA"
0332 };
0333 
0334 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Routine[] = {
0335   "Valid",
0336   "Null",
0337   "NA"
0338 };
0339 
0340 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Id[] = {
0341   "Valid",
0342   "Invalid",
0343   "NA"
0344 };
0345 
0346 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Context[] = {
0347   "None",
0348   "Interrupt",
0349   "Server",
0350   "NA"
0351 };
0352 
0353 static const char * const RtemsTimerReqServerFireAfter_PreDesc_Clock[] = {
0354   "None",
0355   "Ticks",
0356   "Realtime",
0357   "NA"
0358 };
0359 
0360 static const char * const RtemsTimerReqServerFireAfter_PreDesc_State[] = {
0361   "Inactive",
0362   "Scheduled",
0363   "Pending",
0364   "NA"
0365 };
0366 
0367 static const char * const * const RtemsTimerReqServerFireAfter_PreDesc[] = {
0368   RtemsTimerReqServerFireAfter_PreDesc_Server,
0369   RtemsTimerReqServerFireAfter_PreDesc_Ticks,
0370   RtemsTimerReqServerFireAfter_PreDesc_Routine,
0371   RtemsTimerReqServerFireAfter_PreDesc_Id,
0372   RtemsTimerReqServerFireAfter_PreDesc_Context,
0373   RtemsTimerReqServerFireAfter_PreDesc_Clock,
0374   RtemsTimerReqServerFireAfter_PreDesc_State,
0375   NULL
0376 };
0377 
0378 static const rtems_time_of_day tod_now      = { 2000, 1, 1, 0, 0, 0, 0 };
0379 static const rtems_time_of_day tod_schedule = { 2000, 1, 1, 1, 0, 0, 0 };
0380 static const rtems_time_of_day tod_fire     = { 2000, 1, 2, 0, 0, 0, 0 };
0381 
0382 static Scheduling_Ticks TriggerTimer( const RtemsTimerReqServerFireAfter_Context *ctx )
0383 {
0384   int ticks_fired = SCHEDULE_NONE;
0385   int invocations_old = ctx->invocations;
0386 
0387   /* Fire the timer service routine for ticks and realtime clock */
0388   int i;
0389   for ( i = 1; i <= SCHEDULE_MAX; ++i ) {
0390     ClockTick();
0391     if ( ctx->invocations > invocations_old ) {
0392       ticks_fired = i;
0393       break;
0394     }
0395   }
0396 
0397   T_rsc_success( rtems_clock_set( &tod_fire ) );
0398 
0399   return ticks_fired;
0400 }
0401 
0402 static void TimerServiceRoutine(
0403   rtems_id timer_id,
0404   void *user_data
0405 )
0406 {
0407   RtemsTimerReqServerFireAfter_Context *ctx = user_data;
0408   ++( ctx->invocations );
0409   ctx->routine_user_data = user_data;
0410 }
0411 
0412 /*
0413  * This service routine is used reach branch coverage in an if-statement
0414  * which only serves performance optimization.
0415  */
0416 static void TimerServiceRoutineCover(
0417   rtems_id timer_cover_id,
0418   void *user_data
0419 )
0420 {
0421   (void) timer_cover_id;
0422   (void) user_data;
0423 }
0424 
0425 static void RtemsTimerReqServerFireAfter_Pre_Server_Prepare(
0426   RtemsTimerReqServerFireAfter_Context   *ctx,
0427   RtemsTimerReqServerFireAfter_Pre_Server state
0428 )
0429 {
0430   switch ( state ) {
0431     case RtemsTimerReqServerFireAfter_Pre_Server_Init: {
0432       /*
0433        * While the Timer Server task has been successfully initialized by a
0434        * call to rtems_timer_initiate_server().
0435        */
0436       rtems_status_code status;
0437       status = rtems_timer_initiate_server(
0438         RTEMS_TIMER_SERVER_DEFAULT_PRIORITY,
0439         RTEMS_MINIMUM_STACK_SIZE,
0440         RTEMS_DEFAULT_ATTRIBUTES
0441       );
0442       T_rsc_success( status );
0443       break;
0444     }
0445 
0446     case RtemsTimerReqServerFireAfter_Pre_Server_NotInit: {
0447       /*
0448        * While the Timer Server task has not been initialized and does not
0449        * exist.
0450        */
0451       DeleteTimerServer();
0452       break;
0453     }
0454 
0455     case RtemsTimerReqServerFireAfter_Pre_Server_NA:
0456       break;
0457   }
0458 }
0459 
0460 static void RtemsTimerReqServerFireAfter_Pre_Ticks_Prepare(
0461   RtemsTimerReqServerFireAfter_Context  *ctx,
0462   RtemsTimerReqServerFireAfter_Pre_Ticks state
0463 )
0464 {
0465   switch ( state ) {
0466     case RtemsTimerReqServerFireAfter_Pre_Ticks_Valid: {
0467       /*
0468        * While the ``ticks`` parameter is a positive (greater 0) number.
0469        */
0470       ctx->ticks_param = SCHEDULE_LATER;
0471       break;
0472     }
0473 
0474     case RtemsTimerReqServerFireAfter_Pre_Ticks_Is0: {
0475       /*
0476        * While the ``ticks`` parameter is 0.
0477        */
0478       ctx->ticks_param = 0;
0479       break;
0480     }
0481 
0482     case RtemsTimerReqServerFireAfter_Pre_Ticks_NA:
0483       break;
0484   }
0485 }
0486 
0487 static void RtemsTimerReqServerFireAfter_Pre_Routine_Prepare(
0488   RtemsTimerReqServerFireAfter_Context    *ctx,
0489   RtemsTimerReqServerFireAfter_Pre_Routine state
0490 )
0491 {
0492   switch ( state ) {
0493     case RtemsTimerReqServerFireAfter_Pre_Routine_Valid: {
0494       /*
0495        * While the ``routine`` parameter references an object of type
0496        * rtems_timer_service_routine_entry.
0497        */
0498       ctx->routine_param = TimerServiceRoutine;
0499       break;
0500     }
0501 
0502     case RtemsTimerReqServerFireAfter_Pre_Routine_Null: {
0503       /*
0504        * While the ``routine`` parameter is NULL..
0505        */
0506       ctx->routine_param = NULL;
0507       break;
0508     }
0509 
0510     case RtemsTimerReqServerFireAfter_Pre_Routine_NA:
0511       break;
0512   }
0513 }
0514 
0515 static void RtemsTimerReqServerFireAfter_Pre_Id_Prepare(
0516   RtemsTimerReqServerFireAfter_Context *ctx,
0517   RtemsTimerReqServerFireAfter_Pre_Id   state
0518 )
0519 {
0520   switch ( state ) {
0521     case RtemsTimerReqServerFireAfter_Pre_Id_Valid: {
0522       /*
0523        * While the ``id`` parameter is valid.
0524        */
0525       ctx->id_param = ctx->timer_id;
0526       break;
0527     }
0528 
0529     case RtemsTimerReqServerFireAfter_Pre_Id_Invalid: {
0530       /*
0531        * While the ``id`` parameter is invalid.
0532        */
0533       ctx->id_param = RTEMS_ID_NONE;
0534       break;
0535     }
0536 
0537     case RtemsTimerReqServerFireAfter_Pre_Id_NA:
0538       break;
0539   }
0540 }
0541 
0542 static void RtemsTimerReqServerFireAfter_Pre_Context_Prepare(
0543   RtemsTimerReqServerFireAfter_Context    *ctx,
0544   RtemsTimerReqServerFireAfter_Pre_Context state
0545 )
0546 {
0547   switch ( state ) {
0548     case RtemsTimerReqServerFireAfter_Pre_Context_None: {
0549       /*
0550        * While the Timer Service Routine has never been scheduled since
0551        * creation of the timer. See also none.
0552        */
0553       ctx->pre_cond_contex = PRE_NONE;
0554       break;
0555     }
0556 
0557     case RtemsTimerReqServerFireAfter_Pre_Context_Interrupt: {
0558       /*
0559        * While the timer is in interrupt context.
0560        */
0561       ctx->pre_cond_contex = PRE_INTERRUPT;
0562       break;
0563     }
0564 
0565     case RtemsTimerReqServerFireAfter_Pre_Context_Server: {
0566       /*
0567        * While the timer is in server context.
0568        */
0569       ctx->pre_cond_contex = PRE_SERVER;
0570       break;
0571     }
0572 
0573     case RtemsTimerReqServerFireAfter_Pre_Context_NA:
0574       break;
0575   }
0576 }
0577 
0578 static void RtemsTimerReqServerFireAfter_Pre_Clock_Prepare(
0579   RtemsTimerReqServerFireAfter_Context  *ctx,
0580   RtemsTimerReqServerFireAfter_Pre_Clock state
0581 )
0582 {
0583   switch ( state ) {
0584     case RtemsTimerReqServerFireAfter_Pre_Clock_None: {
0585       /*
0586        * While the timer has never been scheduled since creation of the timer.
0587        */
0588       T_eq_int( ctx->pre_cond_contex, PRE_NONE );
0589       break;
0590     }
0591 
0592     case RtemsTimerReqServerFireAfter_Pre_Clock_Ticks: {
0593       /*
0594        * While the clock used to determine when the timer will fire is the
0595        * ticks based clock.
0596        */
0597       rtems_status_code status;
0598 
0599       if ( ctx->pre_cond_contex == PRE_INTERRUPT ) {
0600         status = rtems_timer_fire_after(
0601           ctx->timer_id,
0602           SCHEDULE_SOON,
0603           TimerServiceRoutine,
0604           ctx
0605         );
0606       } else {
0607         status = rtems_timer_server_fire_after(
0608           ctx->timer_id,
0609           SCHEDULE_SOON,
0610           TimerServiceRoutine,
0611           ctx
0612         );
0613       }
0614       T_rsc_success( status );
0615       break;
0616     }
0617 
0618     case RtemsTimerReqServerFireAfter_Pre_Clock_Realtime: {
0619       /*
0620        * While the clock used to determine when the timer will fire is the
0621        * realtime clock.
0622        */
0623       rtems_status_code status;
0624 
0625       if ( ctx->pre_cond_contex == PRE_INTERRUPT ) {
0626         status = rtems_timer_fire_when(
0627           ctx->timer_id,
0628           &tod_schedule,
0629           TimerServiceRoutine,
0630           ctx
0631         );
0632       } else {
0633         status = rtems_timer_server_fire_when(
0634           ctx->timer_id,
0635           &tod_schedule,
0636           TimerServiceRoutine,
0637           ctx
0638         );
0639       }
0640       T_rsc_success( status );
0641       break;
0642     }
0643 
0644     case RtemsTimerReqServerFireAfter_Pre_Clock_NA:
0645       break;
0646   }
0647 }
0648 
0649 static void RtemsTimerReqServerFireAfter_Pre_State_Prepare(
0650   RtemsTimerReqServerFireAfter_Context  *ctx,
0651   RtemsTimerReqServerFireAfter_Pre_State state
0652 )
0653 {
0654   switch ( state ) {
0655     case RtemsTimerReqServerFireAfter_Pre_State_Inactive: {
0656       /*
0657        * While the timer is in inactive state.
0658        */
0659       TriggerTimer( ctx );
0660       T_eq_int(
0661         ctx->invocations,
0662         ( ctx->pre_cond_contex == PRE_NONE ) ? 0 : 1
0663       );
0664       ctx->invocations = 0;
0665       ctx->pre_state = TIMER_INACTIVE;
0666       break;
0667     }
0668 
0669     case RtemsTimerReqServerFireAfter_Pre_State_Scheduled: {
0670       /*
0671        * While the timer is in scheduled state.
0672        */
0673       /* The timer was already scheduled in the "Clock" pre-conditions. */
0674       ctx->pre_state = TIMER_SCHEDULED;
0675       break;
0676     }
0677 
0678     case RtemsTimerReqServerFireAfter_Pre_State_Pending: {
0679       /*
0680        * While the timer is in pending state.
0681        */
0682       rtems_status_code status;
0683       if ( ctx->pre_cond_contex == PRE_SERVER ) {
0684         /*
0685          * This call to rtems_timer_fire_after() serves to reach branch coverage
0686          * in an if-statement which only serves performance optimization.
0687          *
0688          * cpukit/rtems/src/timerserver.c:70 else-branch was not reached:
0689          * if ( wakeup ) {
0690          *   (void) rtems_event_system_send( ts->server_id, RTEMS_EVENT_SYSTEM_SERVER );
0691          * }
0692          */
0693         status = rtems_timer_server_fire_after(
0694           ctx->timer_cover_id,
0695           SCHEDULE_VERY_SOON,
0696           TimerServiceRoutineCover,
0697           ctx
0698         );
0699         T_rsc_success( status );
0700       }
0701 
0702       T_rsc_success( rtems_task_suspend( GetTimerServerTaskId() ) );
0703       TriggerTimer( ctx );
0704       T_eq_int( ctx->invocations, 0 );
0705       ctx->pre_state = TIMER_PENDING;
0706       break;
0707     }
0708 
0709     case RtemsTimerReqServerFireAfter_Pre_State_NA:
0710       break;
0711   }
0712 }
0713 
0714 static void RtemsTimerReqServerFireAfter_Post_Status_Check(
0715   RtemsTimerReqServerFireAfter_Context    *ctx,
0716   RtemsTimerReqServerFireAfter_Post_Status state
0717 )
0718 {
0719   switch ( state ) {
0720     case RtemsTimerReqServerFireAfter_Post_Status_Ok: {
0721       /*
0722        * The return status of rtems_timer_server_fire_after() shall be
0723        * RTEMS_SUCCESSFUL.
0724        */
0725       T_rsc_success( ctx->status );
0726       break;
0727     }
0728 
0729     case RtemsTimerReqServerFireAfter_Post_Status_InvId: {
0730       /*
0731        * The return status of rtems_timer_server_fire_after() shall be
0732        * RTEMS_INVALID_ID.
0733        */
0734       T_rsc( ctx->status, RTEMS_INVALID_ID );
0735       break;
0736     }
0737 
0738     case RtemsTimerReqServerFireAfter_Post_Status_InvAddr: {
0739       /*
0740        * The return status of rtems_timer_server_fire_after() shall be
0741        * RTEMS_INVALID_ADDRESS.
0742        */
0743       T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0744       break;
0745     }
0746 
0747     case RtemsTimerReqServerFireAfter_Post_Status_InvNum: {
0748       /*
0749        * The return status of rtems_timer_server_fire_after() shall be
0750        * RTEMS_INVALID_NUMBER.
0751        */
0752       T_rsc( ctx->status, RTEMS_INVALID_NUMBER );
0753       break;
0754     }
0755 
0756     case RtemsTimerReqServerFireAfter_Post_Status_IncStat: {
0757       /*
0758        * The return status of rtems_timer_server_fire_after() shall be
0759        * RTEMS_INCORRECT_STATE.
0760        */
0761       T_rsc( ctx->status, RTEMS_INCORRECT_STATE );
0762       break;
0763     }
0764 
0765     case RtemsTimerReqServerFireAfter_Post_Status_NA:
0766       break;
0767   }
0768 }
0769 
0770 static void RtemsTimerReqServerFireAfter_Post_Context_Check(
0771   RtemsTimerReqServerFireAfter_Context     *ctx,
0772   RtemsTimerReqServerFireAfter_Post_Context state
0773 )
0774 {
0775   Timer_Classes class;
0776   class = GetTimerClass( ctx->timer_id );
0777 
0778   switch ( state ) {
0779     case RtemsTimerReqServerFireAfter_Post_Context_None: {
0780       /*
0781        * The timer shall have never been scheduled. See also none.
0782        */
0783       T_eq_int( class, TIMER_DORMANT );
0784       break;
0785     }
0786 
0787     case RtemsTimerReqServerFireAfter_Post_Context_Interrupt: {
0788       /*
0789        * The timer shall be in interrupt context.
0790        */
0791       T_eq_int( class & TIMER_CLASS_BIT_ON_TASK, 0 );
0792       break;
0793     }
0794 
0795     case RtemsTimerReqServerFireAfter_Post_Context_Server: {
0796       /*
0797        * The timer shall be in server context.
0798        */
0799       T_eq_int( class & TIMER_CLASS_BIT_ON_TASK, TIMER_CLASS_BIT_ON_TASK );
0800       break;
0801     }
0802 
0803     case RtemsTimerReqServerFireAfter_Post_Context_Nop: {
0804       /*
0805        * Objects referenced by the parameters in the past call to
0806        * rtems_timer_server_fire_after() shall not be accessed by the
0807        * rtems_timer_server_fire_after() call. See also Nop.
0808        */
0809       T_eq_int( class, ctx->pre_class );
0810       break;
0811     }
0812 
0813     case RtemsTimerReqServerFireAfter_Post_Context_NA:
0814       break;
0815   }
0816 }
0817 
0818 static void RtemsTimerReqServerFireAfter_Post_Clock_Check(
0819   RtemsTimerReqServerFireAfter_Context   *ctx,
0820   RtemsTimerReqServerFireAfter_Post_Clock state
0821 )
0822 {
0823   Timer_Classes class;
0824   class = GetTimerClass( ctx->timer_id );
0825 
0826   switch ( state ) {
0827     case RtemsTimerReqServerFireAfter_Post_Clock_None: {
0828       /*
0829        * The timer shall have never been scheduled.
0830        */
0831       T_eq_int( class, TIMER_DORMANT );
0832       break;
0833     }
0834 
0835     case RtemsTimerReqServerFireAfter_Post_Clock_Ticks: {
0836       /*
0837        * The timer shall use the ticks based clock.
0838        */
0839       T_eq_int( class & TIMER_CLASS_BIT_TIME_OF_DAY, 0 );
0840       break;
0841     }
0842 
0843     case RtemsTimerReqServerFireAfter_Post_Clock_Realtime: {
0844       /*
0845        * The timer shall use the realtime clock.
0846        */
0847       T_eq_int(
0848         class & TIMER_CLASS_BIT_TIME_OF_DAY,
0849         TIMER_CLASS_BIT_TIME_OF_DAY
0850       );
0851       break;
0852     }
0853 
0854     case RtemsTimerReqServerFireAfter_Post_Clock_Nop: {
0855       /*
0856        * Objects referenced by the parameters in the past call to
0857        * rtems_timer_server_fire_after() shall not be accessed by the
0858        * rtems_timer_server_fire_after() call.
0859        */
0860       T_eq_int( class, ctx->pre_class );
0861       break;
0862     }
0863 
0864     case RtemsTimerReqServerFireAfter_Post_Clock_NA:
0865       break;
0866   }
0867 }
0868 
0869 static void RtemsTimerReqServerFireAfter_Post_State_Check(
0870   RtemsTimerReqServerFireAfter_Context   *ctx,
0871   RtemsTimerReqServerFireAfter_Post_State state
0872 )
0873 {
0874   switch ( state ) {
0875     case RtemsTimerReqServerFireAfter_Post_State_Scheduled: {
0876       /*
0877        * The timer shall be in scheduled state.
0878        */
0879       ctx->ticks_till_fire = TriggerTimer( ctx );
0880       T_eq_int( ctx->invocations, 1 );
0881       break;
0882     }
0883 
0884     case RtemsTimerReqServerFireAfter_Post_State_Nop: {
0885       /*
0886        * Objects referenced by the parameters in the past call to
0887        * rtems_timer_server_fire_after() shall not be accessed by the
0888        * rtems_timer_server_fire_after() call.
0889        */
0890       T_eq_int( ctx->post_state, ctx->pre_state );
0891       break;
0892     }
0893 
0894     case RtemsTimerReqServerFireAfter_Post_State_NA:
0895       break;
0896   }
0897 }
0898 
0899 static void RtemsTimerReqServerFireAfter_Post_Interval_Check(
0900   RtemsTimerReqServerFireAfter_Context      *ctx,
0901   RtemsTimerReqServerFireAfter_Post_Interval state
0902 )
0903 {
0904   switch ( state ) {
0905     case RtemsTimerReqServerFireAfter_Post_Interval_Param: {
0906       /*
0907        * The Timer Service Routine shall be invoked the number of ticks (see
0908        * tick), which are provided by the ``ticks`` parameter in the past call
0909        * to rtems_timer_server_fire_after(), after a point in time during the
0910        * execution of the rtems_timer_server_fire_after() call.
0911        */
0912       T_eq_int( ctx->ticks_till_fire, ctx->ticks_param );
0913       break;
0914     }
0915 
0916     case RtemsTimerReqServerFireAfter_Post_Interval_Nop: {
0917       /*
0918        * If and when the Timer Service Routine will be invoked shall not be
0919        * changed by the past call to rtems_timer_server_fire_after().
0920        */
0921       /*
0922        * Whether the timer is scheduled has already been tested by the
0923        * "Nop" "State" post-condition above.
0924        */
0925       T_eq_u32(
0926         ctx->post_scheduling_data.interval,
0927         ctx->pre_scheduling_data.interval
0928       );
0929       break;
0930     }
0931 
0932     case RtemsTimerReqServerFireAfter_Post_Interval_NA:
0933       break;
0934   }
0935 }
0936 
0937 static void RtemsTimerReqServerFireAfter_Post_Routine_Check(
0938   RtemsTimerReqServerFireAfter_Context     *ctx,
0939   RtemsTimerReqServerFireAfter_Post_Routine state
0940 )
0941 {
0942   switch ( state ) {
0943     case RtemsTimerReqServerFireAfter_Post_Routine_Param: {
0944       /*
0945        * The function reference used to invoke the Timer Service Routine when
0946        * the timer will fire shall be the one provided by the ``routine``
0947        * parameter in the past call to rtems_timer_server_fire_after().
0948        */
0949       T_eq_int( ctx->invocations, 1 );
0950       break;
0951     }
0952 
0953     case RtemsTimerReqServerFireAfter_Post_Routine_Nop: {
0954       /*
0955        * The function reference used for any invocation of the Timer Service
0956        * Routine shall not be changed by the past call to
0957        * rtems_timer_server_fire_after().
0958        */
0959       T_eq_ptr(
0960         ctx->post_scheduling_data.routine,
0961         ctx->pre_scheduling_data.routine
0962       );
0963       break;
0964     }
0965 
0966     case RtemsTimerReqServerFireAfter_Post_Routine_NA:
0967       break;
0968   }
0969 }
0970 
0971 static void RtemsTimerReqServerFireAfter_Post_UserData_Check(
0972   RtemsTimerReqServerFireAfter_Context      *ctx,
0973   RtemsTimerReqServerFireAfter_Post_UserData state
0974 )
0975 {
0976   switch ( state ) {
0977     case RtemsTimerReqServerFireAfter_Post_UserData_Param: {
0978       /*
0979        * The user data argument for invoking the Timer Service Routine when the
0980        * timer will fire shall be the one provided by the ``user_data``
0981        * parameter in the past call to rtems_timer_server_fire_after().
0982        */
0983       T_eq_ptr( ctx->routine_user_data, ctx );
0984       break;
0985     }
0986 
0987     case RtemsTimerReqServerFireAfter_Post_UserData_Nop: {
0988       /*
0989        * The user data argument used for any invocation of the Timer Service
0990        * Routine shall not be changed by the past call to
0991        * rtems_timer_server_fire_after().
0992        */
0993       T_eq_ptr(
0994         ctx->post_scheduling_data.user_data,
0995         ctx->pre_scheduling_data.user_data
0996       );
0997       break;
0998     }
0999 
1000     case RtemsTimerReqServerFireAfter_Post_UserData_NA:
1001       break;
1002   }
1003 }
1004 
1005 /**
1006  * @brief Make sure the realtime clock is not set after this test.
1007  */
1008 static void RtemsTimerReqServerFireAfter_Teardown(
1009   RtemsTimerReqServerFireAfter_Context *ctx
1010 )
1011 {
1012   UnsetClock();
1013 }
1014 
1015 static void RtemsTimerReqServerFireAfter_Teardown_Wrap( void *arg )
1016 {
1017   RtemsTimerReqServerFireAfter_Context *ctx;
1018 
1019   ctx = arg;
1020   ctx->Map.in_action_loop = false;
1021   RtemsTimerReqServerFireAfter_Teardown( ctx );
1022 }
1023 
1024 static void RtemsTimerReqServerFireAfter_Prepare(
1025   RtemsTimerReqServerFireAfter_Context *ctx
1026 )
1027 {
1028   rtems_status_code status;
1029   status = rtems_timer_create(
1030     rtems_build_name( 'T', 'I', 'M', 'E' ),
1031     &ctx->timer_id
1032   );
1033   T_rsc_success( status );
1034 
1035   status = rtems_timer_create(
1036     rtems_build_name( 'C', 'O', 'V', 'R' ),
1037     &ctx->timer_cover_id
1038   );
1039   T_rsc_success( status );
1040 
1041   ctx->invocations               = 0;
1042   ctx->ticks_till_fire           = SCHEDULE_NONE;
1043   ctx->routine_user_data         = NULL;
1044   T_rsc_success( rtems_clock_set( &tod_now ) );
1045 }
1046 
1047 static void RtemsTimerReqServerFireAfter_Action(
1048   RtemsTimerReqServerFireAfter_Context *ctx
1049 )
1050 {
1051   GetTimerSchedulingData( ctx->timer_id, &ctx->pre_scheduling_data );
1052   ctx->pre_class = GetTimerClass( ctx->timer_id );
1053   ctx->status = rtems_timer_server_fire_after(
1054     ctx->id_param,
1055     ctx->ticks_param,
1056     ctx->routine_param,
1057     ctx
1058   );
1059   ctx->post_state = GetTimerState( ctx->timer_id );
1060   GetTimerSchedulingData( ctx->timer_id, &ctx->post_scheduling_data );
1061   /* Ignoring return status: the timer server task may be suspended or not. */
1062   rtems_task_resume( GetTimerServerTaskId() );
1063 }
1064 
1065 static void RtemsTimerReqServerFireAfter_Cleanup(
1066   RtemsTimerReqServerFireAfter_Context *ctx
1067 )
1068 {
1069   T_rsc_success( rtems_timer_delete( ctx->timer_cover_id ) );
1070   T_rsc_success( rtems_timer_delete( ctx->timer_id ) );
1071   DeleteTimerServer();
1072 }
1073 
1074 static const RtemsTimerReqServerFireAfter_Entry
1075 RtemsTimerReqServerFireAfter_Entries[] = {
1076   { 1, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_NA,
1077     RtemsTimerReqServerFireAfter_Post_Context_NA,
1078     RtemsTimerReqServerFireAfter_Post_Clock_NA,
1079     RtemsTimerReqServerFireAfter_Post_State_NA,
1080     RtemsTimerReqServerFireAfter_Post_Interval_NA,
1081     RtemsTimerReqServerFireAfter_Post_Routine_NA,
1082     RtemsTimerReqServerFireAfter_Post_UserData_NA },
1083   { 1, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_NA,
1084     RtemsTimerReqServerFireAfter_Post_Context_NA,
1085     RtemsTimerReqServerFireAfter_Post_Clock_NA,
1086     RtemsTimerReqServerFireAfter_Post_State_NA,
1087     RtemsTimerReqServerFireAfter_Post_Interval_NA,
1088     RtemsTimerReqServerFireAfter_Post_Routine_NA,
1089     RtemsTimerReqServerFireAfter_Post_UserData_NA },
1090   { 0, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_InvNum,
1091     RtemsTimerReqServerFireAfter_Post_Context_Nop,
1092     RtemsTimerReqServerFireAfter_Post_Clock_Nop,
1093     RtemsTimerReqServerFireAfter_Post_State_Nop,
1094     RtemsTimerReqServerFireAfter_Post_Interval_Nop,
1095     RtemsTimerReqServerFireAfter_Post_Routine_Nop,
1096     RtemsTimerReqServerFireAfter_Post_UserData_Nop },
1097   { 0, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_IncStat,
1098     RtemsTimerReqServerFireAfter_Post_Context_Nop,
1099     RtemsTimerReqServerFireAfter_Post_Clock_Nop,
1100     RtemsTimerReqServerFireAfter_Post_State_Nop,
1101     RtemsTimerReqServerFireAfter_Post_Interval_Nop,
1102     RtemsTimerReqServerFireAfter_Post_Routine_Nop,
1103     RtemsTimerReqServerFireAfter_Post_UserData_Nop },
1104   { 0, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_InvAddr,
1105     RtemsTimerReqServerFireAfter_Post_Context_Nop,
1106     RtemsTimerReqServerFireAfter_Post_Clock_Nop,
1107     RtemsTimerReqServerFireAfter_Post_State_Nop,
1108     RtemsTimerReqServerFireAfter_Post_Interval_Nop,
1109     RtemsTimerReqServerFireAfter_Post_Routine_Nop,
1110     RtemsTimerReqServerFireAfter_Post_UserData_Nop },
1111   { 0, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_Ok,
1112     RtemsTimerReqServerFireAfter_Post_Context_Server,
1113     RtemsTimerReqServerFireAfter_Post_Clock_Ticks,
1114     RtemsTimerReqServerFireAfter_Post_State_Scheduled,
1115     RtemsTimerReqServerFireAfter_Post_Interval_Param,
1116     RtemsTimerReqServerFireAfter_Post_Routine_Param,
1117     RtemsTimerReqServerFireAfter_Post_UserData_Param },
1118   { 0, 0, 0, 0, 0, 0, 0, 0, RtemsTimerReqServerFireAfter_Post_Status_InvId,
1119     RtemsTimerReqServerFireAfter_Post_Context_Nop,
1120     RtemsTimerReqServerFireAfter_Post_Clock_Nop,
1121     RtemsTimerReqServerFireAfter_Post_State_Nop,
1122     RtemsTimerReqServerFireAfter_Post_Interval_Nop,
1123     RtemsTimerReqServerFireAfter_Post_Routine_Nop,
1124     RtemsTimerReqServerFireAfter_Post_UserData_Nop }
1125 };
1126 
1127 static const uint8_t
1128 RtemsTimerReqServerFireAfter_Map[] = {
1129   5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5,
1130   5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6,
1131   6, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 4, 4, 0, 0, 0, 0, 4, 4, 4,
1132   4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 4, 4, 0, 0, 0, 0, 4, 4,
1133   4, 4, 4, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 0, 2,
1134   2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 0,
1135   2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0,
1136   0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0,
1137   0, 0, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 3, 3, 0,
1138   0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 3, 3,
1139   0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 3,
1140   3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0,
1141   3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
1142   0, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
1143   3, 0, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1144   3, 3, 0, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1145   0, 3, 3, 0, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1
1146 };
1147 
1148 static size_t RtemsTimerReqServerFireAfter_Scope(
1149   void  *arg,
1150   char  *buf,
1151   size_t n
1152 )
1153 {
1154   RtemsTimerReqServerFireAfter_Context *ctx;
1155 
1156   ctx = arg;
1157 
1158   if ( ctx->Map.in_action_loop ) {
1159     return T_get_scope(
1160       RtemsTimerReqServerFireAfter_PreDesc,
1161       buf,
1162       n,
1163       ctx->Map.pcs
1164     );
1165   }
1166 
1167   return 0;
1168 }
1169 
1170 static T_fixture RtemsTimerReqServerFireAfter_Fixture = {
1171   .setup = NULL,
1172   .stop = NULL,
1173   .teardown = RtemsTimerReqServerFireAfter_Teardown_Wrap,
1174   .scope = RtemsTimerReqServerFireAfter_Scope,
1175   .initial_context = &RtemsTimerReqServerFireAfter_Instance
1176 };
1177 
1178 static inline RtemsTimerReqServerFireAfter_Entry
1179 RtemsTimerReqServerFireAfter_PopEntry(
1180   RtemsTimerReqServerFireAfter_Context *ctx
1181 )
1182 {
1183   size_t index;
1184 
1185   index = ctx->Map.index;
1186   ctx->Map.index = index + 1;
1187   return RtemsTimerReqServerFireAfter_Entries[
1188     RtemsTimerReqServerFireAfter_Map[ index ]
1189   ];
1190 }
1191 
1192 static void RtemsTimerReqServerFireAfter_TestVariant(
1193   RtemsTimerReqServerFireAfter_Context *ctx
1194 )
1195 {
1196   RtemsTimerReqServerFireAfter_Pre_Server_Prepare( ctx, ctx->Map.pcs[ 0 ] );
1197   RtemsTimerReqServerFireAfter_Pre_Ticks_Prepare( ctx, ctx->Map.pcs[ 1 ] );
1198   RtemsTimerReqServerFireAfter_Pre_Routine_Prepare( ctx, ctx->Map.pcs[ 2 ] );
1199   RtemsTimerReqServerFireAfter_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 3 ] );
1200   RtemsTimerReqServerFireAfter_Pre_Context_Prepare( ctx, ctx->Map.pcs[ 4 ] );
1201   RtemsTimerReqServerFireAfter_Pre_Clock_Prepare( ctx, ctx->Map.pcs[ 5 ] );
1202   RtemsTimerReqServerFireAfter_Pre_State_Prepare( ctx, ctx->Map.pcs[ 6 ] );
1203   RtemsTimerReqServerFireAfter_Action( ctx );
1204   RtemsTimerReqServerFireAfter_Post_Status_Check(
1205     ctx,
1206     ctx->Map.entry.Post_Status
1207   );
1208   RtemsTimerReqServerFireAfter_Post_Context_Check(
1209     ctx,
1210     ctx->Map.entry.Post_Context
1211   );
1212   RtemsTimerReqServerFireAfter_Post_Clock_Check(
1213     ctx,
1214     ctx->Map.entry.Post_Clock
1215   );
1216   RtemsTimerReqServerFireAfter_Post_State_Check(
1217     ctx,
1218     ctx->Map.entry.Post_State
1219   );
1220   RtemsTimerReqServerFireAfter_Post_Interval_Check(
1221     ctx,
1222     ctx->Map.entry.Post_Interval
1223   );
1224   RtemsTimerReqServerFireAfter_Post_Routine_Check(
1225     ctx,
1226     ctx->Map.entry.Post_Routine
1227   );
1228   RtemsTimerReqServerFireAfter_Post_UserData_Check(
1229     ctx,
1230     ctx->Map.entry.Post_UserData
1231   );
1232 }
1233 
1234 /**
1235  * @fn void T_case_body_RtemsTimerReqServerFireAfter( void )
1236  */
1237 T_TEST_CASE_FIXTURE(
1238   RtemsTimerReqServerFireAfter,
1239   &RtemsTimerReqServerFireAfter_Fixture
1240 )
1241 {
1242   RtemsTimerReqServerFireAfter_Context *ctx;
1243 
1244   ctx = T_fixture_context();
1245   ctx->Map.in_action_loop = true;
1246   ctx->Map.index = 0;
1247 
1248   for (
1249     ctx->Map.pcs[ 0 ] = RtemsTimerReqServerFireAfter_Pre_Server_Init;
1250     ctx->Map.pcs[ 0 ] < RtemsTimerReqServerFireAfter_Pre_Server_NA;
1251     ++ctx->Map.pcs[ 0 ]
1252   ) {
1253     for (
1254       ctx->Map.pcs[ 1 ] = RtemsTimerReqServerFireAfter_Pre_Ticks_Valid;
1255       ctx->Map.pcs[ 1 ] < RtemsTimerReqServerFireAfter_Pre_Ticks_NA;
1256       ++ctx->Map.pcs[ 1 ]
1257     ) {
1258       for (
1259         ctx->Map.pcs[ 2 ] = RtemsTimerReqServerFireAfter_Pre_Routine_Valid;
1260         ctx->Map.pcs[ 2 ] < RtemsTimerReqServerFireAfter_Pre_Routine_NA;
1261         ++ctx->Map.pcs[ 2 ]
1262       ) {
1263         for (
1264           ctx->Map.pcs[ 3 ] = RtemsTimerReqServerFireAfter_Pre_Id_Valid;
1265           ctx->Map.pcs[ 3 ] < RtemsTimerReqServerFireAfter_Pre_Id_NA;
1266           ++ctx->Map.pcs[ 3 ]
1267         ) {
1268           for (
1269             ctx->Map.pcs[ 4 ] = RtemsTimerReqServerFireAfter_Pre_Context_None;
1270             ctx->Map.pcs[ 4 ] < RtemsTimerReqServerFireAfter_Pre_Context_NA;
1271             ++ctx->Map.pcs[ 4 ]
1272           ) {
1273             for (
1274               ctx->Map.pcs[ 5 ] = RtemsTimerReqServerFireAfter_Pre_Clock_None;
1275               ctx->Map.pcs[ 5 ] < RtemsTimerReqServerFireAfter_Pre_Clock_NA;
1276               ++ctx->Map.pcs[ 5 ]
1277             ) {
1278               for (
1279                 ctx->Map.pcs[ 6 ] = RtemsTimerReqServerFireAfter_Pre_State_Inactive;
1280                 ctx->Map.pcs[ 6 ] < RtemsTimerReqServerFireAfter_Pre_State_NA;
1281                 ++ctx->Map.pcs[ 6 ]
1282               ) {
1283                 ctx->Map.entry = RtemsTimerReqServerFireAfter_PopEntry( ctx );
1284 
1285                 if ( ctx->Map.entry.Skip ) {
1286                   continue;
1287                 }
1288 
1289                 RtemsTimerReqServerFireAfter_Prepare( ctx );
1290                 RtemsTimerReqServerFireAfter_TestVariant( ctx );
1291                 RtemsTimerReqServerFireAfter_Cleanup( ctx );
1292               }
1293             }
1294           }
1295         }
1296       }
1297     }
1298   }
1299 }
1300 
1301 /** @} */