rtems: Check for NULL config in msgq construct

Since there are already excessive NULL pointer checks in the Classic
API, do this also in rtems_message_queue_construct().

Update #4007.
This commit is contained in:
Sebastian Huber
2021-04-23 08:19:43 +02:00
parent d75b29d95e
commit 03747b5087
2 changed files with 199 additions and 110 deletions

View File

@@ -50,6 +50,10 @@ rtems_status_code rtems_message_queue_construct(
rtems_id *id rtems_id *id
) )
{ {
if ( config == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
return _Message_queue_Create( config, id, _Message_queue_Get_buffers ); return _Message_queue_Create( config, id, _Message_queue_Get_buffers );
} }

View File

@@ -66,6 +66,12 @@
* @{ * @{
*/ */
typedef enum {
RtemsMessageReqConstructErrors_Pre_Config_Valid,
RtemsMessageReqConstructErrors_Pre_Config_Null,
RtemsMessageReqConstructErrors_Pre_Config_NA
} RtemsMessageReqConstructErrors_Pre_Config;
typedef enum { typedef enum {
RtemsMessageReqConstructErrors_Pre_Name_Valid, RtemsMessageReqConstructErrors_Pre_Name_Valid,
RtemsMessageReqConstructErrors_Pre_Name_Invalid, RtemsMessageReqConstructErrors_Pre_Name_Invalid,
@@ -139,7 +145,9 @@ typedef enum {
typedef struct { typedef struct {
rtems_status_code status; rtems_status_code status;
rtems_message_queue_config config; const rtems_message_queue_config *config;
rtems_message_queue_config config_value;
rtems_id *id; rtems_id *id;
@@ -150,7 +158,7 @@ typedef struct {
/** /**
* @brief This member defines the pre-condition states for the next action. * @brief This member defines the pre-condition states for the next action.
*/ */
size_t pcs[ 7 ]; size_t pcs[ 8 ];
/** /**
* @brief This member indicates if the test action loop is currently * @brief This member indicates if the test action loop is currently
@@ -162,6 +170,12 @@ typedef struct {
static RtemsMessageReqConstructErrors_Context static RtemsMessageReqConstructErrors_Context
RtemsMessageReqConstructErrors_Instance; RtemsMessageReqConstructErrors_Instance;
static const char * const RtemsMessageReqConstructErrors_PreDesc_Config[] = {
"Valid",
"Null",
"NA"
};
static const char * const RtemsMessageReqConstructErrors_PreDesc_Name[] = { static const char * const RtemsMessageReqConstructErrors_PreDesc_Name[] = {
"Valid", "Valid",
"Invalid", "Invalid",
@@ -207,6 +221,7 @@ static const char * const RtemsMessageReqConstructErrors_PreDesc_AreaSize[] = {
}; };
static const char * const * const RtemsMessageReqConstructErrors_PreDesc[] = { static const char * const * const RtemsMessageReqConstructErrors_PreDesc[] = {
RtemsMessageReqConstructErrors_PreDesc_Config,
RtemsMessageReqConstructErrors_PreDesc_Name, RtemsMessageReqConstructErrors_PreDesc_Name,
RtemsMessageReqConstructErrors_PreDesc_Id, RtemsMessageReqConstructErrors_PreDesc_Id,
RtemsMessageReqConstructErrors_PreDesc_MaxPending, RtemsMessageReqConstructErrors_PreDesc_MaxPending,
@@ -254,6 +269,34 @@ static rtems_status_code Create( void *arg, uint32_t *id )
return rtems_message_queue_construct( &config, id ); return rtems_message_queue_construct( &config, id );
} }
static void RtemsMessageReqConstructErrors_Pre_Config_Prepare(
RtemsMessageReqConstructErrors_Context *ctx,
RtemsMessageReqConstructErrors_Pre_Config state
)
{
switch ( state ) {
case RtemsMessageReqConstructErrors_Pre_Config_Valid: {
/*
* While the ``config`` parameter references an object of type
* rtems_message_queue_config.
*/
ctx->config = &ctx->config_value;
break;
}
case RtemsMessageReqConstructErrors_Pre_Config_Null: {
/*
* While the ``config`` parameter is NULL.
*/
ctx->config = NULL;
break;
}
case RtemsMessageReqConstructErrors_Pre_Config_NA:
break;
}
}
static void RtemsMessageReqConstructErrors_Pre_Name_Prepare( static void RtemsMessageReqConstructErrors_Pre_Name_Prepare(
RtemsMessageReqConstructErrors_Context *ctx, RtemsMessageReqConstructErrors_Context *ctx,
RtemsMessageReqConstructErrors_Pre_Name state RtemsMessageReqConstructErrors_Pre_Name state
@@ -264,7 +307,7 @@ static void RtemsMessageReqConstructErrors_Pre_Name_Prepare(
/* /*
* While the name of the message queue configuration is valid. * While the name of the message queue configuration is valid.
*/ */
ctx->config.name = NAME; ctx->config_value.name = NAME;
break; break;
} }
@@ -272,7 +315,7 @@ static void RtemsMessageReqConstructErrors_Pre_Name_Prepare(
/* /*
* While the name of the message queue configuration is invalid. * While the name of the message queue configuration is invalid.
*/ */
ctx->config.name = 0; ctx->config_value.name = 0;
break; break;
} }
@@ -319,7 +362,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare(
* While the maximum number of pending messages of the message queue * While the maximum number of pending messages of the message queue
* configuration is valid. * configuration is valid.
*/ */
ctx->config.maximum_pending_messages = MAX_PENDING_MESSAGES; ctx->config_value.maximum_pending_messages = MAX_PENDING_MESSAGES;
break; break;
} }
@@ -328,7 +371,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare(
* While the maximum number of pending messages of the message queue * While the maximum number of pending messages of the message queue
* configuration is zero. * configuration is zero.
*/ */
ctx->config.maximum_pending_messages = 0; ctx->config_value.maximum_pending_messages = 0;
break; break;
} }
@@ -338,7 +381,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare(
* configuration is big enough so that a calculation to get the message * configuration is big enough so that a calculation to get the message
* buffer storage area size overflows. * buffer storage area size overflows.
*/ */
ctx->config.maximum_pending_messages = UINT32_MAX; ctx->config_value.maximum_pending_messages = UINT32_MAX;
break; break;
} }
@@ -358,17 +401,17 @@ static void RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
* While the maximum message size of the message queue configuration is * While the maximum message size of the message queue configuration is
* valid. * valid.
*/ */
if ( ctx->config.maximum_pending_messages == UINT32_MAX ) { if ( ctx->config_value.maximum_pending_messages == UINT32_MAX ) {
/* /*
* At least on 64-bit systems we need a bit of help to ensure that we * At least on 64-bit systems we need a bit of help to ensure that we
* meet the Big state of the MaxPending pre-condition. The following * meet the Big state of the MaxPending pre-condition. The following
* message size is valid with respect to calculations involving only * message size is valid with respect to calculations involving only
* the message size. * the message size.
*/ */
ctx->config.maximum_message_size = SIZE_MAX - sizeof( uintptr_t ) + ctx->config_value.maximum_message_size = SIZE_MAX - sizeof( uintptr_t ) +
1 - sizeof( CORE_message_queue_Buffer ); 1 - sizeof( CORE_message_queue_Buffer );
} else { } else {
ctx->config.maximum_message_size = MAX_MESSAGE_SIZE; ctx->config_value.maximum_message_size = MAX_MESSAGE_SIZE;
} }
break; break;
} }
@@ -378,7 +421,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
* While the maximum message size of the message queue configuration is * While the maximum message size of the message queue configuration is
* zero. * zero.
*/ */
ctx->config.maximum_message_size = 0; ctx->config_value.maximum_message_size = 0;
break; break;
} }
@@ -388,7 +431,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
* big enough so that a calculation to get the message buffer storage * big enough so that a calculation to get the message buffer storage
* area size overflows. * area size overflows.
*/ */
ctx->config.maximum_message_size = SIZE_MAX; ctx->config_value.maximum_message_size = SIZE_MAX;
break; break;
} }
@@ -439,7 +482,7 @@ static void RtemsMessageReqConstructErrors_Pre_Area_Prepare(
* While the message buffer storage area begin pointer of the message * While the message buffer storage area begin pointer of the message
* queue configuration is valid. * queue configuration is valid.
*/ */
ctx->config.storage_area = buffers; ctx->config_value.storage_area = buffers;
break; break;
} }
@@ -448,7 +491,7 @@ static void RtemsMessageReqConstructErrors_Pre_Area_Prepare(
* While the message buffer storage area begin pointer of the message * While the message buffer storage area begin pointer of the message
* queue configuration is NULL. * queue configuration is NULL.
*/ */
ctx->config.storage_area = NULL; ctx->config_value.storage_area = NULL;
break; break;
} }
@@ -468,7 +511,7 @@ static void RtemsMessageReqConstructErrors_Pre_AreaSize_Prepare(
* While the message buffer storage area size of the message queue * While the message buffer storage area size of the message queue
* configuration is valid. * configuration is valid.
*/ */
ctx->config.storage_size = sizeof( buffers ); ctx->config_value.storage_size = sizeof( buffers );
break; break;
} }
@@ -477,7 +520,7 @@ static void RtemsMessageReqConstructErrors_Pre_AreaSize_Prepare(
* While the message buffer storage area size of the message queue * While the message buffer storage area size of the message queue
* configuration is invalid. * configuration is invalid.
*/ */
ctx->config.storage_size = SIZE_MAX; ctx->config_value.storage_size = SIZE_MAX;
break; break;
} }
@@ -632,14 +675,14 @@ static void RtemsMessageReqConstructErrors_Prepare(
) )
{ {
ctx->id_value = INVALID_ID; ctx->id_value = INVALID_ID;
memset( &ctx->config, 0, sizeof( ctx->config ) ); memset( &ctx->config_value, 0, sizeof( ctx->config_value ) );
} }
static void RtemsMessageReqConstructErrors_Action( static void RtemsMessageReqConstructErrors_Action(
RtemsMessageReqConstructErrors_Context *ctx RtemsMessageReqConstructErrors_Context *ctx
) )
{ {
ctx->status = rtems_message_queue_construct( &ctx->config, ctx->id ); ctx->status = rtems_message_queue_construct( ctx->config, ctx->id );
} }
static void RtemsMessageReqConstructErrors_Cleanup( static void RtemsMessageReqConstructErrors_Cleanup(
@@ -660,6 +703,7 @@ static void RtemsMessageReqConstructErrors_Cleanup(
typedef struct { typedef struct {
uint16_t Skip : 1; uint16_t Skip : 1;
uint16_t Pre_Config_NA : 1;
uint16_t Pre_Name_NA : 1; uint16_t Pre_Name_NA : 1;
uint16_t Pre_Id_NA : 1; uint16_t Pre_Id_NA : 1;
uint16_t Pre_MaxPending_NA : 1; uint16_t Pre_MaxPending_NA : 1;
@@ -674,25 +718,31 @@ typedef struct {
static const RtemsMessageReqConstructErrors_Entry static const RtemsMessageReqConstructErrors_Entry
RtemsMessageReqConstructErrors_Entries[] = { RtemsMessageReqConstructErrors_Entries[] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_InvName, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_InvAddr,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_InvAddr, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_InvName,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_InvNum, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_InvNum,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_InvSize, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_InvSize,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_TooMany, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_TooMany,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_Unsat, { 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsMessageReqConstructErrors_Post_Status_Unsat,
RtemsMessageReqConstructErrors_Post_Name_Invalid, RtemsMessageReqConstructErrors_Post_Name_Invalid,
RtemsMessageReqConstructErrors_Post_IdVar_Nop }, RtemsMessageReqConstructErrors_Post_IdVar_Nop },
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_Ok, { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsMessageReqConstructErrors_Post_Status_Ok,
RtemsMessageReqConstructErrors_Post_Name_Valid, RtemsMessageReqConstructErrors_Post_Name_Valid,
RtemsMessageReqConstructErrors_Post_IdVar_Set } RtemsMessageReqConstructErrors_Post_IdVar_Set }
}; };
@@ -701,16 +751,27 @@ static const uint8_t
RtemsMessageReqConstructErrors_Map[] = { RtemsMessageReqConstructErrors_Map[] = {
6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 2, 2, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
}; };
static size_t RtemsMessageReqConstructErrors_Scope( static size_t RtemsMessageReqConstructErrors_Scope(
@@ -768,14 +829,33 @@ T_TEST_CASE_FIXTURE(
index = 0; index = 0;
for ( for (
ctx->pcs[ 0 ] = RtemsMessageReqConstructErrors_Pre_Name_Valid; ctx->pcs[ 0 ] = RtemsMessageReqConstructErrors_Pre_Config_Valid;
ctx->pcs[ 0 ] < RtemsMessageReqConstructErrors_Pre_Name_NA; ctx->pcs[ 0 ] < RtemsMessageReqConstructErrors_Pre_Config_NA;
++ctx->pcs[ 0 ] ++ctx->pcs[ 0 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_Config_NA ) {
ctx->pcs[ 0 ] = RtemsMessageReqConstructErrors_Pre_Config_NA;
index += ( RtemsMessageReqConstructErrors_Pre_Config_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_Name_NA
* RtemsMessageReqConstructErrors_Pre_Id_NA
* RtemsMessageReqConstructErrors_Pre_MaxPending_NA
* RtemsMessageReqConstructErrors_Pre_MaxSize_NA
* RtemsMessageReqConstructErrors_Pre_Free_NA
* RtemsMessageReqConstructErrors_Pre_Area_NA
* RtemsMessageReqConstructErrors_Pre_AreaSize_NA;
}
for (
ctx->pcs[ 1 ] = RtemsMessageReqConstructErrors_Pre_Name_Valid;
ctx->pcs[ 1 ] < RtemsMessageReqConstructErrors_Pre_Name_NA;
++ctx->pcs[ 1 ]
) {
entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_Name_NA ) { if ( entry.Pre_Name_NA ) {
ctx->pcs[ 0 ] = RtemsMessageReqConstructErrors_Pre_Name_NA; ctx->pcs[ 1 ] = RtemsMessageReqConstructErrors_Pre_Name_NA;
index += ( RtemsMessageReqConstructErrors_Pre_Name_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_Name_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_Id_NA * RtemsMessageReqConstructErrors_Pre_Id_NA
* RtemsMessageReqConstructErrors_Pre_MaxPending_NA * RtemsMessageReqConstructErrors_Pre_MaxPending_NA
@@ -786,14 +866,14 @@ T_TEST_CASE_FIXTURE(
} }
for ( for (
ctx->pcs[ 1 ] = RtemsMessageReqConstructErrors_Pre_Id_Id; ctx->pcs[ 2 ] = RtemsMessageReqConstructErrors_Pre_Id_Id;
ctx->pcs[ 1 ] < RtemsMessageReqConstructErrors_Pre_Id_NA; ctx->pcs[ 2 ] < RtemsMessageReqConstructErrors_Pre_Id_NA;
++ctx->pcs[ 1 ] ++ctx->pcs[ 2 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_Id_NA ) { if ( entry.Pre_Id_NA ) {
ctx->pcs[ 1 ] = RtemsMessageReqConstructErrors_Pre_Id_NA; ctx->pcs[ 2 ] = RtemsMessageReqConstructErrors_Pre_Id_NA;
index += ( RtemsMessageReqConstructErrors_Pre_Id_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_Id_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_MaxPending_NA * RtemsMessageReqConstructErrors_Pre_MaxPending_NA
* RtemsMessageReqConstructErrors_Pre_MaxSize_NA * RtemsMessageReqConstructErrors_Pre_MaxSize_NA
@@ -803,14 +883,14 @@ T_TEST_CASE_FIXTURE(
} }
for ( for (
ctx->pcs[ 2 ] = RtemsMessageReqConstructErrors_Pre_MaxPending_Valid; ctx->pcs[ 3 ] = RtemsMessageReqConstructErrors_Pre_MaxPending_Valid;
ctx->pcs[ 2 ] < RtemsMessageReqConstructErrors_Pre_MaxPending_NA; ctx->pcs[ 3 ] < RtemsMessageReqConstructErrors_Pre_MaxPending_NA;
++ctx->pcs[ 2 ] ++ctx->pcs[ 3 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_MaxPending_NA ) { if ( entry.Pre_MaxPending_NA ) {
ctx->pcs[ 2 ] = RtemsMessageReqConstructErrors_Pre_MaxPending_NA; ctx->pcs[ 3 ] = RtemsMessageReqConstructErrors_Pre_MaxPending_NA;
index += ( RtemsMessageReqConstructErrors_Pre_MaxPending_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_MaxPending_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_MaxSize_NA * RtemsMessageReqConstructErrors_Pre_MaxSize_NA
* RtemsMessageReqConstructErrors_Pre_Free_NA * RtemsMessageReqConstructErrors_Pre_Free_NA
@@ -819,14 +899,14 @@ T_TEST_CASE_FIXTURE(
} }
for ( for (
ctx->pcs[ 3 ] = RtemsMessageReqConstructErrors_Pre_MaxSize_Valid; ctx->pcs[ 4 ] = RtemsMessageReqConstructErrors_Pre_MaxSize_Valid;
ctx->pcs[ 3 ] < RtemsMessageReqConstructErrors_Pre_MaxSize_NA; ctx->pcs[ 4 ] < RtemsMessageReqConstructErrors_Pre_MaxSize_NA;
++ctx->pcs[ 3 ] ++ctx->pcs[ 4 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_MaxSize_NA ) { if ( entry.Pre_MaxSize_NA ) {
ctx->pcs[ 3 ] = RtemsMessageReqConstructErrors_Pre_MaxSize_NA; ctx->pcs[ 4 ] = RtemsMessageReqConstructErrors_Pre_MaxSize_NA;
index += ( RtemsMessageReqConstructErrors_Pre_MaxSize_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_MaxSize_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_Free_NA * RtemsMessageReqConstructErrors_Pre_Free_NA
* RtemsMessageReqConstructErrors_Pre_Area_NA * RtemsMessageReqConstructErrors_Pre_Area_NA
@@ -834,41 +914,41 @@ T_TEST_CASE_FIXTURE(
} }
for ( for (
ctx->pcs[ 4 ] = RtemsMessageReqConstructErrors_Pre_Free_Yes; ctx->pcs[ 5 ] = RtemsMessageReqConstructErrors_Pre_Free_Yes;
ctx->pcs[ 4 ] < RtemsMessageReqConstructErrors_Pre_Free_NA; ctx->pcs[ 5 ] < RtemsMessageReqConstructErrors_Pre_Free_NA;
++ctx->pcs[ 4 ] ++ctx->pcs[ 5 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_Free_NA ) { if ( entry.Pre_Free_NA ) {
ctx->pcs[ 4 ] = RtemsMessageReqConstructErrors_Pre_Free_NA; ctx->pcs[ 5 ] = RtemsMessageReqConstructErrors_Pre_Free_NA;
index += ( RtemsMessageReqConstructErrors_Pre_Free_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_Free_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_Area_NA * RtemsMessageReqConstructErrors_Pre_Area_NA
* RtemsMessageReqConstructErrors_Pre_AreaSize_NA; * RtemsMessageReqConstructErrors_Pre_AreaSize_NA;
} }
for ( for (
ctx->pcs[ 5 ] = RtemsMessageReqConstructErrors_Pre_Area_Valid; ctx->pcs[ 6 ] = RtemsMessageReqConstructErrors_Pre_Area_Valid;
ctx->pcs[ 5 ] < RtemsMessageReqConstructErrors_Pre_Area_NA; ctx->pcs[ 6 ] < RtemsMessageReqConstructErrors_Pre_Area_NA;
++ctx->pcs[ 5 ] ++ctx->pcs[ 6 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_Area_NA ) { if ( entry.Pre_Area_NA ) {
ctx->pcs[ 5 ] = RtemsMessageReqConstructErrors_Pre_Area_NA; ctx->pcs[ 6 ] = RtemsMessageReqConstructErrors_Pre_Area_NA;
index += ( RtemsMessageReqConstructErrors_Pre_Area_NA - 1 ) index += ( RtemsMessageReqConstructErrors_Pre_Area_NA - 1 )
* RtemsMessageReqConstructErrors_Pre_AreaSize_NA; * RtemsMessageReqConstructErrors_Pre_AreaSize_NA;
} }
for ( for (
ctx->pcs[ 6 ] = RtemsMessageReqConstructErrors_Pre_AreaSize_Valid; ctx->pcs[ 7 ] = RtemsMessageReqConstructErrors_Pre_AreaSize_Valid;
ctx->pcs[ 6 ] < RtemsMessageReqConstructErrors_Pre_AreaSize_NA; ctx->pcs[ 7 ] < RtemsMessageReqConstructErrors_Pre_AreaSize_NA;
++ctx->pcs[ 6 ] ++ctx->pcs[ 7 ]
) { ) {
entry = RtemsMessageReqConstructErrors_GetEntry( index ); entry = RtemsMessageReqConstructErrors_GetEntry( index );
if ( entry.Pre_AreaSize_NA ) { if ( entry.Pre_AreaSize_NA ) {
ctx->pcs[ 6 ] = RtemsMessageReqConstructErrors_Pre_AreaSize_NA; ctx->pcs[ 7 ] = RtemsMessageReqConstructErrors_Pre_AreaSize_NA;
index += ( RtemsMessageReqConstructErrors_Pre_AreaSize_NA - 1 ); index += ( RtemsMessageReqConstructErrors_Pre_AreaSize_NA - 1 );
} }
@@ -878,34 +958,38 @@ T_TEST_CASE_FIXTURE(
} }
RtemsMessageReqConstructErrors_Prepare( ctx ); RtemsMessageReqConstructErrors_Prepare( ctx );
RtemsMessageReqConstructErrors_Pre_Name_Prepare( RtemsMessageReqConstructErrors_Pre_Config_Prepare(
ctx, ctx,
ctx->pcs[ 0 ] ctx->pcs[ 0 ]
); );
RtemsMessageReqConstructErrors_Pre_Id_Prepare( RtemsMessageReqConstructErrors_Pre_Name_Prepare(
ctx, ctx,
ctx->pcs[ 1 ] ctx->pcs[ 1 ]
); );
RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare( RtemsMessageReqConstructErrors_Pre_Id_Prepare(
ctx, ctx,
ctx->pcs[ 2 ] ctx->pcs[ 2 ]
); );
RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare( RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare(
ctx, ctx,
ctx->pcs[ 3 ] ctx->pcs[ 3 ]
); );
RtemsMessageReqConstructErrors_Pre_Free_Prepare( RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
ctx, ctx,
ctx->pcs[ 4 ] ctx->pcs[ 4 ]
); );
RtemsMessageReqConstructErrors_Pre_Area_Prepare( RtemsMessageReqConstructErrors_Pre_Free_Prepare(
ctx, ctx,
ctx->pcs[ 5 ] ctx->pcs[ 5 ]
); );
RtemsMessageReqConstructErrors_Pre_AreaSize_Prepare( RtemsMessageReqConstructErrors_Pre_Area_Prepare(
ctx, ctx,
ctx->pcs[ 6 ] ctx->pcs[ 6 ]
); );
RtemsMessageReqConstructErrors_Pre_AreaSize_Prepare(
ctx,
ctx->pcs[ 7 ]
);
RtemsMessageReqConstructErrors_Action( ctx ); RtemsMessageReqConstructErrors_Action( ctx );
RtemsMessageReqConstructErrors_Post_Status_Check( RtemsMessageReqConstructErrors_Post_Status_Check(
ctx, ctx,
@@ -929,5 +1013,6 @@ T_TEST_CASE_FIXTURE(
} }
} }
} }
}
/** @} */ /** @} */