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 RtemsTaskReqStart
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 #include <rtems/test-scheduler.h>
0057 
0058 #include "tx-support.h"
0059 
0060 #include <rtems/test.h>
0061 
0062 /**
0063  * @defgroup RtemsTaskReqStart spec:/rtems/task/req/start
0064  *
0065  * @ingroup TestsuitesValidationNoClock0
0066  *
0067  * @{
0068  */
0069 
0070 typedef enum {
0071   RtemsTaskReqStart_Pre_Id_Invalid,
0072   RtemsTaskReqStart_Pre_Id_Task,
0073   RtemsTaskReqStart_Pre_Id_NA
0074 } RtemsTaskReqStart_Pre_Id;
0075 
0076 typedef enum {
0077   RtemsTaskReqStart_Pre_EntryPoint_Valid,
0078   RtemsTaskReqStart_Pre_EntryPoint_Null,
0079   RtemsTaskReqStart_Pre_EntryPoint_NA
0080 } RtemsTaskReqStart_Pre_EntryPoint;
0081 
0082 typedef enum {
0083   RtemsTaskReqStart_Pre_Argument_Pointer,
0084   RtemsTaskReqStart_Pre_Argument_Number,
0085   RtemsTaskReqStart_Pre_Argument_NA
0086 } RtemsTaskReqStart_Pre_Argument;
0087 
0088 typedef enum {
0089   RtemsTaskReqStart_Pre_Dormant_Yes,
0090   RtemsTaskReqStart_Pre_Dormant_No,
0091   RtemsTaskReqStart_Pre_Dormant_NA
0092 } RtemsTaskReqStart_Pre_Dormant;
0093 
0094 typedef enum {
0095   RtemsTaskReqStart_Pre_Suspended_Yes,
0096   RtemsTaskReqStart_Pre_Suspended_No,
0097   RtemsTaskReqStart_Pre_Suspended_NA
0098 } RtemsTaskReqStart_Pre_Suspended;
0099 
0100 typedef enum {
0101   RtemsTaskReqStart_Post_Status_Ok,
0102   RtemsTaskReqStart_Post_Status_InvAddr,
0103   RtemsTaskReqStart_Post_Status_InvId,
0104   RtemsTaskReqStart_Post_Status_IncStat,
0105   RtemsTaskReqStart_Post_Status_NA
0106 } RtemsTaskReqStart_Post_Status;
0107 
0108 typedef enum {
0109   RtemsTaskReqStart_Post_EntryPoint_Set,
0110   RtemsTaskReqStart_Post_EntryPoint_Nop,
0111   RtemsTaskReqStart_Post_EntryPoint_NA
0112 } RtemsTaskReqStart_Post_EntryPoint;
0113 
0114 typedef enum {
0115   RtemsTaskReqStart_Post_Argument_Set,
0116   RtemsTaskReqStart_Post_Argument_Nop,
0117   RtemsTaskReqStart_Post_Argument_NA
0118 } RtemsTaskReqStart_Post_Argument;
0119 
0120 typedef enum {
0121   RtemsTaskReqStart_Post_Unblock_Yes,
0122   RtemsTaskReqStart_Post_Unblock_Nop,
0123   RtemsTaskReqStart_Post_Unblock_NA
0124 } RtemsTaskReqStart_Post_Unblock;
0125 
0126 typedef enum {
0127   RtemsTaskReqStart_Post_StartExtensions_Yes,
0128   RtemsTaskReqStart_Post_StartExtensions_Nop,
0129   RtemsTaskReqStart_Post_StartExtensions_NA
0130 } RtemsTaskReqStart_Post_StartExtensions;
0131 
0132 typedef struct {
0133   uint32_t Skip : 1;
0134   uint32_t Pre_Id_NA : 1;
0135   uint32_t Pre_EntryPoint_NA : 1;
0136   uint32_t Pre_Argument_NA : 1;
0137   uint32_t Pre_Dormant_NA : 1;
0138   uint32_t Pre_Suspended_NA : 1;
0139   uint32_t Post_Status : 3;
0140   uint32_t Post_EntryPoint : 2;
0141   uint32_t Post_Argument : 2;
0142   uint32_t Post_Unblock : 2;
0143   uint32_t Post_StartExtensions : 2;
0144 } RtemsTaskReqStart_Entry;
0145 
0146 /**
0147  * @brief Test context for spec:/rtems/task/req/start test case.
0148  */
0149 typedef struct {
0150   /**
0151    * @brief This member provides the scheduler operation records.
0152    */
0153   T_scheduler_log_2 scheduler_log;
0154 
0155   /**
0156    * @brief This member contains the identifier of a task.
0157    */
0158   rtems_id worker_id;
0159 
0160   /**
0161    * @brief This member contains the identifier of the test user extensions.
0162    */
0163   rtems_id extension_id;
0164 
0165   /**
0166    * @brief This member contains the count of thread start extension calls.
0167    */
0168   uint32_t start_extension_calls;
0169 
0170   /**
0171    * @brief This member contains the actual argument passed to the entry point.
0172    */
0173   rtems_task_argument actual_argument;
0174 
0175   /**
0176    * @brief This member contains the entry point counter.
0177    */
0178   uint32_t counter;
0179 
0180   /**
0181    * @brief If this member is true, then the worker is started before the
0182    *   rtems_task_start() call.
0183    */
0184   bool start;
0185 
0186   /**
0187    * @brief If this member is true, then the worker is suspended before the
0188    *   rtems_task_start() call.
0189    */
0190   bool suspend;
0191 
0192   /**
0193    * @brief This member contains the return value of the rtems_task_start()
0194    *   call.
0195    */
0196   rtems_status_code status;
0197 
0198   /**
0199    * @brief This member specifies if the ``id`` parameter value.
0200    */
0201   rtems_id id;
0202 
0203   /**
0204    * @brief This member specifies if the ``entry_point`` parameter value.
0205    */
0206   rtems_task_entry entry_point;
0207 
0208   /**
0209    * @brief This member specifies if the ``argument`` parameter value.
0210    */
0211   rtems_task_argument argument;
0212 
0213   struct {
0214     /**
0215      * @brief This member defines the pre-condition indices for the next
0216      *   action.
0217      */
0218     size_t pci[ 5 ];
0219 
0220     /**
0221      * @brief This member defines the pre-condition states for the next action.
0222      */
0223     size_t pcs[ 5 ];
0224 
0225     /**
0226      * @brief If this member is true, then the test action loop is executed.
0227      */
0228     bool in_action_loop;
0229 
0230     /**
0231      * @brief This member contains the next transition map index.
0232      */
0233     size_t index;
0234 
0235     /**
0236      * @brief This member contains the current transition map entry.
0237      */
0238     RtemsTaskReqStart_Entry entry;
0239 
0240     /**
0241      * @brief If this member is true, then the current transition variant
0242      *   should be skipped.
0243      */
0244     bool skip;
0245   } Map;
0246 } RtemsTaskReqStart_Context;
0247 
0248 static RtemsTaskReqStart_Context
0249   RtemsTaskReqStart_Instance;
0250 
0251 static const char * const RtemsTaskReqStart_PreDesc_Id[] = {
0252   "Invalid",
0253   "Task",
0254   "NA"
0255 };
0256 
0257 static const char * const RtemsTaskReqStart_PreDesc_EntryPoint[] = {
0258   "Valid",
0259   "Null",
0260   "NA"
0261 };
0262 
0263 static const char * const RtemsTaskReqStart_PreDesc_Argument[] = {
0264   "Pointer",
0265   "Number",
0266   "NA"
0267 };
0268 
0269 static const char * const RtemsTaskReqStart_PreDesc_Dormant[] = {
0270   "Yes",
0271   "No",
0272   "NA"
0273 };
0274 
0275 static const char * const RtemsTaskReqStart_PreDesc_Suspended[] = {
0276   "Yes",
0277   "No",
0278   "NA"
0279 };
0280 
0281 static const char * const * const RtemsTaskReqStart_PreDesc[] = {
0282   RtemsTaskReqStart_PreDesc_Id,
0283   RtemsTaskReqStart_PreDesc_EntryPoint,
0284   RtemsTaskReqStart_PreDesc_Argument,
0285   RtemsTaskReqStart_PreDesc_Dormant,
0286   RtemsTaskReqStart_PreDesc_Suspended,
0287   NULL
0288 };
0289 
0290 typedef RtemsTaskReqStart_Context Context;
0291 
0292 static void WorkerA( rtems_task_argument arg )
0293 {
0294   Context *ctx;
0295 
0296   ctx = &RtemsTaskReqStart_Instance;
0297 
0298   while ( true ) {
0299     ctx->actual_argument += arg;
0300     ++ctx->counter;
0301     Yield();
0302   }
0303 }
0304 
0305 static void WorkerB( rtems_task_argument arg )
0306 {
0307   Context *ctx;
0308 
0309   ctx = &RtemsTaskReqStart_Instance;
0310 
0311   while ( true ) {
0312     ctx->actual_argument += arg;
0313     Yield();
0314   }
0315 }
0316 
0317 static void ThreadStart( rtems_tcb *executing, rtems_tcb *started )
0318 {
0319   (void) executing;
0320   (void) started;
0321 
0322   ++RtemsTaskReqStart_Instance.start_extension_calls;
0323 }
0324 
0325 static const rtems_extensions_table extensions = {
0326   .thread_start = ThreadStart
0327 };
0328 
0329 static void RtemsTaskReqStart_Pre_Id_Prepare(
0330   RtemsTaskReqStart_Context *ctx,
0331   RtemsTaskReqStart_Pre_Id   state
0332 )
0333 {
0334   switch ( state ) {
0335     case RtemsTaskReqStart_Pre_Id_Invalid: {
0336       /*
0337        * While the ``id`` parameter is not associated with a task.
0338        */
0339       ctx->id = INVALID_ID;
0340       break;
0341     }
0342 
0343     case RtemsTaskReqStart_Pre_Id_Task: {
0344       /*
0345        * While the ``id`` parameter is associated with a task.
0346        */
0347       ctx->id = ctx->worker_id;
0348       break;
0349     }
0350 
0351     case RtemsTaskReqStart_Pre_Id_NA:
0352       break;
0353   }
0354 }
0355 
0356 static void RtemsTaskReqStart_Pre_EntryPoint_Prepare(
0357   RtemsTaskReqStart_Context       *ctx,
0358   RtemsTaskReqStart_Pre_EntryPoint state
0359 )
0360 {
0361   switch ( state ) {
0362     case RtemsTaskReqStart_Pre_EntryPoint_Valid: {
0363       /*
0364        * While the task entry point specified by the ``entry_point`` parameter
0365        * is valid.
0366        */
0367       ctx->entry_point = WorkerA;
0368       break;
0369     }
0370 
0371     case RtemsTaskReqStart_Pre_EntryPoint_Null: {
0372       /*
0373        * While the task entry point specified by the ``entry_point`` parameter
0374        * is equal to NULL.
0375        */
0376       ctx->entry_point = NULL;
0377       break;
0378     }
0379 
0380     case RtemsTaskReqStart_Pre_EntryPoint_NA:
0381       break;
0382   }
0383 }
0384 
0385 static void RtemsTaskReqStart_Pre_Argument_Prepare(
0386   RtemsTaskReqStart_Context     *ctx,
0387   RtemsTaskReqStart_Pre_Argument state
0388 )
0389 {
0390   switch ( state ) {
0391     case RtemsTaskReqStart_Pre_Argument_Pointer: {
0392       /*
0393        * While the entry point argument specified by the ``argument`` parameter
0394        * is a pointer.
0395        */
0396       ctx->argument = (rtems_task_argument) ctx;
0397       break;
0398     }
0399 
0400     case RtemsTaskReqStart_Pre_Argument_Number: {
0401       /*
0402        * While the entry point argument specified by the ``argument`` parameter
0403        * is a 32-bit number.
0404        */
0405       ctx->argument = UINT32_C( 0x87654321 );
0406       break;
0407     }
0408 
0409     case RtemsTaskReqStart_Pre_Argument_NA:
0410       break;
0411   }
0412 }
0413 
0414 static void RtemsTaskReqStart_Pre_Dormant_Prepare(
0415   RtemsTaskReqStart_Context    *ctx,
0416   RtemsTaskReqStart_Pre_Dormant state
0417 )
0418 {
0419   switch ( state ) {
0420     case RtemsTaskReqStart_Pre_Dormant_Yes: {
0421       /*
0422        * While the task specified by the ``id`` parameter is dormant.
0423        */
0424       ctx->start = false;
0425       break;
0426     }
0427 
0428     case RtemsTaskReqStart_Pre_Dormant_No: {
0429       /*
0430        * While the task specified by the ``id`` parameter is not dormant.
0431        */
0432       ctx->start = true;
0433       break;
0434     }
0435 
0436     case RtemsTaskReqStart_Pre_Dormant_NA:
0437       break;
0438   }
0439 }
0440 
0441 static void RtemsTaskReqStart_Pre_Suspended_Prepare(
0442   RtemsTaskReqStart_Context      *ctx,
0443   RtemsTaskReqStart_Pre_Suspended state
0444 )
0445 {
0446   switch ( state ) {
0447     case RtemsTaskReqStart_Pre_Suspended_Yes: {
0448       /*
0449        * While the task specified by the ``id`` parameter is suspended.
0450        */
0451       ctx->suspend = true;
0452       break;
0453     }
0454 
0455     case RtemsTaskReqStart_Pre_Suspended_No: {
0456       /*
0457        * While the task specified by the ``id`` parameter is not suspended.
0458        */
0459       ctx->suspend = false;
0460       break;
0461     }
0462 
0463     case RtemsTaskReqStart_Pre_Suspended_NA:
0464       break;
0465   }
0466 }
0467 
0468 static void RtemsTaskReqStart_Post_Status_Check(
0469   RtemsTaskReqStart_Context    *ctx,
0470   RtemsTaskReqStart_Post_Status state
0471 )
0472 {
0473   switch ( state ) {
0474     case RtemsTaskReqStart_Post_Status_Ok: {
0475       /*
0476        * The return status of rtems_task_start() shall be RTEMS_SUCCESSFUL.
0477        */
0478       T_rsc_success( ctx->status );
0479       break;
0480     }
0481 
0482     case RtemsTaskReqStart_Post_Status_InvAddr: {
0483       /*
0484        * The return status of rtems_task_start() shall be
0485        * RTEMS_INVALID_ADDRESS.
0486        */
0487       T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0488       break;
0489     }
0490 
0491     case RtemsTaskReqStart_Post_Status_InvId: {
0492       /*
0493        * The return status of rtems_task_start() shall be RTEMS_INVALID_ID.
0494        */
0495       T_rsc( ctx->status, RTEMS_INVALID_ID );
0496       break;
0497     }
0498 
0499     case RtemsTaskReqStart_Post_Status_IncStat: {
0500       /*
0501        * The return status of rtems_task_start() shall be
0502        * RTEMS_INCORRECT_STATE.
0503        */
0504       T_rsc( ctx->status, RTEMS_INCORRECT_STATE );
0505       break;
0506     }
0507 
0508     case RtemsTaskReqStart_Post_Status_NA:
0509       break;
0510   }
0511 }
0512 
0513 static void RtemsTaskReqStart_Post_EntryPoint_Check(
0514   RtemsTaskReqStart_Context        *ctx,
0515   RtemsTaskReqStart_Post_EntryPoint state
0516 )
0517 {
0518   switch ( state ) {
0519     case RtemsTaskReqStart_Post_EntryPoint_Set: {
0520       /*
0521        * The entry point of the task specified by the ``id`` parameter shall be
0522        * set to the function specified by the ``entry_point`` parameter before
0523        * the task is unblocked by the rtems_task_start() call.
0524        */
0525       T_eq_u32( ctx->counter, 1 );
0526       break;
0527     }
0528 
0529     case RtemsTaskReqStart_Post_EntryPoint_Nop: {
0530       /*
0531        * No entry point of a task shall be modified by the rtems_task_start()
0532        * call.
0533        */
0534       T_eq_u32( ctx->counter, 0 );
0535       break;
0536     }
0537 
0538     case RtemsTaskReqStart_Post_EntryPoint_NA:
0539       break;
0540   }
0541 }
0542 
0543 static void RtemsTaskReqStart_Post_Argument_Check(
0544   RtemsTaskReqStart_Context      *ctx,
0545   RtemsTaskReqStart_Post_Argument state
0546 )
0547 {
0548   switch ( state ) {
0549     case RtemsTaskReqStart_Post_Argument_Set: {
0550       /*
0551        * The entry point argument of the task specified by the ``id`` parameter
0552        * shall be set to the value specified by the ``argument`` parameter
0553        * before the task is unblocked by the rtems_task_start() call.
0554        */
0555       T_eq_u32( ctx->actual_argument, ctx->argument );
0556       break;
0557     }
0558 
0559     case RtemsTaskReqStart_Post_Argument_Nop: {
0560       /*
0561        * No entry point argument of a task shall be modified by the
0562        * rtems_task_start() call.
0563        */
0564       T_eq_u32( ctx->actual_argument, 0 );
0565       break;
0566     }
0567 
0568     case RtemsTaskReqStart_Post_Argument_NA:
0569       break;
0570   }
0571 }
0572 
0573 static void RtemsTaskReqStart_Post_Unblock_Check(
0574   RtemsTaskReqStart_Context     *ctx,
0575   RtemsTaskReqStart_Post_Unblock state
0576 )
0577 {
0578   switch ( state ) {
0579     case RtemsTaskReqStart_Post_Unblock_Yes: {
0580       /*
0581        * The task specified by the ``id`` parameter shall be unblocked by the
0582        * rtems_task_start() call.
0583        */
0584       T_eq_sz( ctx->scheduler_log.header.recorded, 1 );
0585       T_eq_int(
0586         ctx->scheduler_log.events[ 0 ].operation,
0587         T_SCHEDULER_UNBLOCK
0588       );
0589       break;
0590     }
0591 
0592     case RtemsTaskReqStart_Post_Unblock_Nop: {
0593       /*
0594        * No task shall be unblocked by the rtems_task_start() call.
0595        */
0596       T_eq_sz( ctx->scheduler_log.header.recorded, 0 );
0597       break;
0598     }
0599 
0600     case RtemsTaskReqStart_Post_Unblock_NA:
0601       break;
0602   }
0603 }
0604 
0605 static void RtemsTaskReqStart_Post_StartExtensions_Check(
0606   RtemsTaskReqStart_Context             *ctx,
0607   RtemsTaskReqStart_Post_StartExtensions state
0608 )
0609 {
0610   switch ( state ) {
0611     case RtemsTaskReqStart_Post_StartExtensions_Yes: {
0612       /*
0613        * The thread start user extensions shall be invoked by the
0614        * rtems_task_start() call.
0615        */
0616       T_eq_u32( ctx->start_extension_calls, 1 );
0617       break;
0618     }
0619 
0620     case RtemsTaskReqStart_Post_StartExtensions_Nop: {
0621       /*
0622        * The thread start user extensions shall not be invoked by the
0623        * rtems_task_start() call.
0624        */
0625       T_eq_u32( ctx->start_extension_calls, 0 );
0626       break;
0627     }
0628 
0629     case RtemsTaskReqStart_Post_StartExtensions_NA:
0630       break;
0631   }
0632 }
0633 
0634 static void RtemsTaskReqStart_Setup( RtemsTaskReqStart_Context *ctx )
0635 {
0636   rtems_status_code sc;
0637 
0638   sc = rtems_extension_create(
0639     rtems_build_name( 'T', 'E', 'S', 'T' ),
0640     &extensions,
0641     &ctx->extension_id
0642   );
0643   T_rsc_success( sc );
0644 }
0645 
0646 static void RtemsTaskReqStart_Setup_Wrap( void *arg )
0647 {
0648   RtemsTaskReqStart_Context *ctx;
0649 
0650   ctx = arg;
0651   ctx->Map.in_action_loop = false;
0652   RtemsTaskReqStart_Setup( ctx );
0653 }
0654 
0655 static void RtemsTaskReqStart_Teardown( RtemsTaskReqStart_Context *ctx )
0656 {
0657   rtems_status_code sc;
0658 
0659   sc = rtems_extension_delete( ctx->extension_id );
0660   T_rsc_success( sc );
0661 }
0662 
0663 static void RtemsTaskReqStart_Teardown_Wrap( void *arg )
0664 {
0665   RtemsTaskReqStart_Context *ctx;
0666 
0667   ctx = arg;
0668   ctx->Map.in_action_loop = false;
0669   RtemsTaskReqStart_Teardown( ctx );
0670 }
0671 
0672 static void RtemsTaskReqStart_Prepare( RtemsTaskReqStart_Context *ctx )
0673 {
0674   ctx->actual_argument = 0;
0675   ctx->counter = 0;
0676   ctx->worker_id = CreateTask( "WORK", PRIO_DEFAULT );
0677 }
0678 
0679 static void RtemsTaskReqStart_Action( RtemsTaskReqStart_Context *ctx )
0680 {
0681   T_scheduler_log *log;
0682 
0683   if ( ctx->start ) {
0684     StartTask( ctx->worker_id, WorkerB, 0 );
0685   }
0686 
0687   if ( ctx->suspend ) {
0688     SuspendTask( ctx->worker_id );
0689   }
0690 
0691   ctx->start_extension_calls = 0;
0692 
0693   log = T_scheduler_record_2( &ctx->scheduler_log );
0694   T_null( log );
0695 
0696   ctx->status = rtems_task_start( ctx->id, ctx->entry_point, ctx->argument );
0697 
0698   log = T_scheduler_record( NULL );
0699   T_eq_ptr( &log->header, &ctx->scheduler_log.header );
0700 
0701   Yield();
0702 }
0703 
0704 static void RtemsTaskReqStart_Cleanup( RtemsTaskReqStart_Context *ctx )
0705 {
0706   DeleteTask( ctx->worker_id );
0707 }
0708 
0709 static const RtemsTaskReqStart_Entry
0710 RtemsTaskReqStart_Entries[] = {
0711   { 0, 0, 0, 0, 0, 0, RtemsTaskReqStart_Post_Status_InvAddr,
0712     RtemsTaskReqStart_Post_EntryPoint_Nop, RtemsTaskReqStart_Post_Argument_Nop,
0713     RtemsTaskReqStart_Post_Unblock_Nop,
0714     RtemsTaskReqStart_Post_StartExtensions_Nop },
0715   { 0, 0, 0, 0, 1, 1, RtemsTaskReqStart_Post_Status_InvId,
0716     RtemsTaskReqStart_Post_EntryPoint_Nop, RtemsTaskReqStart_Post_Argument_Nop,
0717     RtemsTaskReqStart_Post_Unblock_Nop,
0718     RtemsTaskReqStart_Post_StartExtensions_Nop },
0719   { 0, 0, 0, 0, 0, 0, RtemsTaskReqStart_Post_Status_Ok,
0720     RtemsTaskReqStart_Post_EntryPoint_Set, RtemsTaskReqStart_Post_Argument_Set,
0721     RtemsTaskReqStart_Post_Unblock_Yes,
0722     RtemsTaskReqStart_Post_StartExtensions_Yes },
0723   { 0, 0, 0, 0, 0, 0, RtemsTaskReqStart_Post_Status_IncStat,
0724     RtemsTaskReqStart_Post_EntryPoint_Nop, RtemsTaskReqStart_Post_Argument_Nop,
0725     RtemsTaskReqStart_Post_Unblock_Nop,
0726     RtemsTaskReqStart_Post_StartExtensions_Nop }
0727 };
0728 
0729 static const uint8_t
0730 RtemsTaskReqStart_Map[] = {
0731   1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 0, 0,
0732   0, 0, 0, 0, 0, 0
0733 };
0734 
0735 static size_t RtemsTaskReqStart_Scope( void *arg, char *buf, size_t n )
0736 {
0737   RtemsTaskReqStart_Context *ctx;
0738 
0739   ctx = arg;
0740 
0741   if ( ctx->Map.in_action_loop ) {
0742     return T_get_scope( RtemsTaskReqStart_PreDesc, buf, n, ctx->Map.pcs );
0743   }
0744 
0745   return 0;
0746 }
0747 
0748 static T_fixture RtemsTaskReqStart_Fixture = {
0749   .setup = RtemsTaskReqStart_Setup_Wrap,
0750   .stop = NULL,
0751   .teardown = RtemsTaskReqStart_Teardown_Wrap,
0752   .scope = RtemsTaskReqStart_Scope,
0753   .initial_context = &RtemsTaskReqStart_Instance
0754 };
0755 
0756 static inline RtemsTaskReqStart_Entry RtemsTaskReqStart_PopEntry(
0757   RtemsTaskReqStart_Context *ctx
0758 )
0759 {
0760   size_t index;
0761 
0762   index = ctx->Map.index;
0763   ctx->Map.index = index + 1;
0764   return RtemsTaskReqStart_Entries[
0765     RtemsTaskReqStart_Map[ index ]
0766   ];
0767 }
0768 
0769 static void RtemsTaskReqStart_SetPreConditionStates(
0770   RtemsTaskReqStart_Context *ctx
0771 )
0772 {
0773   ctx->Map.pcs[ 0 ] = ctx->Map.pci[ 0 ];
0774   ctx->Map.pcs[ 1 ] = ctx->Map.pci[ 1 ];
0775   ctx->Map.pcs[ 2 ] = ctx->Map.pci[ 2 ];
0776 
0777   if ( ctx->Map.entry.Pre_Dormant_NA ) {
0778     ctx->Map.pcs[ 3 ] = RtemsTaskReqStart_Pre_Dormant_NA;
0779   } else {
0780     ctx->Map.pcs[ 3 ] = ctx->Map.pci[ 3 ];
0781   }
0782 
0783   if ( ctx->Map.entry.Pre_Suspended_NA ) {
0784     ctx->Map.pcs[ 4 ] = RtemsTaskReqStart_Pre_Suspended_NA;
0785   } else {
0786     ctx->Map.pcs[ 4 ] = ctx->Map.pci[ 4 ];
0787   }
0788 }
0789 
0790 static void RtemsTaskReqStart_TestVariant( RtemsTaskReqStart_Context *ctx )
0791 {
0792   RtemsTaskReqStart_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 0 ] );
0793   RtemsTaskReqStart_Pre_EntryPoint_Prepare( ctx, ctx->Map.pcs[ 1 ] );
0794   RtemsTaskReqStart_Pre_Argument_Prepare( ctx, ctx->Map.pcs[ 2 ] );
0795   RtemsTaskReqStart_Pre_Dormant_Prepare( ctx, ctx->Map.pcs[ 3 ] );
0796   RtemsTaskReqStart_Pre_Suspended_Prepare( ctx, ctx->Map.pcs[ 4 ] );
0797   RtemsTaskReqStart_Action( ctx );
0798   RtemsTaskReqStart_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
0799   RtemsTaskReqStart_Post_EntryPoint_Check(
0800     ctx,
0801     ctx->Map.entry.Post_EntryPoint
0802   );
0803   RtemsTaskReqStart_Post_Argument_Check( ctx, ctx->Map.entry.Post_Argument );
0804   RtemsTaskReqStart_Post_Unblock_Check( ctx, ctx->Map.entry.Post_Unblock );
0805   RtemsTaskReqStart_Post_StartExtensions_Check(
0806     ctx,
0807     ctx->Map.entry.Post_StartExtensions
0808   );
0809 }
0810 
0811 /**
0812  * @fn void T_case_body_RtemsTaskReqStart( void )
0813  */
0814 T_TEST_CASE_FIXTURE( RtemsTaskReqStart, &RtemsTaskReqStart_Fixture )
0815 {
0816   RtemsTaskReqStart_Context *ctx;
0817 
0818   ctx = T_fixture_context();
0819   ctx->Map.in_action_loop = true;
0820   ctx->Map.index = 0;
0821 
0822   for (
0823     ctx->Map.pci[ 0 ] = RtemsTaskReqStart_Pre_Id_Invalid;
0824     ctx->Map.pci[ 0 ] < RtemsTaskReqStart_Pre_Id_NA;
0825     ++ctx->Map.pci[ 0 ]
0826   ) {
0827     for (
0828       ctx->Map.pci[ 1 ] = RtemsTaskReqStart_Pre_EntryPoint_Valid;
0829       ctx->Map.pci[ 1 ] < RtemsTaskReqStart_Pre_EntryPoint_NA;
0830       ++ctx->Map.pci[ 1 ]
0831     ) {
0832       for (
0833         ctx->Map.pci[ 2 ] = RtemsTaskReqStart_Pre_Argument_Pointer;
0834         ctx->Map.pci[ 2 ] < RtemsTaskReqStart_Pre_Argument_NA;
0835         ++ctx->Map.pci[ 2 ]
0836       ) {
0837         for (
0838           ctx->Map.pci[ 3 ] = RtemsTaskReqStart_Pre_Dormant_Yes;
0839           ctx->Map.pci[ 3 ] < RtemsTaskReqStart_Pre_Dormant_NA;
0840           ++ctx->Map.pci[ 3 ]
0841         ) {
0842           for (
0843             ctx->Map.pci[ 4 ] = RtemsTaskReqStart_Pre_Suspended_Yes;
0844             ctx->Map.pci[ 4 ] < RtemsTaskReqStart_Pre_Suspended_NA;
0845             ++ctx->Map.pci[ 4 ]
0846           ) {
0847             ctx->Map.entry = RtemsTaskReqStart_PopEntry( ctx );
0848             RtemsTaskReqStart_SetPreConditionStates( ctx );
0849             RtemsTaskReqStart_Prepare( ctx );
0850             RtemsTaskReqStart_TestVariant( ctx );
0851             RtemsTaskReqStart_Cleanup( ctx );
0852           }
0853         }
0854       }
0855     }
0856   }
0857 }
0858 
0859 /** @} */