Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RtemsBarrierReqCreate
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 <string.h>
0057 
0058 #include "tx-support.h"
0059 
0060 #include <rtems/test.h>
0061 
0062 /**
0063  * @defgroup RtemsBarrierReqCreate spec:/rtems/barrier/req/create
0064  *
0065  * @ingroup TestsuitesValidationNoClock0
0066  *
0067  * @{
0068  */
0069 
0070 typedef enum {
0071   RtemsBarrierReqCreate_Pre_Name_Valid,
0072   RtemsBarrierReqCreate_Pre_Name_Invalid,
0073   RtemsBarrierReqCreate_Pre_Name_NA
0074 } RtemsBarrierReqCreate_Pre_Name;
0075 
0076 typedef enum {
0077   RtemsBarrierReqCreate_Pre_Id_Valid,
0078   RtemsBarrierReqCreate_Pre_Id_Null,
0079   RtemsBarrierReqCreate_Pre_Id_NA
0080 } RtemsBarrierReqCreate_Pre_Id;
0081 
0082 typedef enum {
0083   RtemsBarrierReqCreate_Pre_Class_Default,
0084   RtemsBarrierReqCreate_Pre_Class_Manual,
0085   RtemsBarrierReqCreate_Pre_Class_Auto,
0086   RtemsBarrierReqCreate_Pre_Class_NA
0087 } RtemsBarrierReqCreate_Pre_Class;
0088 
0089 typedef enum {
0090   RtemsBarrierReqCreate_Pre_MaxWait_Zero,
0091   RtemsBarrierReqCreate_Pre_MaxWait_Positive,
0092   RtemsBarrierReqCreate_Pre_MaxWait_NA
0093 } RtemsBarrierReqCreate_Pre_MaxWait;
0094 
0095 typedef enum {
0096   RtemsBarrierReqCreate_Pre_Free_Yes,
0097   RtemsBarrierReqCreate_Pre_Free_No,
0098   RtemsBarrierReqCreate_Pre_Free_NA
0099 } RtemsBarrierReqCreate_Pre_Free;
0100 
0101 typedef enum {
0102   RtemsBarrierReqCreate_Post_Status_Ok,
0103   RtemsBarrierReqCreate_Post_Status_InvName,
0104   RtemsBarrierReqCreate_Post_Status_InvAddr,
0105   RtemsBarrierReqCreate_Post_Status_InvNum,
0106   RtemsBarrierReqCreate_Post_Status_TooMany,
0107   RtemsBarrierReqCreate_Post_Status_NA
0108 } RtemsBarrierReqCreate_Post_Status;
0109 
0110 typedef enum {
0111   RtemsBarrierReqCreate_Post_Name_Valid,
0112   RtemsBarrierReqCreate_Post_Name_Invalid,
0113   RtemsBarrierReqCreate_Post_Name_NA
0114 } RtemsBarrierReqCreate_Post_Name;
0115 
0116 typedef enum {
0117   RtemsBarrierReqCreate_Post_Class_Manual,
0118   RtemsBarrierReqCreate_Post_Class_Auto,
0119   RtemsBarrierReqCreate_Post_Class_NA
0120 } RtemsBarrierReqCreate_Post_Class;
0121 
0122 typedef enum {
0123   RtemsBarrierReqCreate_Post_IdVar_Set,
0124   RtemsBarrierReqCreate_Post_IdVar_Nop,
0125   RtemsBarrierReqCreate_Post_IdVar_NA
0126 } RtemsBarrierReqCreate_Post_IdVar;
0127 
0128 typedef struct {
0129   uint16_t Skip : 1;
0130   uint16_t Pre_Name_NA : 1;
0131   uint16_t Pre_Id_NA : 1;
0132   uint16_t Pre_Class_NA : 1;
0133   uint16_t Pre_MaxWait_NA : 1;
0134   uint16_t Pre_Free_NA : 1;
0135   uint16_t Post_Status : 3;
0136   uint16_t Post_Name : 2;
0137   uint16_t Post_Class : 2;
0138   uint16_t Post_IdVar : 2;
0139 } RtemsBarrierReqCreate_Entry;
0140 
0141 /**
0142  * @brief Test context for spec:/rtems/barrier/req/create test case.
0143  */
0144 typedef struct {
0145   void *seized_objects;
0146 
0147   rtems_id worker_id;
0148 
0149   rtems_id id_value;
0150 
0151   uint32_t release_done;
0152 
0153   uint32_t release_expected;
0154 
0155   rtems_name name;
0156 
0157   rtems_attribute attribute_set;
0158 
0159   uint32_t maximum_waiters;
0160 
0161   rtems_id *id;
0162 
0163   rtems_status_code status;
0164 
0165   struct {
0166     /**
0167      * @brief This member defines the pre-condition states for the next action.
0168      */
0169     size_t pcs[ 5 ];
0170 
0171     /**
0172      * @brief If this member is true, then the test action loop is executed.
0173      */
0174     bool in_action_loop;
0175 
0176     /**
0177      * @brief This member contains the next transition map index.
0178      */
0179     size_t index;
0180 
0181     /**
0182      * @brief This member contains the current transition map entry.
0183      */
0184     RtemsBarrierReqCreate_Entry entry;
0185 
0186     /**
0187      * @brief If this member is true, then the current transition variant
0188      *   should be skipped.
0189      */
0190     bool skip;
0191   } Map;
0192 } RtemsBarrierReqCreate_Context;
0193 
0194 static RtemsBarrierReqCreate_Context
0195   RtemsBarrierReqCreate_Instance;
0196 
0197 static const char * const RtemsBarrierReqCreate_PreDesc_Name[] = {
0198   "Valid",
0199   "Invalid",
0200   "NA"
0201 };
0202 
0203 static const char * const RtemsBarrierReqCreate_PreDesc_Id[] = {
0204   "Valid",
0205   "Null",
0206   "NA"
0207 };
0208 
0209 static const char * const RtemsBarrierReqCreate_PreDesc_Class[] = {
0210   "Default",
0211   "Manual",
0212   "Auto",
0213   "NA"
0214 };
0215 
0216 static const char * const RtemsBarrierReqCreate_PreDesc_MaxWait[] = {
0217   "Zero",
0218   "Positive",
0219   "NA"
0220 };
0221 
0222 static const char * const RtemsBarrierReqCreate_PreDesc_Free[] = {
0223   "Yes",
0224   "No",
0225   "NA"
0226 };
0227 
0228 static const char * const * const RtemsBarrierReqCreate_PreDesc[] = {
0229   RtemsBarrierReqCreate_PreDesc_Name,
0230   RtemsBarrierReqCreate_PreDesc_Id,
0231   RtemsBarrierReqCreate_PreDesc_Class,
0232   RtemsBarrierReqCreate_PreDesc_MaxWait,
0233   RtemsBarrierReqCreate_PreDesc_Free,
0234   NULL
0235 };
0236 
0237 #define NAME rtems_build_name( 'T', 'E', 'S', 'T' )
0238 
0239 typedef RtemsBarrierReqCreate_Context Context;
0240 
0241 static void Worker( rtems_task_argument arg )
0242 {
0243   Context *ctx;
0244 
0245   ctx = (Context *) arg;
0246 
0247   while ( true ) {
0248     rtems_status_code sc;
0249     uint32_t          released;
0250 
0251     ++ctx->release_done;
0252 
0253     released = 0;
0254     sc = rtems_barrier_release( ctx->id_value, &released );
0255     T_rsc_success( sc );
0256     T_eq_u32( released, 1 );
0257   }
0258 }
0259 
0260 static rtems_status_code Create( void *arg, uint32_t *id )
0261 {
0262   return rtems_barrier_create(
0263     rtems_build_name( 'S', 'I', 'Z', 'E' ),
0264     RTEMS_DEFAULT_ATTRIBUTES,
0265     0,
0266     id
0267   );
0268 }
0269 
0270 static void RtemsBarrierReqCreate_Pre_Name_Prepare(
0271   RtemsBarrierReqCreate_Context *ctx,
0272   RtemsBarrierReqCreate_Pre_Name state
0273 )
0274 {
0275   switch ( state ) {
0276     case RtemsBarrierReqCreate_Pre_Name_Valid: {
0277       /*
0278        * While the ``name`` parameter is valid.
0279        */
0280       ctx->name = NAME;
0281       break;
0282     }
0283 
0284     case RtemsBarrierReqCreate_Pre_Name_Invalid: {
0285       /*
0286        * While the ``name`` parameter is invalid.
0287        */
0288       ctx->name = 0;
0289       break;
0290     }
0291 
0292     case RtemsBarrierReqCreate_Pre_Name_NA:
0293       break;
0294   }
0295 }
0296 
0297 static void RtemsBarrierReqCreate_Pre_Id_Prepare(
0298   RtemsBarrierReqCreate_Context *ctx,
0299   RtemsBarrierReqCreate_Pre_Id   state
0300 )
0301 {
0302   switch ( state ) {
0303     case RtemsBarrierReqCreate_Pre_Id_Valid: {
0304       /*
0305        * While the ``id`` parameter references an object of type rtems_id.
0306        */
0307       ctx->id = &ctx->id_value;
0308       break;
0309     }
0310 
0311     case RtemsBarrierReqCreate_Pre_Id_Null: {
0312       /*
0313        * While the ``id`` parameter is NULL.
0314        */
0315       ctx->id = NULL;
0316       break;
0317     }
0318 
0319     case RtemsBarrierReqCreate_Pre_Id_NA:
0320       break;
0321   }
0322 }
0323 
0324 static void RtemsBarrierReqCreate_Pre_Class_Prepare(
0325   RtemsBarrierReqCreate_Context  *ctx,
0326   RtemsBarrierReqCreate_Pre_Class state
0327 )
0328 {
0329   switch ( state ) {
0330     case RtemsBarrierReqCreate_Pre_Class_Default: {
0331       /*
0332        * While the ``attribute_set`` parameter specifies the default class.
0333        */
0334       /* Nothing to do */
0335       break;
0336     }
0337 
0338     case RtemsBarrierReqCreate_Pre_Class_Manual: {
0339       /*
0340        * While the ``attribute_set`` parameter specifies the manual release
0341        * class.
0342        */
0343       ctx->attribute_set |= RTEMS_BARRIER_MANUAL_RELEASE;
0344       break;
0345     }
0346 
0347     case RtemsBarrierReqCreate_Pre_Class_Auto: {
0348       /*
0349        * While the ``attribute_set`` parameter specifies the automatic release
0350        * class.
0351        */
0352       ctx->attribute_set |= RTEMS_BARRIER_AUTOMATIC_RELEASE;
0353       break;
0354     }
0355 
0356     case RtemsBarrierReqCreate_Pre_Class_NA:
0357       break;
0358   }
0359 }
0360 
0361 static void RtemsBarrierReqCreate_Pre_MaxWait_Prepare(
0362   RtemsBarrierReqCreate_Context    *ctx,
0363   RtemsBarrierReqCreate_Pre_MaxWait state
0364 )
0365 {
0366   switch ( state ) {
0367     case RtemsBarrierReqCreate_Pre_MaxWait_Zero: {
0368       /*
0369        * While the ``maximum_waiters`` parameter is zero.
0370        */
0371       ctx->maximum_waiters = 0;
0372       break;
0373     }
0374 
0375     case RtemsBarrierReqCreate_Pre_MaxWait_Positive: {
0376       /*
0377        * While the ``maximum_waiters`` parameter is positive.
0378        */
0379       ctx->maximum_waiters = 1;
0380       break;
0381     }
0382 
0383     case RtemsBarrierReqCreate_Pre_MaxWait_NA:
0384       break;
0385   }
0386 }
0387 
0388 static void RtemsBarrierReqCreate_Pre_Free_Prepare(
0389   RtemsBarrierReqCreate_Context *ctx,
0390   RtemsBarrierReqCreate_Pre_Free state
0391 )
0392 {
0393   switch ( state ) {
0394     case RtemsBarrierReqCreate_Pre_Free_Yes: {
0395       /*
0396        * While the system has at least one inactive barrier object available.
0397        */
0398       /* Nothing to do */
0399       break;
0400     }
0401 
0402     case RtemsBarrierReqCreate_Pre_Free_No: {
0403       /*
0404        * While the system has no inactive barrier object available.
0405        */
0406       ctx->seized_objects = T_seize_objects( Create, NULL );
0407       break;
0408     }
0409 
0410     case RtemsBarrierReqCreate_Pre_Free_NA:
0411       break;
0412   }
0413 }
0414 
0415 static void RtemsBarrierReqCreate_Post_Status_Check(
0416   RtemsBarrierReqCreate_Context    *ctx,
0417   RtemsBarrierReqCreate_Post_Status state
0418 )
0419 {
0420   switch ( state ) {
0421     case RtemsBarrierReqCreate_Post_Status_Ok: {
0422       /*
0423        * The return status of rtems_barrier_create() shall be RTEMS_SUCCESSFUL.
0424        */
0425       T_rsc_success( ctx->status );
0426       break;
0427     }
0428 
0429     case RtemsBarrierReqCreate_Post_Status_InvName: {
0430       /*
0431        * The return status of rtems_barrier_create() shall be
0432        * RTEMS_INVALID_NAME.
0433        */
0434       T_rsc( ctx->status, RTEMS_INVALID_NAME );
0435       break;
0436     }
0437 
0438     case RtemsBarrierReqCreate_Post_Status_InvAddr: {
0439       /*
0440        * The return status of rtems_barrier_create() shall be
0441        * RTEMS_INVALID_ADDRESS.
0442        */
0443       T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0444       break;
0445     }
0446 
0447     case RtemsBarrierReqCreate_Post_Status_InvNum: {
0448       /*
0449        * The return status of rtems_barrier_create() shall be
0450        * RTEMS_INVALID_NUMBER.
0451        */
0452       T_rsc( ctx->status, RTEMS_INVALID_NUMBER );
0453       break;
0454     }
0455 
0456     case RtemsBarrierReqCreate_Post_Status_TooMany: {
0457       /*
0458        * The return status of rtems_barrier_create() shall be RTEMS_TOO_MANY.
0459        */
0460       T_rsc( ctx->status, RTEMS_TOO_MANY );
0461       break;
0462     }
0463 
0464     case RtemsBarrierReqCreate_Post_Status_NA:
0465       break;
0466   }
0467 }
0468 
0469 static void RtemsBarrierReqCreate_Post_Name_Check(
0470   RtemsBarrierReqCreate_Context  *ctx,
0471   RtemsBarrierReqCreate_Post_Name state
0472 )
0473 {
0474   rtems_status_code sc;
0475   rtems_id          id;
0476 
0477   switch ( state ) {
0478     case RtemsBarrierReqCreate_Post_Name_Valid: {
0479       /*
0480        * The unique object name shall identify the barrier created by the
0481        * rtems_barrier_create() call.
0482        */
0483       id = 0;
0484       sc = rtems_barrier_ident( NAME, &id );
0485       T_rsc_success( sc );
0486       T_eq_u32( id, ctx->id_value );
0487       break;
0488     }
0489 
0490     case RtemsBarrierReqCreate_Post_Name_Invalid: {
0491       /*
0492        * The unique object name shall not identify a barrier.
0493        */
0494       sc = rtems_barrier_ident( NAME, &id );
0495       T_rsc( sc, RTEMS_INVALID_NAME );
0496       break;
0497     }
0498 
0499     case RtemsBarrierReqCreate_Post_Name_NA:
0500       break;
0501   }
0502 }
0503 
0504 static void RtemsBarrierReqCreate_Post_Class_Check(
0505   RtemsBarrierReqCreate_Context   *ctx,
0506   RtemsBarrierReqCreate_Post_Class state
0507 )
0508 {
0509   rtems_status_code sc;
0510 
0511   switch ( state ) {
0512     case RtemsBarrierReqCreate_Post_Class_Manual: {
0513       /*
0514        * The class of the barrier created by the rtems_barrier_create() call
0515        * shall be manual release.
0516        */
0517       sc = rtems_barrier_wait( ctx->id_value, RTEMS_NO_TIMEOUT );
0518       T_rsc_success( sc );
0519 
0520       ++ctx->release_expected;
0521       T_eq_u32( ctx->release_done, ctx->release_expected );
0522       break;
0523     }
0524 
0525     case RtemsBarrierReqCreate_Post_Class_Auto: {
0526       /*
0527        * The class of the barrier created by the rtems_barrier_create() call
0528        * shall be automatic release.
0529        */
0530       sc = rtems_barrier_wait( ctx->id_value, RTEMS_NO_TIMEOUT );
0531       T_rsc_success( sc );
0532 
0533       T_eq_u32( ctx->release_done, ctx->release_expected );
0534       break;
0535     }
0536 
0537     case RtemsBarrierReqCreate_Post_Class_NA:
0538       break;
0539   }
0540 }
0541 
0542 static void RtemsBarrierReqCreate_Post_IdVar_Check(
0543   RtemsBarrierReqCreate_Context   *ctx,
0544   RtemsBarrierReqCreate_Post_IdVar state
0545 )
0546 {
0547   switch ( state ) {
0548     case RtemsBarrierReqCreate_Post_IdVar_Set: {
0549       /*
0550        * The value of the object referenced by the ``id`` parameter shall be
0551        * set to the object identifier of the created barrier after the return
0552        * of the rtems_barrier_create() call.
0553        */
0554       T_eq_ptr( ctx->id, &ctx->id_value );
0555       T_ne_u32( ctx->id_value, INVALID_ID );
0556       break;
0557     }
0558 
0559     case RtemsBarrierReqCreate_Post_IdVar_Nop: {
0560       /*
0561        * Objects referenced by the ``id`` parameter in past calls to
0562        * rtems_barrier_create() shall not be accessed by the
0563        * rtems_barrier_create() call.
0564        */
0565       T_eq_u32( ctx->id_value, INVALID_ID );
0566       break;
0567     }
0568 
0569     case RtemsBarrierReqCreate_Post_IdVar_NA:
0570       break;
0571   }
0572 }
0573 
0574 static void RtemsBarrierReqCreate_Setup( RtemsBarrierReqCreate_Context *ctx )
0575 {
0576   memset( ctx, 0, sizeof( *ctx ) );
0577   ctx->id_value = INVALID_ID;
0578   ctx->worker_id = CreateTask( "WORK", PRIO_LOW );
0579   StartTask( ctx->worker_id, Worker, ctx );
0580 }
0581 
0582 static void RtemsBarrierReqCreate_Setup_Wrap( void *arg )
0583 {
0584   RtemsBarrierReqCreate_Context *ctx;
0585 
0586   ctx = arg;
0587   ctx->Map.in_action_loop = false;
0588   RtemsBarrierReqCreate_Setup( ctx );
0589 }
0590 
0591 static void RtemsBarrierReqCreate_Teardown(
0592   RtemsBarrierReqCreate_Context *ctx
0593 )
0594 {
0595   DeleteTask( ctx->worker_id );
0596 }
0597 
0598 static void RtemsBarrierReqCreate_Teardown_Wrap( void *arg )
0599 {
0600   RtemsBarrierReqCreate_Context *ctx;
0601 
0602   ctx = arg;
0603   ctx->Map.in_action_loop = false;
0604   RtemsBarrierReqCreate_Teardown( ctx );
0605 }
0606 
0607 static void RtemsBarrierReqCreate_Action( RtemsBarrierReqCreate_Context *ctx )
0608 {
0609   ctx->status = rtems_barrier_create(
0610     ctx->name,
0611     ctx->attribute_set,
0612     ctx->maximum_waiters,
0613     ctx->id
0614   );
0615 }
0616 
0617 static void RtemsBarrierReqCreate_Cleanup( RtemsBarrierReqCreate_Context *ctx )
0618 {
0619   if ( ctx->id_value != INVALID_ID ) {
0620     rtems_status_code sc;
0621 
0622     sc = rtems_barrier_delete( ctx->id_value );
0623     T_rsc_success( sc );
0624 
0625     ctx->id_value = INVALID_ID;
0626   }
0627 
0628   T_surrender_objects( &ctx->seized_objects, rtems_barrier_delete );
0629 }
0630 
0631 static const RtemsBarrierReqCreate_Entry
0632 RtemsBarrierReqCreate_Entries[] = {
0633   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_InvName,
0634     RtemsBarrierReqCreate_Post_Name_Invalid,
0635     RtemsBarrierReqCreate_Post_Class_NA, RtemsBarrierReqCreate_Post_IdVar_Nop },
0636   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_InvAddr,
0637     RtemsBarrierReqCreate_Post_Name_Invalid,
0638     RtemsBarrierReqCreate_Post_Class_NA, RtemsBarrierReqCreate_Post_IdVar_Nop },
0639   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_TooMany,
0640     RtemsBarrierReqCreate_Post_Name_Invalid,
0641     RtemsBarrierReqCreate_Post_Class_NA, RtemsBarrierReqCreate_Post_IdVar_Nop },
0642   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_Ok,
0643     RtemsBarrierReqCreate_Post_Name_Valid,
0644     RtemsBarrierReqCreate_Post_Class_Manual,
0645     RtemsBarrierReqCreate_Post_IdVar_Set },
0646   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_InvNum,
0647     RtemsBarrierReqCreate_Post_Name_Invalid,
0648     RtemsBarrierReqCreate_Post_Class_NA, RtemsBarrierReqCreate_Post_IdVar_Nop },
0649   { 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_Ok,
0650     RtemsBarrierReqCreate_Post_Name_Valid,
0651     RtemsBarrierReqCreate_Post_Class_Auto, RtemsBarrierReqCreate_Post_IdVar_Set }
0652 };
0653 
0654 static const uint8_t
0655 RtemsBarrierReqCreate_Map[] = {
0656   3, 2, 3, 2, 3, 2, 3, 2, 4, 4, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
0657   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0658 };
0659 
0660 static size_t RtemsBarrierReqCreate_Scope( void *arg, char *buf, size_t n )
0661 {
0662   RtemsBarrierReqCreate_Context *ctx;
0663 
0664   ctx = arg;
0665 
0666   if ( ctx->Map.in_action_loop ) {
0667     return T_get_scope( RtemsBarrierReqCreate_PreDesc, buf, n, ctx->Map.pcs );
0668   }
0669 
0670   return 0;
0671 }
0672 
0673 static T_fixture RtemsBarrierReqCreate_Fixture = {
0674   .setup = RtemsBarrierReqCreate_Setup_Wrap,
0675   .stop = NULL,
0676   .teardown = RtemsBarrierReqCreate_Teardown_Wrap,
0677   .scope = RtemsBarrierReqCreate_Scope,
0678   .initial_context = &RtemsBarrierReqCreate_Instance
0679 };
0680 
0681 static inline RtemsBarrierReqCreate_Entry RtemsBarrierReqCreate_PopEntry(
0682   RtemsBarrierReqCreate_Context *ctx
0683 )
0684 {
0685   size_t index;
0686 
0687   index = ctx->Map.index;
0688   ctx->Map.index = index + 1;
0689   return RtemsBarrierReqCreate_Entries[
0690     RtemsBarrierReqCreate_Map[ index ]
0691   ];
0692 }
0693 
0694 static void RtemsBarrierReqCreate_TestVariant(
0695   RtemsBarrierReqCreate_Context *ctx
0696 )
0697 {
0698   RtemsBarrierReqCreate_Pre_Name_Prepare( ctx, ctx->Map.pcs[ 0 ] );
0699   RtemsBarrierReqCreate_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 1 ] );
0700   RtemsBarrierReqCreate_Pre_Class_Prepare( ctx, ctx->Map.pcs[ 2 ] );
0701   RtemsBarrierReqCreate_Pre_MaxWait_Prepare( ctx, ctx->Map.pcs[ 3 ] );
0702   RtemsBarrierReqCreate_Pre_Free_Prepare( ctx, ctx->Map.pcs[ 4 ] );
0703   RtemsBarrierReqCreate_Action( ctx );
0704   RtemsBarrierReqCreate_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
0705   RtemsBarrierReqCreate_Post_Name_Check( ctx, ctx->Map.entry.Post_Name );
0706   RtemsBarrierReqCreate_Post_Class_Check( ctx, ctx->Map.entry.Post_Class );
0707   RtemsBarrierReqCreate_Post_IdVar_Check( ctx, ctx->Map.entry.Post_IdVar );
0708 }
0709 
0710 /**
0711  * @fn void T_case_body_RtemsBarrierReqCreate( void )
0712  */
0713 T_TEST_CASE_FIXTURE( RtemsBarrierReqCreate, &RtemsBarrierReqCreate_Fixture )
0714 {
0715   RtemsBarrierReqCreate_Context *ctx;
0716 
0717   ctx = T_fixture_context();
0718   ctx->Map.in_action_loop = true;
0719   ctx->Map.index = 0;
0720 
0721   for (
0722     ctx->Map.pcs[ 0 ] = RtemsBarrierReqCreate_Pre_Name_Valid;
0723     ctx->Map.pcs[ 0 ] < RtemsBarrierReqCreate_Pre_Name_NA;
0724     ++ctx->Map.pcs[ 0 ]
0725   ) {
0726     for (
0727       ctx->Map.pcs[ 1 ] = RtemsBarrierReqCreate_Pre_Id_Valid;
0728       ctx->Map.pcs[ 1 ] < RtemsBarrierReqCreate_Pre_Id_NA;
0729       ++ctx->Map.pcs[ 1 ]
0730     ) {
0731       for (
0732         ctx->Map.pcs[ 2 ] = RtemsBarrierReqCreate_Pre_Class_Default;
0733         ctx->Map.pcs[ 2 ] < RtemsBarrierReqCreate_Pre_Class_NA;
0734         ++ctx->Map.pcs[ 2 ]
0735       ) {
0736         for (
0737           ctx->Map.pcs[ 3 ] = RtemsBarrierReqCreate_Pre_MaxWait_Zero;
0738           ctx->Map.pcs[ 3 ] < RtemsBarrierReqCreate_Pre_MaxWait_NA;
0739           ++ctx->Map.pcs[ 3 ]
0740         ) {
0741           for (
0742             ctx->Map.pcs[ 4 ] = RtemsBarrierReqCreate_Pre_Free_Yes;
0743             ctx->Map.pcs[ 4 ] < RtemsBarrierReqCreate_Pre_Free_NA;
0744             ++ctx->Map.pcs[ 4 ]
0745           ) {
0746             ctx->Map.entry = RtemsBarrierReqCreate_PopEntry( ctx );
0747             RtemsBarrierReqCreate_TestVariant( ctx );
0748             RtemsBarrierReqCreate_Cleanup( ctx );
0749           }
0750         }
0751       }
0752     }
0753   }
0754 }
0755 
0756 /** @} */