summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-16 12:41:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-02 08:54:58 +0200
commita93d0ce2f58f2f85b7cb8e57daeba9a0a1c58291 (patch)
tree33c9e2137f77c35e4b60b3176656988cdd380423
parent34099baa9c8fcb5fc8f7e375bc47ccd86e6fa8dd (diff)
downloadrtems-a93d0ce2f58f2f85b7cb8e57daeba9a0a1c58291.tar.bz2
validation: Improve generated test code
Move the transition map members of the test context to a dedicated structure. Move the transition variant pre-condition prepare, action, and post-condition checks to a separate function to reduce the indentation level and allow skipping of transition variants.
-rw-r--r--testsuites/validation/tc-barrier-create.c147
-rw-r--r--testsuites/validation/tc-barrier-delete.c101
-rw-r--r--testsuites/validation/tc-barrier-release.c136
-rw-r--r--testsuites/validation/tc-barrier-wait.c132
-rw-r--r--testsuites/validation/tc-intr-clear.c112
-rw-r--r--testsuites/validation/tc-intr-entry-install.c243
-rw-r--r--testsuites/validation/tc-intr-entry-remove.c267
-rw-r--r--testsuites/validation/tc-intr-get-affinity.c152
-rw-r--r--testsuites/validation/tc-intr-get-attributes.c117
-rw-r--r--testsuites/validation/tc-intr-handler-iterate.c139
-rw-r--r--testsuites/validation/tc-intr-is-pending.c130
-rw-r--r--testsuites/validation/tc-intr-raise-on.c125
-rw-r--r--testsuites/validation/tc-intr-raise.c112
-rw-r--r--testsuites/validation/tc-intr-set-affinity.c152
-rw-r--r--testsuites/validation/tc-intr-vector-disable.c145
-rw-r--r--testsuites/validation/tc-intr-vector-enable.c147
-rw-r--r--testsuites/validation/tc-intr-vector-is-enabled.c141
-rw-r--r--testsuites/validation/tc-signal-catch.c150
-rw-r--r--testsuites/validation/tc-signal-send.c147
-rw-r--r--testsuites/validation/tc-task-create-errors.c215
20 files changed, 1679 insertions, 1331 deletions
diff --git a/testsuites/validation/tc-barrier-create.c b/testsuites/validation/tc-barrier-create.c
index 25841df2a0..628d1a4a09 100644
--- a/testsuites/validation/tc-barrier-create.c
+++ b/testsuites/validation/tc-barrier-create.c
@@ -125,6 +125,19 @@ typedef enum {
RtemsBarrierReqCreate_Post_IdVar_NA
} RtemsBarrierReqCreate_Post_IdVar;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Name_NA : 1;
+ uint16_t Pre_Id_NA : 1;
+ uint16_t Pre_Class_NA : 1;
+ uint16_t Pre_MaxWait_NA : 1;
+ uint16_t Pre_Free_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_Name : 2;
+ uint16_t Post_Class : 2;
+ uint16_t Post_IdVar : 2;
+} RtemsBarrierReqCreate_Entry;
+
/**
* @brief Test context for spec:/rtems/barrier/req/create test case.
*/
@@ -149,16 +162,33 @@ typedef struct {
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 5 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 5 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsBarrierReqCreate_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsBarrierReqCreate_Context;
static RtemsBarrierReqCreate_Context
@@ -554,7 +584,7 @@ static void RtemsBarrierReqCreate_Setup_Wrap( void *arg )
RtemsBarrierReqCreate_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqCreate_Setup( ctx );
}
@@ -570,7 +600,7 @@ static void RtemsBarrierReqCreate_Teardown_Wrap( void *arg )
RtemsBarrierReqCreate_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqCreate_Teardown( ctx );
}
@@ -598,19 +628,6 @@ static void RtemsBarrierReqCreate_Cleanup( RtemsBarrierReqCreate_Context *ctx )
T_surrender_objects( &ctx->seized_objects, rtems_barrier_delete );
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Name_NA : 1;
- uint16_t Pre_Id_NA : 1;
- uint16_t Pre_Class_NA : 1;
- uint16_t Pre_MaxWait_NA : 1;
- uint16_t Pre_Free_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_Name : 2;
- uint16_t Post_Class : 2;
- uint16_t Post_IdVar : 2;
-} RtemsBarrierReqCreate_Entry;
-
static const RtemsBarrierReqCreate_Entry
RtemsBarrierReqCreate_Entries[] = {
{ 0, 0, 0, 0, 0, 0, RtemsBarrierReqCreate_Post_Status_InvName,
@@ -646,8 +663,8 @@ static size_t RtemsBarrierReqCreate_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsBarrierReqCreate_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsBarrierReqCreate_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -661,67 +678,73 @@ static T_fixture RtemsBarrierReqCreate_Fixture = {
.initial_context = &RtemsBarrierReqCreate_Instance
};
-static inline RtemsBarrierReqCreate_Entry RtemsBarrierReqCreate_GetEntry(
- size_t index
+static inline RtemsBarrierReqCreate_Entry RtemsBarrierReqCreate_PopEntry(
+ RtemsBarrierReqCreate_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsBarrierReqCreate_Entries[
RtemsBarrierReqCreate_Map[ index ]
];
}
+static void RtemsBarrierReqCreate_TestVariant(
+ RtemsBarrierReqCreate_Context *ctx
+)
+{
+ RtemsBarrierReqCreate_Pre_Name_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsBarrierReqCreate_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsBarrierReqCreate_Pre_Class_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsBarrierReqCreate_Pre_MaxWait_Prepare( ctx, ctx->Map.pcs[ 3 ] );
+ RtemsBarrierReqCreate_Pre_Free_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsBarrierReqCreate_Action( ctx );
+ RtemsBarrierReqCreate_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsBarrierReqCreate_Post_Name_Check( ctx, ctx->Map.entry.Post_Name );
+ RtemsBarrierReqCreate_Post_Class_Check( ctx, ctx->Map.entry.Post_Class );
+ RtemsBarrierReqCreate_Post_IdVar_Check( ctx, ctx->Map.entry.Post_IdVar );
+}
+
/**
* @fn void T_case_body_RtemsBarrierReqCreate( void )
*/
T_TEST_CASE_FIXTURE( RtemsBarrierReqCreate, &RtemsBarrierReqCreate_Fixture )
{
RtemsBarrierReqCreate_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqCreate_Pre_Name_Valid;
- ctx->pcs[ 0 ] < RtemsBarrierReqCreate_Pre_Name_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsBarrierReqCreate_Pre_Name_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsBarrierReqCreate_Pre_Name_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsBarrierReqCreate_Pre_Id_Valid;
- ctx->pcs[ 1 ] < RtemsBarrierReqCreate_Pre_Id_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsBarrierReqCreate_Pre_Id_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsBarrierReqCreate_Pre_Id_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsBarrierReqCreate_Pre_Class_Default;
- ctx->pcs[ 2 ] < RtemsBarrierReqCreate_Pre_Class_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsBarrierReqCreate_Pre_Class_Default;
+ ctx->Map.pcs[ 2 ] < RtemsBarrierReqCreate_Pre_Class_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsBarrierReqCreate_Pre_MaxWait_Zero;
- ctx->pcs[ 3 ] < RtemsBarrierReqCreate_Pre_MaxWait_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsBarrierReqCreate_Pre_MaxWait_Zero;
+ ctx->Map.pcs[ 3 ] < RtemsBarrierReqCreate_Pre_MaxWait_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsBarrierReqCreate_Pre_Free_Yes;
- ctx->pcs[ 4 ] < RtemsBarrierReqCreate_Pre_Free_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsBarrierReqCreate_Pre_Free_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsBarrierReqCreate_Pre_Free_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
- RtemsBarrierReqCreate_Entry entry;
-
- entry = RtemsBarrierReqCreate_GetEntry( index );
- ++index;
-
- RtemsBarrierReqCreate_Pre_Name_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsBarrierReqCreate_Pre_Id_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsBarrierReqCreate_Pre_Class_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsBarrierReqCreate_Pre_MaxWait_Prepare( ctx, ctx->pcs[ 3 ] );
- RtemsBarrierReqCreate_Pre_Free_Prepare( ctx, ctx->pcs[ 4 ] );
- RtemsBarrierReqCreate_Action( ctx );
- RtemsBarrierReqCreate_Post_Status_Check( ctx, entry.Post_Status );
- RtemsBarrierReqCreate_Post_Name_Check( ctx, entry.Post_Name );
- RtemsBarrierReqCreate_Post_Class_Check( ctx, entry.Post_Class );
- RtemsBarrierReqCreate_Post_IdVar_Check( ctx, entry.Post_IdVar );
+ ctx->Map.entry = RtemsBarrierReqCreate_PopEntry( ctx );
+ RtemsBarrierReqCreate_TestVariant( ctx );
RtemsBarrierReqCreate_Cleanup( ctx );
}
}
diff --git a/testsuites/validation/tc-barrier-delete.c b/testsuites/validation/tc-barrier-delete.c
index e51a910b5f..df974fd374 100644
--- a/testsuites/validation/tc-barrier-delete.c
+++ b/testsuites/validation/tc-barrier-delete.c
@@ -91,6 +91,14 @@ typedef enum {
RtemsBarrierReqDelete_Post_Flush_NA
} RtemsBarrierReqDelete_Post_Flush;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Id_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_Name : 2;
+ uint8_t Post_Flush : 2;
+} RtemsBarrierReqDelete_Entry;
+
/**
* @brief Test context for spec:/rtems/barrier/req/delete test case.
*/
@@ -107,16 +115,33 @@ typedef struct {
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 1 ];
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 1 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsBarrierReqDelete_Entry entry;
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsBarrierReqDelete_Context;
static RtemsBarrierReqDelete_Context
@@ -300,7 +325,7 @@ static void RtemsBarrierReqDelete_Setup_Wrap( void *arg )
RtemsBarrierReqDelete_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqDelete_Setup( ctx );
}
@@ -317,7 +342,7 @@ static void RtemsBarrierReqDelete_Teardown_Wrap( void *arg )
RtemsBarrierReqDelete_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqDelete_Teardown( ctx );
}
@@ -349,14 +374,6 @@ static void RtemsBarrierReqDelete_Cleanup( RtemsBarrierReqDelete_Context *ctx )
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Id_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_Name : 2;
- uint8_t Post_Flush : 2;
-} RtemsBarrierReqDelete_Entry;
-
static const RtemsBarrierReqDelete_Entry
RtemsBarrierReqDelete_Entries[] = {
{ 0, 0, RtemsBarrierReqDelete_Post_Status_InvId,
@@ -377,8 +394,8 @@ static size_t RtemsBarrierReqDelete_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsBarrierReqDelete_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsBarrierReqDelete_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -392,43 +409,49 @@ static T_fixture RtemsBarrierReqDelete_Fixture = {
.initial_context = &RtemsBarrierReqDelete_Instance
};
-static inline RtemsBarrierReqDelete_Entry RtemsBarrierReqDelete_GetEntry(
- size_t index
+static inline RtemsBarrierReqDelete_Entry RtemsBarrierReqDelete_PopEntry(
+ RtemsBarrierReqDelete_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsBarrierReqDelete_Entries[
RtemsBarrierReqDelete_Map[ index ]
];
}
+static void RtemsBarrierReqDelete_TestVariant(
+ RtemsBarrierReqDelete_Context *ctx
+)
+{
+ RtemsBarrierReqDelete_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsBarrierReqDelete_Action( ctx );
+ RtemsBarrierReqDelete_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsBarrierReqDelete_Post_Name_Check( ctx, ctx->Map.entry.Post_Name );
+ RtemsBarrierReqDelete_Post_Flush_Check( ctx, ctx->Map.entry.Post_Flush );
+}
+
/**
* @fn void T_case_body_RtemsBarrierReqDelete( void )
*/
T_TEST_CASE_FIXTURE( RtemsBarrierReqDelete, &RtemsBarrierReqDelete_Fixture )
{
RtemsBarrierReqDelete_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqDelete_Pre_Id_NoObj;
- ctx->pcs[ 0 ] < RtemsBarrierReqDelete_Pre_Id_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsBarrierReqDelete_Pre_Id_NoObj;
+ ctx->Map.pcs[ 0 ] < RtemsBarrierReqDelete_Pre_Id_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
- RtemsBarrierReqDelete_Entry entry;
-
- entry = RtemsBarrierReqDelete_GetEntry( index );
- ++index;
-
+ ctx->Map.entry = RtemsBarrierReqDelete_PopEntry( ctx );
RtemsBarrierReqDelete_Prepare( ctx );
- RtemsBarrierReqDelete_Pre_Id_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsBarrierReqDelete_Action( ctx );
- RtemsBarrierReqDelete_Post_Status_Check( ctx, entry.Post_Status );
- RtemsBarrierReqDelete_Post_Name_Check( ctx, entry.Post_Name );
- RtemsBarrierReqDelete_Post_Flush_Check( ctx, entry.Post_Flush );
+ RtemsBarrierReqDelete_TestVariant( ctx );
RtemsBarrierReqDelete_Cleanup( ctx );
}
}
diff --git a/testsuites/validation/tc-barrier-release.c b/testsuites/validation/tc-barrier-release.c
index c9edac06a5..de77e22027 100644
--- a/testsuites/validation/tc-barrier-release.c
+++ b/testsuites/validation/tc-barrier-release.c
@@ -100,6 +100,15 @@ typedef enum {
RtemsBarrierReqRelease_Post_ReleasedVar_NA
} RtemsBarrierReqRelease_Post_ReleasedVar;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Id_NA : 1;
+ uint8_t Pre_Released_NA : 1;
+ uint8_t Pre_Waiting_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_ReleasedVar : 2;
+} RtemsBarrierReqRelease_Entry;
+
/**
* @brief Test context for spec:/rtems/barrier/req/release test case.
*/
@@ -120,16 +129,33 @@ typedef struct {
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsBarrierReqRelease_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsBarrierReqRelease_Context;
static RtemsBarrierReqRelease_Context
@@ -384,7 +410,7 @@ static void RtemsBarrierReqRelease_Setup_Wrap( void *arg )
RtemsBarrierReqRelease_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqRelease_Setup( ctx );
}
@@ -414,7 +440,7 @@ static void RtemsBarrierReqRelease_Teardown_Wrap( void *arg )
RtemsBarrierReqRelease_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqRelease_Teardown( ctx );
}
@@ -425,15 +451,6 @@ static void RtemsBarrierReqRelease_Action(
ctx->status = rtems_barrier_release( ctx->id, ctx->released );
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Id_NA : 1;
- uint8_t Pre_Released_NA : 1;
- uint8_t Pre_Waiting_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_ReleasedVar : 2;
-} RtemsBarrierReqRelease_Entry;
-
static const RtemsBarrierReqRelease_Entry
RtemsBarrierReqRelease_Entries[] = {
{ 0, 0, 0, 1, RtemsBarrierReqRelease_Post_Status_InvAddr,
@@ -455,8 +472,8 @@ static size_t RtemsBarrierReqRelease_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsBarrierReqRelease_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsBarrierReqRelease_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -470,64 +487,65 @@ static T_fixture RtemsBarrierReqRelease_Fixture = {
.initial_context = &RtemsBarrierReqRelease_Instance
};
-static inline RtemsBarrierReqRelease_Entry RtemsBarrierReqRelease_GetEntry(
- size_t index
+static inline RtemsBarrierReqRelease_Entry RtemsBarrierReqRelease_PopEntry(
+ RtemsBarrierReqRelease_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsBarrierReqRelease_Entries[
RtemsBarrierReqRelease_Map[ index ]
];
}
+static void RtemsBarrierReqRelease_TestVariant(
+ RtemsBarrierReqRelease_Context *ctx
+)
+{
+ RtemsBarrierReqRelease_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsBarrierReqRelease_Pre_Released_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsBarrierReqRelease_Pre_Waiting_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Waiting_NA ? RtemsBarrierReqRelease_Pre_Waiting_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsBarrierReqRelease_Action( ctx );
+ RtemsBarrierReqRelease_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsBarrierReqRelease_Post_ReleasedVar_Check(
+ ctx,
+ ctx->Map.entry.Post_ReleasedVar
+ );
+}
+
/**
* @fn void T_case_body_RtemsBarrierReqRelease( void )
*/
T_TEST_CASE_FIXTURE( RtemsBarrierReqRelease, &RtemsBarrierReqRelease_Fixture )
{
RtemsBarrierReqRelease_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Id_NoObj;
- ctx->pcs[ 0 ] < RtemsBarrierReqRelease_Pre_Id_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Id_NoObj;
+ ctx->Map.pcs[ 0 ] < RtemsBarrierReqRelease_Pre_Id_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsBarrierReqRelease_Pre_Released_Valid;
- ctx->pcs[ 1 ] < RtemsBarrierReqRelease_Pre_Released_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsBarrierReqRelease_Pre_Released_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsBarrierReqRelease_Pre_Released_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsBarrierReqRelease_Pre_Waiting_Zero;
- ctx->pcs[ 2 ] < RtemsBarrierReqRelease_Pre_Waiting_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsBarrierReqRelease_Pre_Waiting_Zero;
+ ctx->Map.pcs[ 2 ] < RtemsBarrierReqRelease_Pre_Waiting_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsBarrierReqRelease_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsBarrierReqRelease_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_Waiting_NA ) {
- ctx->pcs[ 2 ] = RtemsBarrierReqRelease_Pre_Waiting_NA;
- }
-
- RtemsBarrierReqRelease_Pre_Id_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsBarrierReqRelease_Pre_Released_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsBarrierReqRelease_Pre_Waiting_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsBarrierReqRelease_Action( ctx );
- RtemsBarrierReqRelease_Post_Status_Check( ctx, entry.Post_Status );
- RtemsBarrierReqRelease_Post_ReleasedVar_Check(
- ctx,
- entry.Post_ReleasedVar
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsBarrierReqRelease_PopEntry( ctx );
+ RtemsBarrierReqRelease_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-barrier-wait.c b/testsuites/validation/tc-barrier-wait.c
index 6776dc0e11..54632cf7ca 100644
--- a/testsuites/validation/tc-barrier-wait.c
+++ b/testsuites/validation/tc-barrier-wait.c
@@ -97,6 +97,14 @@ typedef enum {
RtemsBarrierReqWait_Post_Status_NA
} RtemsBarrierReqWait_Post_Status;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Id_NA : 1;
+ uint8_t Pre_Timeout_NA : 1;
+ uint8_t Pre_Satisfy_NA : 1;
+ uint8_t Post_Status : 3;
+} RtemsBarrierReqWait_Entry;
+
/**
* @brief Test context for spec:/rtems/barrier/req/wait test case.
*/
@@ -117,16 +125,33 @@ typedef struct {
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsBarrierReqWait_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsBarrierReqWait_Context;
static RtemsBarrierReqWait_Context
@@ -432,7 +457,7 @@ static void RtemsBarrierReqWait_Setup_Wrap( void *arg )
RtemsBarrierReqWait_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqWait_Setup( ctx );
}
@@ -461,7 +486,7 @@ static void RtemsBarrierReqWait_Teardown_Wrap( void *arg )
RtemsBarrierReqWait_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsBarrierReqWait_Teardown( ctx );
}
@@ -470,14 +495,6 @@ static void RtemsBarrierReqWait_Action( RtemsBarrierReqWait_Context *ctx )
ctx->status = rtems_barrier_wait( ctx->id, ctx->timeout );
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Id_NA : 1;
- uint8_t Pre_Timeout_NA : 1;
- uint8_t Pre_Satisfy_NA : 1;
- uint8_t Post_Status : 3;
-} RtemsBarrierReqWait_Entry;
-
static const RtemsBarrierReqWait_Entry
RtemsBarrierReqWait_Entries[] = {
{ 0, 0, 1, 1, RtemsBarrierReqWait_Post_Status_InvId },
@@ -499,8 +516,8 @@ static size_t RtemsBarrierReqWait_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsBarrierReqWait_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsBarrierReqWait_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -514,68 +531,67 @@ static T_fixture RtemsBarrierReqWait_Fixture = {
.initial_context = &RtemsBarrierReqWait_Instance
};
-static inline RtemsBarrierReqWait_Entry RtemsBarrierReqWait_GetEntry(
- size_t index
+static inline RtemsBarrierReqWait_Entry RtemsBarrierReqWait_PopEntry(
+ RtemsBarrierReqWait_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsBarrierReqWait_Entries[
RtemsBarrierReqWait_Map[ index ]
];
}
+static void RtemsBarrierReqWait_TestVariant( RtemsBarrierReqWait_Context *ctx )
+{
+ RtemsBarrierReqWait_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsBarrierReqWait_Pre_Timeout_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Timeout_NA ? RtemsBarrierReqWait_Pre_Timeout_NA : ctx->Map.pcs[ 1 ]
+ );
+ RtemsBarrierReqWait_Pre_Satisfy_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Satisfy_NA ? RtemsBarrierReqWait_Pre_Satisfy_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsBarrierReqWait_Action( ctx );
+ RtemsBarrierReqWait_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+}
+
/**
* @fn void T_case_body_RtemsBarrierReqWait( void )
*/
T_TEST_CASE_FIXTURE( RtemsBarrierReqWait, &RtemsBarrierReqWait_Fixture )
{
RtemsBarrierReqWait_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqWait_Pre_Id_NoObj;
- ctx->pcs[ 0 ] < RtemsBarrierReqWait_Pre_Id_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsBarrierReqWait_Pre_Id_NoObj;
+ ctx->Map.pcs[ 0 ] < RtemsBarrierReqWait_Pre_Id_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsBarrierReqWait_Pre_Timeout_Ticks;
- ctx->pcs[ 1 ] < RtemsBarrierReqWait_Pre_Timeout_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsBarrierReqWait_Pre_Timeout_Ticks;
+ ctx->Map.pcs[ 1 ] < RtemsBarrierReqWait_Pre_Timeout_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsBarrierReqWait_Pre_Satisfy_Never;
- ctx->pcs[ 2 ] < RtemsBarrierReqWait_Pre_Satisfy_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsBarrierReqWait_Pre_Satisfy_Never;
+ ctx->Map.pcs[ 2 ] < RtemsBarrierReqWait_Pre_Satisfy_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsBarrierReqWait_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsBarrierReqWait_GetEntry( index );
- ++index;
+ ctx->Map.entry = RtemsBarrierReqWait_PopEntry( ctx );
- if ( entry.Skip ) {
+ if ( ctx->Map.entry.Skip ) {
continue;
}
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_Timeout_NA ) {
- ctx->pcs[ 1 ] = RtemsBarrierReqWait_Pre_Timeout_NA;
- }
-
- if ( entry.Pre_Satisfy_NA ) {
- ctx->pcs[ 2 ] = RtemsBarrierReqWait_Pre_Satisfy_NA;
- }
-
- RtemsBarrierReqWait_Pre_Id_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsBarrierReqWait_Pre_Timeout_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsBarrierReqWait_Pre_Satisfy_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsBarrierReqWait_Action( ctx );
- RtemsBarrierReqWait_Post_Status_Check( ctx, entry.Post_Status );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ RtemsBarrierReqWait_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-clear.c b/testsuites/validation/tc-intr-clear.c
index 8482d8ceff..8c4e1e1deb 100644
--- a/testsuites/validation/tc-intr-clear.c
+++ b/testsuites/validation/tc-intr-clear.c
@@ -93,6 +93,14 @@ typedef enum {
RtemsIntrReqClear_Post_Cleared_NA
} RtemsIntrReqClear_Post_Cleared;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_CanClear_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_Cleared : 2;
+} RtemsIntrReqClear_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/clear test case.
*/
@@ -124,16 +132,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 2 ];
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 2 ];
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqClear_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqClear_Context;
static RtemsIntrReqClear_Context
@@ -486,14 +511,6 @@ static void RtemsIntrReqClear_Action( RtemsIntrReqClear_Context *ctx )
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_CanClear_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_Cleared : 2;
-} RtemsIntrReqClear_Entry;
-
static const RtemsIntrReqClear_Entry
RtemsIntrReqClear_Entries[] = {
{ 0, 0, 1, RtemsIntrReqClear_Post_Status_InvId,
@@ -515,8 +532,8 @@ static size_t RtemsIntrReqClear_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqClear_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsIntrReqClear_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -530,55 +547,54 @@ static T_fixture RtemsIntrReqClear_Fixture = {
.initial_context = &RtemsIntrReqClear_Instance
};
-static inline RtemsIntrReqClear_Entry RtemsIntrReqClear_GetEntry(
- size_t index
+static inline RtemsIntrReqClear_Entry RtemsIntrReqClear_PopEntry(
+ RtemsIntrReqClear_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqClear_Entries[
RtemsIntrReqClear_Map[ index ]
];
}
+static void RtemsIntrReqClear_TestVariant( RtemsIntrReqClear_Context *ctx )
+{
+ RtemsIntrReqClear_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqClear_Pre_CanClear_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanClear_NA ? RtemsIntrReqClear_Pre_CanClear_NA : ctx->Map.pcs[ 1 ]
+ );
+ RtemsIntrReqClear_Action( ctx );
+ RtemsIntrReqClear_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqClear_Post_Cleared_Check( ctx, ctx->Map.entry.Post_Cleared );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqClear( void )
*/
T_TEST_CASE_FIXTURE( RtemsIntrReqClear, &RtemsIntrReqClear_Fixture )
{
RtemsIntrReqClear_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqClear_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqClear_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqClear_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqClear_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqClear_Pre_CanClear_Yes;
- ctx->pcs[ 1 ] < RtemsIntrReqClear_Pre_CanClear_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqClear_Pre_CanClear_Yes;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqClear_Pre_CanClear_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
- RtemsIntrReqClear_Entry entry;
- size_t pcs[ 2 ];
-
- entry = RtemsIntrReqClear_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_CanClear_NA ) {
- ctx->pcs[ 1 ] = RtemsIntrReqClear_Pre_CanClear_NA;
- }
-
- RtemsIntrReqClear_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqClear_Pre_CanClear_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqClear_Action( ctx );
- RtemsIntrReqClear_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqClear_Post_Cleared_Check( ctx, entry.Post_Cleared );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqClear_PopEntry( ctx );
+ RtemsIntrReqClear_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-entry-install.c b/testsuites/validation/tc-intr-entry-install.c
index 20d06df997..37583249aa 100644
--- a/testsuites/validation/tc-intr-entry-install.c
+++ b/testsuites/validation/tc-intr-entry-install.c
@@ -148,6 +148,21 @@ typedef enum {
RtemsIntrReqEntryInstall_Post_Installed_NA
} RtemsIntrReqEntryInstall_Post_Installed;
+typedef struct {
+ uint32_t Skip : 1;
+ uint32_t Pre_Vector_NA : 1;
+ uint32_t Pre_Options_NA : 1;
+ uint32_t Pre_Entry_NA : 1;
+ uint32_t Pre_Routine_NA : 1;
+ uint32_t Pre_Init_NA : 1;
+ uint32_t Pre_ISR_NA : 1;
+ uint32_t Pre_CanEnable_NA : 1;
+ uint32_t Pre_Installed_NA : 1;
+ uint32_t Post_Status : 4;
+ uint32_t Post_Enable : 3;
+ uint32_t Post_Installed : 2;
+} RtemsIntrReqEntryInstall_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/entry-install test case.
*/
@@ -255,16 +270,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 8 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 8 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqEntryInstall_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqEntryInstall_Context;
static RtemsIntrReqEntryInstall_Context
@@ -1019,7 +1051,7 @@ static void RtemsIntrReqEntryInstall_Setup_Wrap( void *arg )
RtemsIntrReqEntryInstall_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqEntryInstall_Setup( ctx );
}
@@ -1065,21 +1097,6 @@ static void RtemsIntrReqEntryInstall_Cleanup(
}
}
-typedef struct {
- uint32_t Skip : 1;
- uint32_t Pre_Vector_NA : 1;
- uint32_t Pre_Options_NA : 1;
- uint32_t Pre_Entry_NA : 1;
- uint32_t Pre_Routine_NA : 1;
- uint32_t Pre_Init_NA : 1;
- uint32_t Pre_ISR_NA : 1;
- uint32_t Pre_CanEnable_NA : 1;
- uint32_t Pre_Installed_NA : 1;
- uint32_t Post_Status : 4;
- uint32_t Post_Enable : 3;
- uint32_t Post_Installed : 2;
-} RtemsIntrReqEntryInstall_Entry;
-
static const RtemsIntrReqEntryInstall_Entry
RtemsIntrReqEntryInstall_Entries[] = {
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_InvAddr,
@@ -1204,8 +1221,13 @@ static size_t RtemsIntrReqEntryInstall_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqEntryInstall_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqEntryInstall_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -1219,15 +1241,55 @@ static T_fixture RtemsIntrReqEntryInstall_Fixture = {
.initial_context = &RtemsIntrReqEntryInstall_Instance
};
-static inline RtemsIntrReqEntryInstall_Entry RtemsIntrReqEntryInstall_GetEntry(
- size_t index
+static inline RtemsIntrReqEntryInstall_Entry RtemsIntrReqEntryInstall_PopEntry(
+ RtemsIntrReqEntryInstall_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqEntryInstall_Entries[
RtemsIntrReqEntryInstall_Map[ index ]
];
}
+static void RtemsIntrReqEntryInstall_TestVariant(
+ RtemsIntrReqEntryInstall_Context *ctx
+)
+{
+ RtemsIntrReqEntryInstall_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqEntryInstall_Pre_Options_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqEntryInstall_Pre_Entry_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsIntrReqEntryInstall_Pre_Routine_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Routine_NA ? RtemsIntrReqEntryInstall_Pre_Routine_NA : ctx->Map.pcs[ 3 ]
+ );
+ RtemsIntrReqEntryInstall_Pre_Init_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsIntrReqEntryInstall_Pre_ISR_Prepare( ctx, ctx->Map.pcs[ 5 ] );
+ RtemsIntrReqEntryInstall_Pre_CanEnable_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanEnable_NA ? RtemsIntrReqEntryInstall_Pre_CanEnable_NA : ctx->Map.pcs[ 6 ]
+ );
+ RtemsIntrReqEntryInstall_Pre_Installed_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Installed_NA ? RtemsIntrReqEntryInstall_Pre_Installed_NA : ctx->Map.pcs[ 7 ]
+ );
+ RtemsIntrReqEntryInstall_Action( ctx );
+ RtemsIntrReqEntryInstall_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqEntryInstall_Post_Enable_Check(
+ ctx,
+ ctx->Map.entry.Post_Enable
+ );
+ RtemsIntrReqEntryInstall_Post_Installed_Check(
+ ctx,
+ ctx->Map.entry.Post_Installed
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqEntryInstall( void )
*/
@@ -1237,120 +1299,55 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqEntryInstall_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqEntryInstall_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqEntryInstall_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqEntryInstall_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqEntryInstall_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqEntryInstall_Pre_Options_Unique;
- ctx->pcs[ 1 ] < RtemsIntrReqEntryInstall_Pre_Options_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqEntryInstall_Pre_Options_Unique;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqEntryInstall_Pre_Options_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqEntryInstall_Pre_Entry_Obj;
- ctx->pcs[ 2 ] < RtemsIntrReqEntryInstall_Pre_Entry_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqEntryInstall_Pre_Entry_Obj;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqEntryInstall_Pre_Entry_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsIntrReqEntryInstall_Pre_Routine_Valid;
- ctx->pcs[ 3 ] < RtemsIntrReqEntryInstall_Pre_Routine_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsIntrReqEntryInstall_Pre_Routine_Valid;
+ ctx->Map.pcs[ 3 ] < RtemsIntrReqEntryInstall_Pre_Routine_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsIntrReqEntryInstall_Pre_Init_Yes;
- ctx->pcs[ 4 ] < RtemsIntrReqEntryInstall_Pre_Init_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsIntrReqEntryInstall_Pre_Init_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsIntrReqEntryInstall_Pre_Init_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
for (
- ctx->pcs[ 5 ] = RtemsIntrReqEntryInstall_Pre_ISR_Yes;
- ctx->pcs[ 5 ] < RtemsIntrReqEntryInstall_Pre_ISR_NA;
- ++ctx->pcs[ 5 ]
+ ctx->Map.pcs[ 5 ] = RtemsIntrReqEntryInstall_Pre_ISR_Yes;
+ ctx->Map.pcs[ 5 ] < RtemsIntrReqEntryInstall_Pre_ISR_NA;
+ ++ctx->Map.pcs[ 5 ]
) {
for (
- ctx->pcs[ 6 ] = RtemsIntrReqEntryInstall_Pre_CanEnable_Yes;
- ctx->pcs[ 6 ] < RtemsIntrReqEntryInstall_Pre_CanEnable_NA;
- ++ctx->pcs[ 6 ]
+ ctx->Map.pcs[ 6 ] = RtemsIntrReqEntryInstall_Pre_CanEnable_Yes;
+ ctx->Map.pcs[ 6 ] < RtemsIntrReqEntryInstall_Pre_CanEnable_NA;
+ ++ctx->Map.pcs[ 6 ]
) {
for (
- ctx->pcs[ 7 ] = RtemsIntrReqEntryInstall_Pre_Installed_None;
- ctx->pcs[ 7 ] < RtemsIntrReqEntryInstall_Pre_Installed_NA;
- ++ctx->pcs[ 7 ]
+ ctx->Map.pcs[ 7 ] = RtemsIntrReqEntryInstall_Pre_Installed_None;
+ ctx->Map.pcs[ 7 ] < RtemsIntrReqEntryInstall_Pre_Installed_NA;
+ ++ctx->Map.pcs[ 7 ]
) {
- RtemsIntrReqEntryInstall_Entry entry;
- size_t pcs[ 8 ];
-
- entry = RtemsIntrReqEntryInstall_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_Routine_NA ) {
- ctx->pcs[ 3 ] = RtemsIntrReqEntryInstall_Pre_Routine_NA;
- }
-
- if ( entry.Pre_CanEnable_NA ) {
- ctx->pcs[ 6 ] = RtemsIntrReqEntryInstall_Pre_CanEnable_NA;
- }
-
- if ( entry.Pre_Installed_NA ) {
- ctx->pcs[ 7 ] = RtemsIntrReqEntryInstall_Pre_Installed_NA;
- }
-
+ ctx->Map.entry = RtemsIntrReqEntryInstall_PopEntry( ctx );
RtemsIntrReqEntryInstall_Prepare( ctx );
- RtemsIntrReqEntryInstall_Pre_Vector_Prepare(
- ctx,
- ctx->pcs[ 0 ]
- );
- RtemsIntrReqEntryInstall_Pre_Options_Prepare(
- ctx,
- ctx->pcs[ 1 ]
- );
- RtemsIntrReqEntryInstall_Pre_Entry_Prepare(
- ctx,
- ctx->pcs[ 2 ]
- );
- RtemsIntrReqEntryInstall_Pre_Routine_Prepare(
- ctx,
- ctx->pcs[ 3 ]
- );
- RtemsIntrReqEntryInstall_Pre_Init_Prepare(
- ctx,
- ctx->pcs[ 4 ]
- );
- RtemsIntrReqEntryInstall_Pre_ISR_Prepare(
- ctx,
- ctx->pcs[ 5 ]
- );
- RtemsIntrReqEntryInstall_Pre_CanEnable_Prepare(
- ctx,
- ctx->pcs[ 6 ]
- );
- RtemsIntrReqEntryInstall_Pre_Installed_Prepare(
- ctx,
- ctx->pcs[ 7 ]
- );
- RtemsIntrReqEntryInstall_Action( ctx );
- RtemsIntrReqEntryInstall_Post_Status_Check(
- ctx,
- entry.Post_Status
- );
- RtemsIntrReqEntryInstall_Post_Enable_Check(
- ctx,
- entry.Post_Enable
- );
- RtemsIntrReqEntryInstall_Post_Installed_Check(
- ctx,
- entry.Post_Installed
- );
+ RtemsIntrReqEntryInstall_TestVariant( ctx );
RtemsIntrReqEntryInstall_Cleanup( ctx );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
}
}
}
diff --git a/testsuites/validation/tc-intr-entry-remove.c b/testsuites/validation/tc-intr-entry-remove.c
index 64f6e46de7..65cbbb28d3 100644
--- a/testsuites/validation/tc-intr-entry-remove.c
+++ b/testsuites/validation/tc-intr-entry-remove.c
@@ -148,6 +148,22 @@ typedef enum {
RtemsIntrReqEntryRemove_Post_Installed_NA
} RtemsIntrReqEntryRemove_Post_Installed;
+typedef struct {
+ uint32_t Skip : 1;
+ uint32_t Pre_Vector_NA : 1;
+ uint32_t Pre_Entry_NA : 1;
+ uint32_t Pre_Routine_NA : 1;
+ uint32_t Pre_EntryObj_NA : 1;
+ uint32_t Pre_Init_NA : 1;
+ uint32_t Pre_ISR_NA : 1;
+ uint32_t Pre_CanDisable_NA : 1;
+ uint32_t Pre_First_NA : 1;
+ uint32_t Pre_Last_NA : 1;
+ uint32_t Post_Status : 3;
+ uint32_t Post_Disabled : 3;
+ uint32_t Post_Installed : 2;
+} RtemsIntrReqEntryRemove_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/entry-remove test case.
*/
@@ -272,16 +288,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 9 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 9 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqEntryRemove_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqEntryRemove_Context;
static RtemsIntrReqEntryRemove_Context
@@ -1058,7 +1091,7 @@ static void RtemsIntrReqEntryRemove_Setup_Wrap( void *arg )
RtemsIntrReqEntryRemove_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqEntryRemove_Setup( ctx );
}
@@ -1135,22 +1168,6 @@ static void RtemsIntrReqEntryRemove_Cleanup(
}
}
-typedef struct {
- uint32_t Skip : 1;
- uint32_t Pre_Vector_NA : 1;
- uint32_t Pre_Entry_NA : 1;
- uint32_t Pre_Routine_NA : 1;
- uint32_t Pre_EntryObj_NA : 1;
- uint32_t Pre_Init_NA : 1;
- uint32_t Pre_ISR_NA : 1;
- uint32_t Pre_CanDisable_NA : 1;
- uint32_t Pre_First_NA : 1;
- uint32_t Pre_Last_NA : 1;
- uint32_t Post_Status : 3;
- uint32_t Post_Disabled : 3;
- uint32_t Post_Installed : 2;
-} RtemsIntrReqEntryRemove_Entry;
-
static const RtemsIntrReqEntryRemove_Entry
RtemsIntrReqEntryRemove_Entries[] = {
{ 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvAddr,
@@ -1254,8 +1271,13 @@ static size_t RtemsIntrReqEntryRemove_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqEntryRemove_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqEntryRemove_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -1269,15 +1291,59 @@ static T_fixture RtemsIntrReqEntryRemove_Fixture = {
.initial_context = &RtemsIntrReqEntryRemove_Instance
};
-static inline RtemsIntrReqEntryRemove_Entry RtemsIntrReqEntryRemove_GetEntry(
- size_t index
+static inline RtemsIntrReqEntryRemove_Entry RtemsIntrReqEntryRemove_PopEntry(
+ RtemsIntrReqEntryRemove_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqEntryRemove_Entries[
RtemsIntrReqEntryRemove_Map[ index ]
];
}
+static void RtemsIntrReqEntryRemove_TestVariant(
+ RtemsIntrReqEntryRemove_Context *ctx
+)
+{
+ RtemsIntrReqEntryRemove_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqEntryRemove_Pre_Entry_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqEntryRemove_Pre_Routine_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Routine_NA ? RtemsIntrReqEntryRemove_Pre_Routine_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqEntryRemove_Pre_EntryObj_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_EntryObj_NA ? RtemsIntrReqEntryRemove_Pre_EntryObj_NA : ctx->Map.pcs[ 3 ]
+ );
+ RtemsIntrReqEntryRemove_Pre_Init_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsIntrReqEntryRemove_Pre_ISR_Prepare( ctx, ctx->Map.pcs[ 5 ] );
+ RtemsIntrReqEntryRemove_Pre_CanDisable_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanDisable_NA ? RtemsIntrReqEntryRemove_Pre_CanDisable_NA : ctx->Map.pcs[ 6 ]
+ );
+ RtemsIntrReqEntryRemove_Pre_First_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_First_NA ? RtemsIntrReqEntryRemove_Pre_First_NA : ctx->Map.pcs[ 7 ]
+ );
+ RtemsIntrReqEntryRemove_Pre_Last_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_Last_NA ? RtemsIntrReqEntryRemove_Pre_Last_NA : ctx->Map.pcs[ 8 ]
+ );
+ RtemsIntrReqEntryRemove_Action( ctx );
+ RtemsIntrReqEntryRemove_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqEntryRemove_Post_Disabled_Check(
+ ctx,
+ ctx->Map.entry.Post_Disabled
+ );
+ RtemsIntrReqEntryRemove_Post_Installed_Check(
+ ctx,
+ ctx->Map.entry.Post_Installed
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqEntryRemove( void )
*/
@@ -1287,137 +1353,60 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqEntryRemove_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqEntryRemove_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqEntryRemove_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqEntryRemove_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqEntryRemove_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqEntryRemove_Pre_Entry_Obj;
- ctx->pcs[ 1 ] < RtemsIntrReqEntryRemove_Pre_Entry_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqEntryRemove_Pre_Entry_Obj;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqEntryRemove_Pre_Entry_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqEntryRemove_Pre_Routine_Valid;
- ctx->pcs[ 2 ] < RtemsIntrReqEntryRemove_Pre_Routine_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqEntryRemove_Pre_Routine_Valid;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqEntryRemove_Pre_Routine_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsIntrReqEntryRemove_Pre_EntryObj_Installed;
- ctx->pcs[ 3 ] < RtemsIntrReqEntryRemove_Pre_EntryObj_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsIntrReqEntryRemove_Pre_EntryObj_Installed;
+ ctx->Map.pcs[ 3 ] < RtemsIntrReqEntryRemove_Pre_EntryObj_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsIntrReqEntryRemove_Pre_Init_Yes;
- ctx->pcs[ 4 ] < RtemsIntrReqEntryRemove_Pre_Init_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsIntrReqEntryRemove_Pre_Init_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsIntrReqEntryRemove_Pre_Init_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
for (
- ctx->pcs[ 5 ] = RtemsIntrReqEntryRemove_Pre_ISR_Yes;
- ctx->pcs[ 5 ] < RtemsIntrReqEntryRemove_Pre_ISR_NA;
- ++ctx->pcs[ 5 ]
+ ctx->Map.pcs[ 5 ] = RtemsIntrReqEntryRemove_Pre_ISR_Yes;
+ ctx->Map.pcs[ 5 ] < RtemsIntrReqEntryRemove_Pre_ISR_NA;
+ ++ctx->Map.pcs[ 5 ]
) {
for (
- ctx->pcs[ 6 ] = RtemsIntrReqEntryRemove_Pre_CanDisable_Yes;
- ctx->pcs[ 6 ] < RtemsIntrReqEntryRemove_Pre_CanDisable_NA;
- ++ctx->pcs[ 6 ]
+ ctx->Map.pcs[ 6 ] = RtemsIntrReqEntryRemove_Pre_CanDisable_Yes;
+ ctx->Map.pcs[ 6 ] < RtemsIntrReqEntryRemove_Pre_CanDisable_NA;
+ ++ctx->Map.pcs[ 6 ]
) {
for (
- ctx->pcs[ 7 ] = RtemsIntrReqEntryRemove_Pre_First_Yes;
- ctx->pcs[ 7 ] < RtemsIntrReqEntryRemove_Pre_First_NA;
- ++ctx->pcs[ 7 ]
+ ctx->Map.pcs[ 7 ] = RtemsIntrReqEntryRemove_Pre_First_Yes;
+ ctx->Map.pcs[ 7 ] < RtemsIntrReqEntryRemove_Pre_First_NA;
+ ++ctx->Map.pcs[ 7 ]
) {
for (
- ctx->pcs[ 8 ] = RtemsIntrReqEntryRemove_Pre_Last_Yes;
- ctx->pcs[ 8 ] < RtemsIntrReqEntryRemove_Pre_Last_NA;
- ++ctx->pcs[ 8 ]
+ ctx->Map.pcs[ 8 ] = RtemsIntrReqEntryRemove_Pre_Last_Yes;
+ ctx->Map.pcs[ 8 ] < RtemsIntrReqEntryRemove_Pre_Last_NA;
+ ++ctx->Map.pcs[ 8 ]
) {
- RtemsIntrReqEntryRemove_Entry entry;
- size_t pcs[ 9 ];
-
- entry = RtemsIntrReqEntryRemove_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_Routine_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqEntryRemove_Pre_Routine_NA;
- }
-
- if ( entry.Pre_EntryObj_NA ) {
- ctx->pcs[ 3 ] = RtemsIntrReqEntryRemove_Pre_EntryObj_NA;
- }
-
- if ( entry.Pre_CanDisable_NA ) {
- ctx->pcs[ 6 ] = RtemsIntrReqEntryRemove_Pre_CanDisable_NA;
- }
-
- if ( entry.Pre_First_NA ) {
- ctx->pcs[ 7 ] = RtemsIntrReqEntryRemove_Pre_First_NA;
- }
-
- if ( entry.Pre_Last_NA ) {
- ctx->pcs[ 8 ] = RtemsIntrReqEntryRemove_Pre_Last_NA;
- }
-
+ ctx->Map.entry = RtemsIntrReqEntryRemove_PopEntry( ctx );
RtemsIntrReqEntryRemove_Prepare( ctx );
- RtemsIntrReqEntryRemove_Pre_Vector_Prepare(
- ctx,
- ctx->pcs[ 0 ]
- );
- RtemsIntrReqEntryRemove_Pre_Entry_Prepare(
- ctx,
- ctx->pcs[ 1 ]
- );
- RtemsIntrReqEntryRemove_Pre_Routine_Prepare(
- ctx,
- ctx->pcs[ 2 ]
- );
- RtemsIntrReqEntryRemove_Pre_EntryObj_Prepare(
- ctx,
- ctx->pcs[ 3 ]
- );
- RtemsIntrReqEntryRemove_Pre_Init_Prepare(
- ctx,
- ctx->pcs[ 4 ]
- );
- RtemsIntrReqEntryRemove_Pre_ISR_Prepare(
- ctx,
- ctx->pcs[ 5 ]
- );
- RtemsIntrReqEntryRemove_Pre_CanDisable_Prepare(
- ctx,
- ctx->pcs[ 6 ]
- );
- RtemsIntrReqEntryRemove_Pre_First_Prepare(
- ctx,
- ctx->pcs[ 7 ]
- );
- RtemsIntrReqEntryRemove_Pre_Last_Prepare(
- ctx,
- ctx->pcs[ 8 ]
- );
- RtemsIntrReqEntryRemove_Action( ctx );
- RtemsIntrReqEntryRemove_Post_Status_Check(
- ctx,
- entry.Post_Status
- );
- RtemsIntrReqEntryRemove_Post_Disabled_Check(
- ctx,
- entry.Post_Disabled
- );
- RtemsIntrReqEntryRemove_Post_Installed_Check(
- ctx,
- entry.Post_Installed
- );
+ RtemsIntrReqEntryRemove_TestVariant( ctx );
RtemsIntrReqEntryRemove_Cleanup( ctx );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
}
}
}
diff --git a/testsuites/validation/tc-intr-get-affinity.c b/testsuites/validation/tc-intr-get-affinity.c
index e0de9e37ec..d74088e15a 100644
--- a/testsuites/validation/tc-intr-get-affinity.c
+++ b/testsuites/validation/tc-intr-get-affinity.c
@@ -111,6 +111,16 @@ typedef enum {
RtemsIntrReqGetAffinity_Post_CPUSetObj_NA
} RtemsIntrReqGetAffinity_Post_CPUSetObj;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Vector_NA : 1;
+ uint16_t Pre_CPUSetSize_NA : 1;
+ uint16_t Pre_CPUSet_NA : 1;
+ uint16_t Pre_CanGetAffinity_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_CPUSetObj : 3;
+} RtemsIntrReqGetAffinity_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/get-affinity test case.
*/
@@ -153,16 +163,33 @@ typedef struct {
*/
cpu_set_t *cpuset;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 4 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 4 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqGetAffinity_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqGetAffinity_Context;
static RtemsIntrReqGetAffinity_Context
@@ -492,7 +519,7 @@ static void RtemsIntrReqGetAffinity_Setup_Wrap( void *arg )
RtemsIntrReqGetAffinity_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqGetAffinity_Setup( ctx );
}
@@ -550,16 +577,6 @@ static void RtemsIntrReqGetAffinity_Action(
}
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Vector_NA : 1;
- uint16_t Pre_CPUSetSize_NA : 1;
- uint16_t Pre_CPUSet_NA : 1;
- uint16_t Pre_CanGetAffinity_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_CPUSetObj : 3;
-} RtemsIntrReqGetAffinity_Entry;
-
static const RtemsIntrReqGetAffinity_Entry
RtemsIntrReqGetAffinity_Entries[] = {
{ 0, 0, 0, 0, 0, RtemsIntrReqGetAffinity_Post_Status_InvAddr,
@@ -589,8 +606,13 @@ static size_t RtemsIntrReqGetAffinity_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqGetAffinity_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqGetAffinity_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -604,15 +626,38 @@ static T_fixture RtemsIntrReqGetAffinity_Fixture = {
.initial_context = &RtemsIntrReqGetAffinity_Instance
};
-static inline RtemsIntrReqGetAffinity_Entry RtemsIntrReqGetAffinity_GetEntry(
- size_t index
+static inline RtemsIntrReqGetAffinity_Entry RtemsIntrReqGetAffinity_PopEntry(
+ RtemsIntrReqGetAffinity_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqGetAffinity_Entries[
RtemsIntrReqGetAffinity_Map[ index ]
];
}
+static void RtemsIntrReqGetAffinity_TestVariant(
+ RtemsIntrReqGetAffinity_Context *ctx
+)
+{
+ RtemsIntrReqGetAffinity_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqGetAffinity_Pre_CPUSetSize_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqGetAffinity_Pre_CPUSet_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsIntrReqGetAffinity_Pre_CanGetAffinity_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanGetAffinity_NA ? RtemsIntrReqGetAffinity_Pre_CanGetAffinity_NA : ctx->Map.pcs[ 3 ]
+ );
+ RtemsIntrReqGetAffinity_Action( ctx );
+ RtemsIntrReqGetAffinity_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqGetAffinity_Post_CPUSetObj_Check(
+ ctx,
+ ctx->Map.entry.Post_CPUSetObj
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqGetAffinity( void )
*/
@@ -622,58 +667,33 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqGetAffinity_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqGetAffinity_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqGetAffinity_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqGetAffinity_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqGetAffinity_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqGetAffinity_Pre_CPUSetSize_Valid;
- ctx->pcs[ 1 ] < RtemsIntrReqGetAffinity_Pre_CPUSetSize_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqGetAffinity_Pre_CPUSetSize_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqGetAffinity_Pre_CPUSetSize_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqGetAffinity_Pre_CPUSet_Valid;
- ctx->pcs[ 2 ] < RtemsIntrReqGetAffinity_Pre_CPUSet_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqGetAffinity_Pre_CPUSet_Valid;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqGetAffinity_Pre_CPUSet_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsIntrReqGetAffinity_Pre_CanGetAffinity_Yes;
- ctx->pcs[ 3 ] < RtemsIntrReqGetAffinity_Pre_CanGetAffinity_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsIntrReqGetAffinity_Pre_CanGetAffinity_Yes;
+ ctx->Map.pcs[ 3 ] < RtemsIntrReqGetAffinity_Pre_CanGetAffinity_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
- RtemsIntrReqGetAffinity_Entry entry;
- size_t pcs[ 4 ];
-
- entry = RtemsIntrReqGetAffinity_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_CanGetAffinity_NA ) {
- ctx->pcs[ 3 ] = RtemsIntrReqGetAffinity_Pre_CanGetAffinity_NA;
- }
-
- RtemsIntrReqGetAffinity_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqGetAffinity_Pre_CPUSetSize_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqGetAffinity_Pre_CPUSet_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqGetAffinity_Pre_CanGetAffinity_Prepare(
- ctx,
- ctx->pcs[ 3 ]
- );
- RtemsIntrReqGetAffinity_Action( ctx );
- RtemsIntrReqGetAffinity_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqGetAffinity_Post_CPUSetObj_Check(
- ctx,
- entry.Post_CPUSetObj
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqGetAffinity_PopEntry( ctx );
+ RtemsIntrReqGetAffinity_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-get-attributes.c b/testsuites/validation/tc-intr-get-attributes.c
index 16860a08cd..f64eef1563 100644
--- a/testsuites/validation/tc-intr-get-attributes.c
+++ b/testsuites/validation/tc-intr-get-attributes.c
@@ -93,6 +93,14 @@ typedef enum {
RtemsIntrReqGetAttributes_Post_Attributes_NA
} RtemsIntrReqGetAttributes_Post_Attributes;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_Attributes_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_Attributes : 2;
+} RtemsIntrReqGetAttributes_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/get-attributes test case.
*/
@@ -119,16 +127,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 2 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 2 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqGetAttributes_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqGetAttributes_Context;
static RtemsIntrReqGetAttributes_Context
@@ -342,14 +367,6 @@ static void RtemsIntrReqGetAttributes_Action(
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_Attributes_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_Attributes : 2;
-} RtemsIntrReqGetAttributes_Entry;
-
static const RtemsIntrReqGetAttributes_Entry
RtemsIntrReqGetAttributes_Entries[] = {
{ 0, 0, 0, RtemsIntrReqGetAttributes_Post_Status_InvAddr,
@@ -371,8 +388,13 @@ static size_t RtemsIntrReqGetAttributes_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqGetAttributes_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqGetAttributes_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -387,13 +409,34 @@ static T_fixture RtemsIntrReqGetAttributes_Fixture = {
};
static inline RtemsIntrReqGetAttributes_Entry
-RtemsIntrReqGetAttributes_GetEntry( size_t index )
+RtemsIntrReqGetAttributes_PopEntry( RtemsIntrReqGetAttributes_Context *ctx )
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqGetAttributes_Entries[
RtemsIntrReqGetAttributes_Map[ index ]
];
}
+static void RtemsIntrReqGetAttributes_TestVariant(
+ RtemsIntrReqGetAttributes_Context *ctx
+)
+{
+ RtemsIntrReqGetAttributes_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqGetAttributes_Pre_Attributes_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqGetAttributes_Action( ctx );
+ RtemsIntrReqGetAttributes_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqGetAttributes_Post_Attributes_Check(
+ ctx,
+ ctx->Map.entry.Post_Attributes
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqGetAttributes( void )
*/
@@ -403,36 +446,24 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqGetAttributes_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqGetAttributes_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqGetAttributes_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqGetAttributes_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqGetAttributes_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqGetAttributes_Pre_Attributes_Obj;
- ctx->pcs[ 1 ] < RtemsIntrReqGetAttributes_Pre_Attributes_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqGetAttributes_Pre_Attributes_Obj;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqGetAttributes_Pre_Attributes_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
- RtemsIntrReqGetAttributes_Entry entry;
-
- entry = RtemsIntrReqGetAttributes_GetEntry( index );
- ++index;
-
+ ctx->Map.entry = RtemsIntrReqGetAttributes_PopEntry( ctx );
RtemsIntrReqGetAttributes_Prepare( ctx );
- RtemsIntrReqGetAttributes_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqGetAttributes_Pre_Attributes_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqGetAttributes_Action( ctx );
- RtemsIntrReqGetAttributes_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqGetAttributes_Post_Attributes_Check(
- ctx,
- entry.Post_Attributes
- );
+ RtemsIntrReqGetAttributes_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-handler-iterate.c b/testsuites/validation/tc-intr-handler-iterate.c
index 707ea44527..2014e829bf 100644
--- a/testsuites/validation/tc-intr-handler-iterate.c
+++ b/testsuites/validation/tc-intr-handler-iterate.c
@@ -107,6 +107,16 @@ typedef enum {
RtemsIntrReqHandlerIterate_Post_Visit_NA
} RtemsIntrReqHandlerIterate_Post_Visit;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Vector_NA : 1;
+ uint16_t Pre_Routine_NA : 1;
+ uint16_t Pre_Init_NA : 1;
+ uint16_t Pre_ISR_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_Visit : 2;
+} RtemsIntrReqHandlerIterate_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/handler-iterate test case.
*/
@@ -160,16 +170,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 4 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 4 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqHandlerIterate_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqHandlerIterate_Context;
static RtemsIntrReqHandlerIterate_Context
@@ -498,7 +525,7 @@ static void RtemsIntrReqHandlerIterate_Setup_Wrap( void *arg )
RtemsIntrReqHandlerIterate_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqHandlerIterate_Setup( ctx );
}
@@ -513,16 +540,6 @@ static void RtemsIntrReqHandlerIterate_Action(
}
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Vector_NA : 1;
- uint16_t Pre_Routine_NA : 1;
- uint16_t Pre_Init_NA : 1;
- uint16_t Pre_ISR_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_Visit : 2;
-} RtemsIntrReqHandlerIterate_Entry;
-
static const RtemsIntrReqHandlerIterate_Entry
RtemsIntrReqHandlerIterate_Entries[] = {
{ 0, 0, 0, 0, 0, RtemsIntrReqHandlerIterate_Post_Status_IncStat,
@@ -554,8 +571,13 @@ static size_t RtemsIntrReqHandlerIterate_Scope(
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqHandlerIterate_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqHandlerIterate_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -570,13 +592,36 @@ static T_fixture RtemsIntrReqHandlerIterate_Fixture = {
};
static inline RtemsIntrReqHandlerIterate_Entry
-RtemsIntrReqHandlerIterate_GetEntry( size_t index )
+RtemsIntrReqHandlerIterate_PopEntry( RtemsIntrReqHandlerIterate_Context *ctx )
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqHandlerIterate_Entries[
RtemsIntrReqHandlerIterate_Map[ index ]
];
}
+static void RtemsIntrReqHandlerIterate_TestVariant(
+ RtemsIntrReqHandlerIterate_Context *ctx
+)
+{
+ RtemsIntrReqHandlerIterate_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqHandlerIterate_Pre_Routine_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqHandlerIterate_Pre_Init_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsIntrReqHandlerIterate_Pre_ISR_Prepare( ctx, ctx->Map.pcs[ 3 ] );
+ RtemsIntrReqHandlerIterate_Action( ctx );
+ RtemsIntrReqHandlerIterate_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqHandlerIterate_Post_Visit_Check(
+ ctx,
+ ctx->Map.entry.Post_Visit
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqHandlerIterate( void )
*/
@@ -586,47 +631,33 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqHandlerIterate_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqHandlerIterate_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqHandlerIterate_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqHandlerIterate_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqHandlerIterate_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqHandlerIterate_Pre_Routine_Valid;
- ctx->pcs[ 1 ] < RtemsIntrReqHandlerIterate_Pre_Routine_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqHandlerIterate_Pre_Routine_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqHandlerIterate_Pre_Routine_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqHandlerIterate_Pre_Init_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqHandlerIterate_Pre_Init_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqHandlerIterate_Pre_Init_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqHandlerIterate_Pre_Init_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsIntrReqHandlerIterate_Pre_ISR_Yes;
- ctx->pcs[ 3 ] < RtemsIntrReqHandlerIterate_Pre_ISR_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsIntrReqHandlerIterate_Pre_ISR_Yes;
+ ctx->Map.pcs[ 3 ] < RtemsIntrReqHandlerIterate_Pre_ISR_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
- RtemsIntrReqHandlerIterate_Entry entry;
-
- entry = RtemsIntrReqHandlerIterate_GetEntry( index );
- ++index;
-
- RtemsIntrReqHandlerIterate_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqHandlerIterate_Pre_Routine_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqHandlerIterate_Pre_Init_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqHandlerIterate_Pre_ISR_Prepare( ctx, ctx->pcs[ 3 ] );
- RtemsIntrReqHandlerIterate_Action( ctx );
- RtemsIntrReqHandlerIterate_Post_Status_Check(
- ctx,
- entry.Post_Status
- );
- RtemsIntrReqHandlerIterate_Post_Visit_Check( ctx, entry.Post_Visit );
+ ctx->Map.entry = RtemsIntrReqHandlerIterate_PopEntry( ctx );
+ RtemsIntrReqHandlerIterate_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-is-pending.c b/testsuites/validation/tc-intr-is-pending.c
index 9a81cb9c23..4963827538 100644
--- a/testsuites/validation/tc-intr-is-pending.c
+++ b/testsuites/validation/tc-intr-is-pending.c
@@ -100,6 +100,15 @@ typedef enum {
RtemsIntrReqIsPending_Post_IsPending_NA
} RtemsIntrReqIsPending_Post_IsPending;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_Pending_NA : 1;
+ uint8_t Pre_IsPending_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_IsPending : 2;
+} RtemsIntrReqIsPending_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/is-pending test case.
*/
@@ -141,16 +150,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqIsPending_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqIsPending_Context;
static RtemsIntrReqIsPending_Context
@@ -514,15 +540,6 @@ static void RtemsIntrReqIsPending_Action( RtemsIntrReqIsPending_Context *ctx )
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_Pending_NA : 1;
- uint8_t Pre_IsPending_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_IsPending : 2;
-} RtemsIntrReqIsPending_Entry;
-
static const RtemsIntrReqIsPending_Entry
RtemsIntrReqIsPending_Entries[] = {
{ 0, 0, 0, 0, RtemsIntrReqIsPending_Post_Status_InvAddr,
@@ -548,8 +565,8 @@ static size_t RtemsIntrReqIsPending_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqIsPending_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsIntrReqIsPending_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -563,64 +580,65 @@ static T_fixture RtemsIntrReqIsPending_Fixture = {
.initial_context = &RtemsIntrReqIsPending_Instance
};
-static inline RtemsIntrReqIsPending_Entry RtemsIntrReqIsPending_GetEntry(
- size_t index
+static inline RtemsIntrReqIsPending_Entry RtemsIntrReqIsPending_PopEntry(
+ RtemsIntrReqIsPending_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqIsPending_Entries[
RtemsIntrReqIsPending_Map[ index ]
];
}
+static void RtemsIntrReqIsPending_TestVariant(
+ RtemsIntrReqIsPending_Context *ctx
+)
+{
+ RtemsIntrReqIsPending_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqIsPending_Pre_Pending_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqIsPending_Pre_IsPending_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_IsPending_NA ? RtemsIntrReqIsPending_Pre_IsPending_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqIsPending_Action( ctx );
+ RtemsIntrReqIsPending_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqIsPending_Post_IsPending_Check(
+ ctx,
+ ctx->Map.entry.Post_IsPending
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqIsPending( void )
*/
T_TEST_CASE_FIXTURE( RtemsIntrReqIsPending, &RtemsIntrReqIsPending_Fixture )
{
RtemsIntrReqIsPending_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqIsPending_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqIsPending_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqIsPending_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqIsPending_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqIsPending_Pre_Pending_Obj;
- ctx->pcs[ 1 ] < RtemsIntrReqIsPending_Pre_Pending_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqIsPending_Pre_Pending_Obj;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqIsPending_Pre_Pending_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqIsPending_Pre_IsPending_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqIsPending_Pre_IsPending_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqIsPending_Pre_IsPending_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqIsPending_Pre_IsPending_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsIntrReqIsPending_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsIntrReqIsPending_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_IsPending_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqIsPending_Pre_IsPending_NA;
- }
-
- RtemsIntrReqIsPending_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqIsPending_Pre_Pending_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqIsPending_Pre_IsPending_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqIsPending_Action( ctx );
- RtemsIntrReqIsPending_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqIsPending_Post_IsPending_Check(
- ctx,
- entry.Post_IsPending
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqIsPending_PopEntry( ctx );
+ RtemsIntrReqIsPending_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-raise-on.c b/testsuites/validation/tc-intr-raise-on.c
index 2b1692d602..efe468aebd 100644
--- a/testsuites/validation/tc-intr-raise-on.c
+++ b/testsuites/validation/tc-intr-raise-on.c
@@ -102,6 +102,15 @@ typedef enum {
RtemsIntrReqRaiseOn_Post_Pending_NA
} RtemsIntrReqRaiseOn_Post_Pending;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Vector_NA : 1;
+ uint16_t Pre_CPU_NA : 1;
+ uint16_t Pre_CanRaiseOn_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_Pending : 2;
+} RtemsIntrReqRaiseOn_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/raise-on test case.
*/
@@ -143,16 +152,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqRaiseOn_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqRaiseOn_Context;
static RtemsIntrReqRaiseOn_Context
@@ -542,7 +568,7 @@ static void RtemsIntrReqRaiseOn_Setup_Wrap( void *arg )
RtemsIntrReqRaiseOn_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqRaiseOn_Setup( ctx );
}
@@ -581,15 +607,6 @@ static void RtemsIntrReqRaiseOn_Action( RtemsIntrReqRaiseOn_Context *ctx )
}
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Vector_NA : 1;
- uint16_t Pre_CPU_NA : 1;
- uint16_t Pre_CanRaiseOn_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_Pending : 2;
-} RtemsIntrReqRaiseOn_Entry;
-
static const RtemsIntrReqRaiseOn_Entry
RtemsIntrReqRaiseOn_Entries[] = {
{ 0, 0, 0, 1, RtemsIntrReqRaiseOn_Post_Status_InvId,
@@ -627,8 +644,8 @@ static size_t RtemsIntrReqRaiseOn_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqRaiseOn_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsIntrReqRaiseOn_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -642,65 +659,65 @@ static T_fixture RtemsIntrReqRaiseOn_Fixture = {
.initial_context = &RtemsIntrReqRaiseOn_Instance
};
-static inline RtemsIntrReqRaiseOn_Entry RtemsIntrReqRaiseOn_GetEntry(
- size_t index
+static inline RtemsIntrReqRaiseOn_Entry RtemsIntrReqRaiseOn_PopEntry(
+ RtemsIntrReqRaiseOn_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqRaiseOn_Entries[
RtemsIntrReqRaiseOn_Map[ index ]
];
}
+static void RtemsIntrReqRaiseOn_TestVariant( RtemsIntrReqRaiseOn_Context *ctx )
+{
+ RtemsIntrReqRaiseOn_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqRaiseOn_Pre_CPU_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqRaiseOn_Pre_CanRaiseOn_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanRaiseOn_NA ? RtemsIntrReqRaiseOn_Pre_CanRaiseOn_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqRaiseOn_Action( ctx );
+ RtemsIntrReqRaiseOn_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqRaiseOn_Post_Pending_Check( ctx, ctx->Map.entry.Post_Pending );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqRaiseOn( void )
*/
T_TEST_CASE_FIXTURE( RtemsIntrReqRaiseOn, &RtemsIntrReqRaiseOn_Fixture )
{
RtemsIntrReqRaiseOn_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqRaiseOn_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqRaiseOn_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqRaiseOn_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqRaiseOn_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqRaiseOn_Pre_CPU_Online;
- ctx->pcs[ 1 ] < RtemsIntrReqRaiseOn_Pre_CPU_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqRaiseOn_Pre_CPU_Online;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqRaiseOn_Pre_CPU_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqRaiseOn_Pre_CanRaiseOn_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqRaiseOn_Pre_CanRaiseOn_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqRaiseOn_Pre_CanRaiseOn_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqRaiseOn_Pre_CanRaiseOn_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsIntrReqRaiseOn_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsIntrReqRaiseOn_GetEntry( index );
- ++index;
+ ctx->Map.entry = RtemsIntrReqRaiseOn_PopEntry( ctx );
- if ( entry.Skip ) {
+ if ( ctx->Map.entry.Skip ) {
continue;
}
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_CanRaiseOn_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqRaiseOn_Pre_CanRaiseOn_NA;
- }
-
- RtemsIntrReqRaiseOn_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqRaiseOn_Pre_CPU_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqRaiseOn_Pre_CanRaiseOn_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqRaiseOn_Action( ctx );
- RtemsIntrReqRaiseOn_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqRaiseOn_Post_Pending_Check( ctx, entry.Post_Pending );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ RtemsIntrReqRaiseOn_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-raise.c b/testsuites/validation/tc-intr-raise.c
index 1fea6ad867..81e8f8e856 100644
--- a/testsuites/validation/tc-intr-raise.c
+++ b/testsuites/validation/tc-intr-raise.c
@@ -93,6 +93,14 @@ typedef enum {
RtemsIntrReqRaise_Post_Pending_NA
} RtemsIntrReqRaise_Post_Pending;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_CanRaise_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_Pending : 2;
+} RtemsIntrReqRaise_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/raise test case.
*/
@@ -124,16 +132,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 2 ];
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 2 ];
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqRaise_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqRaise_Context;
static RtemsIntrReqRaise_Context
@@ -476,14 +501,6 @@ static void RtemsIntrReqRaise_Action( RtemsIntrReqRaise_Context *ctx )
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_CanRaise_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_Pending : 2;
-} RtemsIntrReqRaise_Entry;
-
static const RtemsIntrReqRaise_Entry
RtemsIntrReqRaise_Entries[] = {
{ 0, 0, 1, RtemsIntrReqRaise_Post_Status_InvId,
@@ -505,8 +522,8 @@ static size_t RtemsIntrReqRaise_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqRaise_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsIntrReqRaise_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -520,55 +537,54 @@ static T_fixture RtemsIntrReqRaise_Fixture = {
.initial_context = &RtemsIntrReqRaise_Instance
};
-static inline RtemsIntrReqRaise_Entry RtemsIntrReqRaise_GetEntry(
- size_t index
+static inline RtemsIntrReqRaise_Entry RtemsIntrReqRaise_PopEntry(
+ RtemsIntrReqRaise_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqRaise_Entries[
RtemsIntrReqRaise_Map[ index ]
];
}
+static void RtemsIntrReqRaise_TestVariant( RtemsIntrReqRaise_Context *ctx )
+{
+ RtemsIntrReqRaise_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqRaise_Pre_CanRaise_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanRaise_NA ? RtemsIntrReqRaise_Pre_CanRaise_NA : ctx->Map.pcs[ 1 ]
+ );
+ RtemsIntrReqRaise_Action( ctx );
+ RtemsIntrReqRaise_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqRaise_Post_Pending_Check( ctx, ctx->Map.entry.Post_Pending );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqRaise( void )
*/
T_TEST_CASE_FIXTURE( RtemsIntrReqRaise, &RtemsIntrReqRaise_Fixture )
{
RtemsIntrReqRaise_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqRaise_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqRaise_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqRaise_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqRaise_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqRaise_Pre_CanRaise_Yes;
- ctx->pcs[ 1 ] < RtemsIntrReqRaise_Pre_CanRaise_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqRaise_Pre_CanRaise_Yes;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqRaise_Pre_CanRaise_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
- RtemsIntrReqRaise_Entry entry;
- size_t pcs[ 2 ];
-
- entry = RtemsIntrReqRaise_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_CanRaise_NA ) {
- ctx->pcs[ 1 ] = RtemsIntrReqRaise_Pre_CanRaise_NA;
- }
-
- RtemsIntrReqRaise_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqRaise_Pre_CanRaise_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqRaise_Action( ctx );
- RtemsIntrReqRaise_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqRaise_Post_Pending_Check( ctx, entry.Post_Pending );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqRaise_PopEntry( ctx );
+ RtemsIntrReqRaise_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-set-affinity.c b/testsuites/validation/tc-intr-set-affinity.c
index b2b47baea8..a2a6a45e09 100644
--- a/testsuites/validation/tc-intr-set-affinity.c
+++ b/testsuites/validation/tc-intr-set-affinity.c
@@ -108,6 +108,16 @@ typedef enum {
RtemsIntrReqSetAffinity_Post_SetAffinity_NA
} RtemsIntrReqSetAffinity_Post_SetAffinity;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Vector_NA : 1;
+ uint16_t Pre_CPUSetKind_NA : 1;
+ uint16_t Pre_CPUSet_NA : 1;
+ uint16_t Pre_CanSetAffinity_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_SetAffinity : 2;
+} RtemsIntrReqSetAffinity_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/set-affinity test case.
*/
@@ -150,16 +160,33 @@ typedef struct {
*/
cpu_set_t *cpuset;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 4 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 4 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqSetAffinity_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqSetAffinity_Context;
static RtemsIntrReqSetAffinity_Context
@@ -467,7 +494,7 @@ static void RtemsIntrReqSetAffinity_Setup_Wrap( void *arg )
RtemsIntrReqSetAffinity_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsIntrReqSetAffinity_Setup( ctx );
}
@@ -538,16 +565,6 @@ static void RtemsIntrReqSetAffinity_Action(
}
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Vector_NA : 1;
- uint16_t Pre_CPUSetKind_NA : 1;
- uint16_t Pre_CPUSet_NA : 1;
- uint16_t Pre_CanSetAffinity_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_SetAffinity : 2;
-} RtemsIntrReqSetAffinity_Entry;
-
static const RtemsIntrReqSetAffinity_Entry
RtemsIntrReqSetAffinity_Entries[] = {
{ 0, 0, 0, 0, 0, RtemsIntrReqSetAffinity_Post_Status_InvAddr,
@@ -575,8 +592,13 @@ static size_t RtemsIntrReqSetAffinity_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqSetAffinity_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqSetAffinity_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -590,15 +612,38 @@ static T_fixture RtemsIntrReqSetAffinity_Fixture = {
.initial_context = &RtemsIntrReqSetAffinity_Instance
};
-static inline RtemsIntrReqSetAffinity_Entry RtemsIntrReqSetAffinity_GetEntry(
- size_t index
+static inline RtemsIntrReqSetAffinity_Entry RtemsIntrReqSetAffinity_PopEntry(
+ RtemsIntrReqSetAffinity_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqSetAffinity_Entries[
RtemsIntrReqSetAffinity_Map[ index ]
];
}
+static void RtemsIntrReqSetAffinity_TestVariant(
+ RtemsIntrReqSetAffinity_Context *ctx
+)
+{
+ RtemsIntrReqSetAffinity_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqSetAffinity_Pre_CPUSetKind_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqSetAffinity_Pre_CPUSet_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsIntrReqSetAffinity_Pre_CanSetAffinity_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanSetAffinity_NA ? RtemsIntrReqSetAffinity_Pre_CanSetAffinity_NA : ctx->Map.pcs[ 3 ]
+ );
+ RtemsIntrReqSetAffinity_Action( ctx );
+ RtemsIntrReqSetAffinity_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsIntrReqSetAffinity_Post_SetAffinity_Check(
+ ctx,
+ ctx->Map.entry.Post_SetAffinity
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqSetAffinity( void )
*/
@@ -608,59 +653,34 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqSetAffinity_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqSetAffinity_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqSetAffinity_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqSetAffinity_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqSetAffinity_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqSetAffinity_Pre_CPUSetKind_Valid;
- ctx->pcs[ 1 ] < RtemsIntrReqSetAffinity_Pre_CPUSetKind_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqSetAffinity_Pre_CPUSetKind_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqSetAffinity_Pre_CPUSetKind_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqSetAffinity_Pre_CPUSet_Valid;
- ctx->pcs[ 2 ] < RtemsIntrReqSetAffinity_Pre_CPUSet_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqSetAffinity_Pre_CPUSet_Valid;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqSetAffinity_Pre_CPUSet_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsIntrReqSetAffinity_Pre_CanSetAffinity_Yes;
- ctx->pcs[ 3 ] < RtemsIntrReqSetAffinity_Pre_CanSetAffinity_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsIntrReqSetAffinity_Pre_CanSetAffinity_Yes;
+ ctx->Map.pcs[ 3 ] < RtemsIntrReqSetAffinity_Pre_CanSetAffinity_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
- RtemsIntrReqSetAffinity_Entry entry;
- size_t pcs[ 4 ];
-
- entry = RtemsIntrReqSetAffinity_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_CanSetAffinity_NA ) {
- ctx->pcs[ 3 ] = RtemsIntrReqSetAffinity_Pre_CanSetAffinity_NA;
- }
-
+ ctx->Map.entry = RtemsIntrReqSetAffinity_PopEntry( ctx );
RtemsIntrReqSetAffinity_Prepare( ctx );
- RtemsIntrReqSetAffinity_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqSetAffinity_Pre_CPUSetKind_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqSetAffinity_Pre_CPUSet_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqSetAffinity_Pre_CanSetAffinity_Prepare(
- ctx,
- ctx->pcs[ 3 ]
- );
- RtemsIntrReqSetAffinity_Action( ctx );
- RtemsIntrReqSetAffinity_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqSetAffinity_Post_SetAffinity_Check(
- ctx,
- entry.Post_SetAffinity
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ RtemsIntrReqSetAffinity_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-vector-disable.c b/testsuites/validation/tc-intr-vector-disable.c
index 7596f4f526..fea05a257a 100644
--- a/testsuites/validation/tc-intr-vector-disable.c
+++ b/testsuites/validation/tc-intr-vector-disable.c
@@ -102,6 +102,15 @@ typedef enum {
RtemsIntrReqVectorDisable_Post_IsEnabled_NA
} RtemsIntrReqVectorDisable_Post_IsEnabled;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_IsEnabled_NA : 1;
+ uint8_t Pre_CanDisable_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_IsEnabled : 2;
+} RtemsIntrReqVectorDisable_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/vector-disable test case.
*/
@@ -128,16 +137,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqVectorDisable_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqVectorDisable_Context;
static RtemsIntrReqVectorDisable_Context
@@ -513,15 +539,6 @@ static void RtemsIntrReqVectorDisable_Action(
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_IsEnabled_NA : 1;
- uint8_t Pre_CanDisable_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_IsEnabled : 2;
-} RtemsIntrReqVectorDisable_Entry;
-
static const RtemsIntrReqVectorDisable_Entry
RtemsIntrReqVectorDisable_Entries[] = {
{ 0, 0, 1, 1, RtemsIntrReqVectorDisable_Post_Status_InvId,
@@ -545,8 +562,13 @@ static size_t RtemsIntrReqVectorDisable_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqVectorDisable_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqVectorDisable_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -561,13 +583,41 @@ static T_fixture RtemsIntrReqVectorDisable_Fixture = {
};
static inline RtemsIntrReqVectorDisable_Entry
-RtemsIntrReqVectorDisable_GetEntry( size_t index )
+RtemsIntrReqVectorDisable_PopEntry( RtemsIntrReqVectorDisable_Context *ctx )
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqVectorDisable_Entries[
RtemsIntrReqVectorDisable_Map[ index ]
];
}
+static void RtemsIntrReqVectorDisable_TestVariant(
+ RtemsIntrReqVectorDisable_Context *ctx
+)
+{
+ RtemsIntrReqVectorDisable_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqVectorDisable_Pre_IsEnabled_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_IsEnabled_NA ? RtemsIntrReqVectorDisable_Pre_IsEnabled_NA : ctx->Map.pcs[ 1 ]
+ );
+ RtemsIntrReqVectorDisable_Pre_CanDisable_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanDisable_NA ? RtemsIntrReqVectorDisable_Pre_CanDisable_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqVectorDisable_Action( ctx );
+ RtemsIntrReqVectorDisable_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqVectorDisable_Post_IsEnabled_Check(
+ ctx,
+ ctx->Map.entry.Post_IsEnabled
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqVectorDisable( void )
*/
@@ -577,53 +627,28 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqVectorDisable_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqVectorDisable_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqVectorDisable_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqVectorDisable_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqVectorDisable_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqVectorDisable_Pre_IsEnabled_Yes;
- ctx->pcs[ 1 ] < RtemsIntrReqVectorDisable_Pre_IsEnabled_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqVectorDisable_Pre_IsEnabled_Yes;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqVectorDisable_Pre_IsEnabled_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqVectorDisable_Pre_CanDisable_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqVectorDisable_Pre_CanDisable_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqVectorDisable_Pre_CanDisable_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqVectorDisable_Pre_CanDisable_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsIntrReqVectorDisable_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsIntrReqVectorDisable_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_IsEnabled_NA ) {
- ctx->pcs[ 1 ] = RtemsIntrReqVectorDisable_Pre_IsEnabled_NA;
- }
-
- if ( entry.Pre_CanDisable_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqVectorDisable_Pre_CanDisable_NA;
- }
-
- RtemsIntrReqVectorDisable_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqVectorDisable_Pre_IsEnabled_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqVectorDisable_Pre_CanDisable_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqVectorDisable_Action( ctx );
- RtemsIntrReqVectorDisable_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqVectorDisable_Post_IsEnabled_Check(
- ctx,
- entry.Post_IsEnabled
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqVectorDisable_PopEntry( ctx );
+ RtemsIntrReqVectorDisable_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-vector-enable.c b/testsuites/validation/tc-intr-vector-enable.c
index 76e1bd0191..c0d985a9d0 100644
--- a/testsuites/validation/tc-intr-vector-enable.c
+++ b/testsuites/validation/tc-intr-vector-enable.c
@@ -102,6 +102,15 @@ typedef enum {
RtemsIntrReqVectorEnable_Post_IsEnabled_NA
} RtemsIntrReqVectorEnable_Post_IsEnabled;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_IsEnabled_NA : 1;
+ uint8_t Pre_CanEnable_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_IsEnabled : 2;
+} RtemsIntrReqVectorEnable_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/vector-enable test case.
*/
@@ -128,16 +137,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqVectorEnable_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqVectorEnable_Context;
static RtemsIntrReqVectorEnable_Context
@@ -518,15 +544,6 @@ static void RtemsIntrReqVectorEnable_Action(
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_IsEnabled_NA : 1;
- uint8_t Pre_CanEnable_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_IsEnabled : 2;
-} RtemsIntrReqVectorEnable_Entry;
-
static const RtemsIntrReqVectorEnable_Entry
RtemsIntrReqVectorEnable_Entries[] = {
{ 0, 0, 1, 1, RtemsIntrReqVectorEnable_Post_Status_InvId,
@@ -550,8 +567,13 @@ static size_t RtemsIntrReqVectorEnable_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsIntrReqVectorEnable_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsIntrReqVectorEnable_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -565,15 +587,43 @@ static T_fixture RtemsIntrReqVectorEnable_Fixture = {
.initial_context = &RtemsIntrReqVectorEnable_Instance
};
-static inline RtemsIntrReqVectorEnable_Entry RtemsIntrReqVectorEnable_GetEntry(
- size_t index
+static inline RtemsIntrReqVectorEnable_Entry RtemsIntrReqVectorEnable_PopEntry(
+ RtemsIntrReqVectorEnable_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqVectorEnable_Entries[
RtemsIntrReqVectorEnable_Map[ index ]
];
}
+static void RtemsIntrReqVectorEnable_TestVariant(
+ RtemsIntrReqVectorEnable_Context *ctx
+)
+{
+ RtemsIntrReqVectorEnable_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqVectorEnable_Pre_IsEnabled_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_IsEnabled_NA ? RtemsIntrReqVectorEnable_Pre_IsEnabled_NA : ctx->Map.pcs[ 1 ]
+ );
+ RtemsIntrReqVectorEnable_Pre_CanEnable_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_CanEnable_NA ? RtemsIntrReqVectorEnable_Pre_CanEnable_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqVectorEnable_Action( ctx );
+ RtemsIntrReqVectorEnable_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqVectorEnable_Post_IsEnabled_Check(
+ ctx,
+ ctx->Map.entry.Post_IsEnabled
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqVectorEnable( void )
*/
@@ -583,53 +633,28 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqVectorEnable_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqVectorEnable_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqVectorEnable_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqVectorEnable_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqVectorEnable_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqVectorEnable_Pre_IsEnabled_Yes;
- ctx->pcs[ 1 ] < RtemsIntrReqVectorEnable_Pre_IsEnabled_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqVectorEnable_Pre_IsEnabled_Yes;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqVectorEnable_Pre_IsEnabled_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqVectorEnable_Pre_CanEnable_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqVectorEnable_Pre_CanEnable_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqVectorEnable_Pre_CanEnable_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqVectorEnable_Pre_CanEnable_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsIntrReqVectorEnable_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsIntrReqVectorEnable_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_IsEnabled_NA ) {
- ctx->pcs[ 1 ] = RtemsIntrReqVectorEnable_Pre_IsEnabled_NA;
- }
-
- if ( entry.Pre_CanEnable_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqVectorEnable_Pre_CanEnable_NA;
- }
-
- RtemsIntrReqVectorEnable_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqVectorEnable_Pre_IsEnabled_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqVectorEnable_Pre_CanEnable_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsIntrReqVectorEnable_Action( ctx );
- RtemsIntrReqVectorEnable_Post_Status_Check( ctx, entry.Post_Status );
- RtemsIntrReqVectorEnable_Post_IsEnabled_Check(
- ctx,
- entry.Post_IsEnabled
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqVectorEnable_PopEntry( ctx );
+ RtemsIntrReqVectorEnable_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-intr-vector-is-enabled.c b/testsuites/validation/tc-intr-vector-is-enabled.c
index 15f13a132b..de1d0c2ebb 100644
--- a/testsuites/validation/tc-intr-vector-is-enabled.c
+++ b/testsuites/validation/tc-intr-vector-is-enabled.c
@@ -101,6 +101,15 @@ typedef enum {
RtemsIntrReqVectorIsEnabled_Post_IsEnabled_NA
} RtemsIntrReqVectorIsEnabled_Post_IsEnabled;
+typedef struct {
+ uint8_t Skip : 1;
+ uint8_t Pre_Vector_NA : 1;
+ uint8_t Pre_Enabled_NA : 1;
+ uint8_t Pre_IsEnabled_NA : 1;
+ uint8_t Post_Status : 2;
+ uint8_t Post_IsEnabled : 2;
+} RtemsIntrReqVectorIsEnabled_Entry;
+
/**
* @brief Test context for spec:/rtems/intr/req/vector-is-enabled test case.
*/
@@ -143,16 +152,33 @@ typedef struct {
*/
rtems_status_code status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 3 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 3 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsIntrReqVectorIsEnabled_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsIntrReqVectorIsEnabled_Context;
static RtemsIntrReqVectorIsEnabled_Context
@@ -495,15 +521,6 @@ static void RtemsIntrReqVectorIsEnabled_Action(
}
}
-typedef struct {
- uint8_t Skip : 1;
- uint8_t Pre_Vector_NA : 1;
- uint8_t Pre_Enabled_NA : 1;
- uint8_t Pre_IsEnabled_NA : 1;
- uint8_t Post_Status : 2;
- uint8_t Post_IsEnabled : 2;
-} RtemsIntrReqVectorIsEnabled_Entry;
-
static const RtemsIntrReqVectorIsEnabled_Entry
RtemsIntrReqVectorIsEnabled_Entries[] = {
{ 0, 0, 0, 0, RtemsIntrReqVectorIsEnabled_Post_Status_InvAddr,
@@ -533,12 +550,12 @@ static size_t RtemsIntrReqVectorIsEnabled_Scope(
ctx = arg;
- if ( ctx->in_action_loop ) {
+ if ( ctx->Map.in_action_loop ) {
return T_get_scope(
RtemsIntrReqVectorIsEnabled_PreDesc,
buf,
n,
- ctx->pcs
+ ctx->Map.pcs
);
}
@@ -554,13 +571,40 @@ static T_fixture RtemsIntrReqVectorIsEnabled_Fixture = {
};
static inline RtemsIntrReqVectorIsEnabled_Entry
-RtemsIntrReqVectorIsEnabled_GetEntry( size_t index )
+RtemsIntrReqVectorIsEnabled_PopEntry(
+ RtemsIntrReqVectorIsEnabled_Context *ctx
+)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsIntrReqVectorIsEnabled_Entries[
RtemsIntrReqVectorIsEnabled_Map[ index ]
];
}
+static void RtemsIntrReqVectorIsEnabled_TestVariant(
+ RtemsIntrReqVectorIsEnabled_Context *ctx
+)
+{
+ RtemsIntrReqVectorIsEnabled_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsIntrReqVectorIsEnabled_Pre_Enabled_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_Prepare(
+ ctx,
+ ctx->Map.entry.Pre_IsEnabled_NA ? RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_NA : ctx->Map.pcs[ 2 ]
+ );
+ RtemsIntrReqVectorIsEnabled_Action( ctx );
+ RtemsIntrReqVectorIsEnabled_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsIntrReqVectorIsEnabled_Post_IsEnabled_Check(
+ ctx,
+ ctx->Map.entry.Post_IsEnabled
+ );
+}
+
/**
* @fn void T_case_body_RtemsIntrReqVectorIsEnabled( void )
*/
@@ -570,55 +614,28 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsIntrReqVectorIsEnabled_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsIntrReqVectorIsEnabled_Pre_Vector_Valid;
- ctx->pcs[ 0 ] < RtemsIntrReqVectorIsEnabled_Pre_Vector_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsIntrReqVectorIsEnabled_Pre_Vector_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsIntrReqVectorIsEnabled_Pre_Vector_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsIntrReqVectorIsEnabled_Pre_Enabled_Obj;
- ctx->pcs[ 1 ] < RtemsIntrReqVectorIsEnabled_Pre_Enabled_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsIntrReqVectorIsEnabled_Pre_Enabled_Obj;
+ ctx->Map.pcs[ 1 ] < RtemsIntrReqVectorIsEnabled_Pre_Enabled_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_Yes;
- ctx->pcs[ 2 ] < RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
- RtemsIntrReqVectorIsEnabled_Entry entry;
- size_t pcs[ 3 ];
-
- entry = RtemsIntrReqVectorIsEnabled_GetEntry( index );
- ++index;
-
- memcpy( pcs, ctx->pcs, sizeof( pcs ) );
-
- if ( entry.Pre_IsEnabled_NA ) {
- ctx->pcs[ 2 ] = RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_NA;
- }
-
- RtemsIntrReqVectorIsEnabled_Pre_Vector_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsIntrReqVectorIsEnabled_Pre_Enabled_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsIntrReqVectorIsEnabled_Pre_IsEnabled_Prepare(
- ctx,
- ctx->pcs[ 2 ]
- );
- RtemsIntrReqVectorIsEnabled_Action( ctx );
- RtemsIntrReqVectorIsEnabled_Post_Status_Check(
- ctx,
- entry.Post_Status
- );
- RtemsIntrReqVectorIsEnabled_Post_IsEnabled_Check(
- ctx,
- entry.Post_IsEnabled
- );
- memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
+ ctx->Map.entry = RtemsIntrReqVectorIsEnabled_PopEntry( ctx );
+ RtemsIntrReqVectorIsEnabled_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-signal-catch.c b/testsuites/validation/tc-signal-catch.c
index 7276a89a3d..45482fc5a5 100644
--- a/testsuites/validation/tc-signal-catch.c
+++ b/testsuites/validation/tc-signal-catch.c
@@ -122,6 +122,18 @@ typedef enum {
RtemsSignalReqCatch_Post_ASRInfo_NA
} RtemsSignalReqCatch_Post_ASRInfo;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Pending_NA : 1;
+ uint16_t Pre_Handler_NA : 1;
+ uint16_t Pre_Preempt_NA : 1;
+ uint16_t Pre_Timeslice_NA : 1;
+ uint16_t Pre_ASR_NA : 1;
+ uint16_t Pre_IntLvl_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_ASRInfo : 3;
+} RtemsSignalReqCatch_Entry;
+
/**
* @brief Test context for spec:/rtems/signal/req/catch test case.
*/
@@ -196,16 +208,33 @@ typedef struct {
*/
rtems_status_code send_status;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 6 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 6 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsSignalReqCatch_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsSignalReqCatch_Context;
static RtemsSignalReqCatch_Context
@@ -685,7 +714,7 @@ static void RtemsSignalReqCatch_Setup_Wrap( void *arg )
RtemsSignalReqCatch_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsSignalReqCatch_Setup( ctx );
}
@@ -700,7 +729,7 @@ static void RtemsSignalReqCatch_Teardown_Wrap( void *arg )
RtemsSignalReqCatch_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsSignalReqCatch_Teardown( ctx );
}
@@ -745,18 +774,6 @@ static void RtemsSignalReqCatch_Action( RtemsSignalReqCatch_Context *ctx )
T_rsc_success( sc );
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Pending_NA : 1;
- uint16_t Pre_Handler_NA : 1;
- uint16_t Pre_Preempt_NA : 1;
- uint16_t Pre_Timeslice_NA : 1;
- uint16_t Pre_ASR_NA : 1;
- uint16_t Pre_IntLvl_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_ASRInfo : 3;
-} RtemsSignalReqCatch_Entry;
-
static const RtemsSignalReqCatch_Entry
RtemsSignalReqCatch_Entries[] = {
{ 0, 0, 0, 0, 0, 0, 0, RtemsSignalReqCatch_Post_Status_Ok,
@@ -795,8 +812,8 @@ static size_t RtemsSignalReqCatch_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsSignalReqCatch_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsSignalReqCatch_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -810,75 +827,76 @@ static T_fixture RtemsSignalReqCatch_Fixture = {
.initial_context = &RtemsSignalReqCatch_Instance
};
-static inline RtemsSignalReqCatch_Entry RtemsSignalReqCatch_GetEntry(
- size_t index
+static inline RtemsSignalReqCatch_Entry RtemsSignalReqCatch_PopEntry(
+ RtemsSignalReqCatch_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsSignalReqCatch_Entries[
RtemsSignalReqCatch_Map[ index ]
];
}
+static void RtemsSignalReqCatch_TestVariant( RtemsSignalReqCatch_Context *ctx )
+{
+ RtemsSignalReqCatch_Pre_Pending_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsSignalReqCatch_Pre_Handler_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsSignalReqCatch_Pre_Preempt_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsSignalReqCatch_Pre_Timeslice_Prepare( ctx, ctx->Map.pcs[ 3 ] );
+ RtemsSignalReqCatch_Pre_ASR_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsSignalReqCatch_Pre_IntLvl_Prepare( ctx, ctx->Map.pcs[ 5 ] );
+ RtemsSignalReqCatch_Action( ctx );
+ RtemsSignalReqCatch_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsSignalReqCatch_Post_ASRInfo_Check( ctx, ctx->Map.entry.Post_ASRInfo );
+}
+
/**
* @fn void T_case_body_RtemsSignalReqCatch( void )
*/
T_TEST_CASE_FIXTURE( RtemsSignalReqCatch, &RtemsSignalReqCatch_Fixture )
{
RtemsSignalReqCatch_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsSignalReqCatch_Pre_Pending_Yes;
- ctx->pcs[ 0 ] < RtemsSignalReqCatch_Pre_Pending_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsSignalReqCatch_Pre_Pending_Yes;
+ ctx->Map.pcs[ 0 ] < RtemsSignalReqCatch_Pre_Pending_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsSignalReqCatch_Pre_Handler_Invalid;
- ctx->pcs[ 1 ] < RtemsSignalReqCatch_Pre_Handler_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsSignalReqCatch_Pre_Handler_Invalid;
+ ctx->Map.pcs[ 1 ] < RtemsSignalReqCatch_Pre_Handler_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsSignalReqCatch_Pre_Preempt_Yes;
- ctx->pcs[ 2 ] < RtemsSignalReqCatch_Pre_Preempt_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsSignalReqCatch_Pre_Preempt_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsSignalReqCatch_Pre_Preempt_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsSignalReqCatch_Pre_Timeslice_Yes;
- ctx->pcs[ 3 ] < RtemsSignalReqCatch_Pre_Timeslice_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsSignalReqCatch_Pre_Timeslice_Yes;
+ ctx->Map.pcs[ 3 ] < RtemsSignalReqCatch_Pre_Timeslice_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsSignalReqCatch_Pre_ASR_Yes;
- ctx->pcs[ 4 ] < RtemsSignalReqCatch_Pre_ASR_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsSignalReqCatch_Pre_ASR_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsSignalReqCatch_Pre_ASR_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
for (
- ctx->pcs[ 5 ] = RtemsSignalReqCatch_Pre_IntLvl_Zero;
- ctx->pcs[ 5 ] < RtemsSignalReqCatch_Pre_IntLvl_NA;
- ++ctx->pcs[ 5 ]
+ ctx->Map.pcs[ 5 ] = RtemsSignalReqCatch_Pre_IntLvl_Zero;
+ ctx->Map.pcs[ 5 ] < RtemsSignalReqCatch_Pre_IntLvl_NA;
+ ++ctx->Map.pcs[ 5 ]
) {
- RtemsSignalReqCatch_Entry entry;
-
- entry = RtemsSignalReqCatch_GetEntry( index );
- ++index;
-
+ ctx->Map.entry = RtemsSignalReqCatch_PopEntry( ctx );
RtemsSignalReqCatch_Prepare( ctx );
- RtemsSignalReqCatch_Pre_Pending_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsSignalReqCatch_Pre_Handler_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsSignalReqCatch_Pre_Preempt_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsSignalReqCatch_Pre_Timeslice_Prepare( ctx, ctx->pcs[ 3 ] );
- RtemsSignalReqCatch_Pre_ASR_Prepare( ctx, ctx->pcs[ 4 ] );
- RtemsSignalReqCatch_Pre_IntLvl_Prepare( ctx, ctx->pcs[ 5 ] );
- RtemsSignalReqCatch_Action( ctx );
- RtemsSignalReqCatch_Post_Status_Check( ctx, entry.Post_Status );
- RtemsSignalReqCatch_Post_ASRInfo_Check(
- ctx,
- entry.Post_ASRInfo
- );
+ RtemsSignalReqCatch_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-signal-send.c b/testsuites/validation/tc-signal-send.c
index 6ab9fcfb7d..d884cdf230 100644
--- a/testsuites/validation/tc-signal-send.c
+++ b/testsuites/validation/tc-signal-send.c
@@ -120,6 +120,18 @@ typedef enum {
RtemsSignalReqSend_Post_Recursive_NA
} RtemsSignalReqSend_Post_Recursive;
+typedef struct {
+ uint16_t Skip : 1;
+ uint16_t Pre_Task_NA : 1;
+ uint16_t Pre_Set_NA : 1;
+ uint16_t Pre_Handler_NA : 1;
+ uint16_t Pre_ASR_NA : 1;
+ uint16_t Pre_Nested_NA : 1;
+ uint16_t Post_Status : 3;
+ uint16_t Post_Handler : 3;
+ uint16_t Post_Recursive : 2;
+} RtemsSignalReqSend_Entry;
+
/**
* @brief Test context for spec:/rtems/signal/req/send test case.
*/
@@ -152,16 +164,33 @@ typedef struct {
rtems_signal_set signal_set;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 5 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 5 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsSignalReqSend_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsSignalReqSend_Context;
static RtemsSignalReqSend_Context
@@ -658,7 +687,7 @@ static void RtemsSignalReqSend_Setup_Wrap( void *arg )
RtemsSignalReqSend_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsSignalReqSend_Setup( ctx );
}
@@ -673,7 +702,7 @@ static void RtemsSignalReqSend_Teardown_Wrap( void *arg )
RtemsSignalReqSend_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsSignalReqSend_Teardown( ctx );
}
@@ -730,18 +759,6 @@ static void RtemsSignalReqSend_Action( RtemsSignalReqSend_Context *ctx )
}
}
-typedef struct {
- uint16_t Skip : 1;
- uint16_t Pre_Task_NA : 1;
- uint16_t Pre_Set_NA : 1;
- uint16_t Pre_Handler_NA : 1;
- uint16_t Pre_ASR_NA : 1;
- uint16_t Pre_Nested_NA : 1;
- uint16_t Post_Status : 3;
- uint16_t Post_Handler : 3;
- uint16_t Post_Recursive : 2;
-} RtemsSignalReqSend_Entry;
-
static const RtemsSignalReqSend_Entry
RtemsSignalReqSend_Entries[] = {
{ 0, 0, 0, 0, 0, 0, RtemsSignalReqSend_Post_Status_InvNum,
@@ -782,8 +799,8 @@ static size_t RtemsSignalReqSend_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsSignalReqSend_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope( RtemsSignalReqSend_PreDesc, buf, n, ctx->Map.pcs );
}
return 0;
@@ -797,70 +814,74 @@ static T_fixture RtemsSignalReqSend_Fixture = {
.initial_context = &RtemsSignalReqSend_Instance
};
-static inline RtemsSignalReqSend_Entry RtemsSignalReqSend_GetEntry(
- size_t index
+static inline RtemsSignalReqSend_Entry RtemsSignalReqSend_PopEntry(
+ RtemsSignalReqSend_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsSignalReqSend_Entries[
RtemsSignalReqSend_Map[ index ]
];
}
+static void RtemsSignalReqSend_TestVariant( RtemsSignalReqSend_Context *ctx )
+{
+ RtemsSignalReqSend_Pre_Task_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsSignalReqSend_Pre_Set_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsSignalReqSend_Pre_Handler_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsSignalReqSend_Pre_ASR_Prepare( ctx, ctx->Map.pcs[ 3 ] );
+ RtemsSignalReqSend_Pre_Nested_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsSignalReqSend_Action( ctx );
+ RtemsSignalReqSend_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
+ RtemsSignalReqSend_Post_Handler_Check( ctx, ctx->Map.entry.Post_Handler );
+ RtemsSignalReqSend_Post_Recursive_Check(
+ ctx,
+ ctx->Map.entry.Post_Recursive
+ );
+}
+
/**
* @fn void T_case_body_RtemsSignalReqSend( void )
*/
T_TEST_CASE_FIXTURE( RtemsSignalReqSend, &RtemsSignalReqSend_Fixture )
{
RtemsSignalReqSend_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsSignalReqSend_Pre_Task_NoObj;
- ctx->pcs[ 0 ] < RtemsSignalReqSend_Pre_Task_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsSignalReqSend_Pre_Task_NoObj;
+ ctx->Map.pcs[ 0 ] < RtemsSignalReqSend_Pre_Task_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsSignalReqSend_Pre_Set_Zero;
- ctx->pcs[ 1 ] < RtemsSignalReqSend_Pre_Set_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsSignalReqSend_Pre_Set_Zero;
+ ctx->Map.pcs[ 1 ] < RtemsSignalReqSend_Pre_Set_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsSignalReqSend_Pre_Handler_Invalid;
- ctx->pcs[ 2 ] < RtemsSignalReqSend_Pre_Handler_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsSignalReqSend_Pre_Handler_Invalid;
+ ctx->Map.pcs[ 2 ] < RtemsSignalReqSend_Pre_Handler_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsSignalReqSend_Pre_ASR_Enabled;
- ctx->pcs[ 3 ] < RtemsSignalReqSend_Pre_ASR_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsSignalReqSend_Pre_ASR_Enabled;
+ ctx->Map.pcs[ 3 ] < RtemsSignalReqSend_Pre_ASR_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsSignalReqSend_Pre_Nested_Yes;
- ctx->pcs[ 4 ] < RtemsSignalReqSend_Pre_Nested_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsSignalReqSend_Pre_Nested_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsSignalReqSend_Pre_Nested_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
- RtemsSignalReqSend_Entry entry;
-
- entry = RtemsSignalReqSend_GetEntry( index );
- ++index;
-
+ ctx->Map.entry = RtemsSignalReqSend_PopEntry( ctx );
RtemsSignalReqSend_Prepare( ctx );
- RtemsSignalReqSend_Pre_Task_Prepare( ctx, ctx->pcs[ 0 ] );
- RtemsSignalReqSend_Pre_Set_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsSignalReqSend_Pre_Handler_Prepare( ctx, ctx->pcs[ 2 ] );
- RtemsSignalReqSend_Pre_ASR_Prepare( ctx, ctx->pcs[ 3 ] );
- RtemsSignalReqSend_Pre_Nested_Prepare( ctx, ctx->pcs[ 4 ] );
- RtemsSignalReqSend_Action( ctx );
- RtemsSignalReqSend_Post_Status_Check( ctx, entry.Post_Status );
- RtemsSignalReqSend_Post_Handler_Check( ctx, entry.Post_Handler );
- RtemsSignalReqSend_Post_Recursive_Check(
- ctx,
- entry.Post_Recursive
- );
+ RtemsSignalReqSend_TestVariant( ctx );
}
}
}
diff --git a/testsuites/validation/tc-task-create-errors.c b/testsuites/validation/tc-task-create-errors.c
index 3121d753fc..1159773eed 100644
--- a/testsuites/validation/tc-task-create-errors.c
+++ b/testsuites/validation/tc-task-create-errors.c
@@ -147,6 +147,22 @@ typedef enum {
RtemsTaskReqCreateErrors_Post_DelExt_NA
} RtemsTaskReqCreateErrors_Post_DelExt;
+typedef struct {
+ uint32_t Skip : 1;
+ uint32_t Pre_Name_NA : 1;
+ uint32_t Pre_Id_NA : 1;
+ uint32_t Pre_SysTsk_NA : 1;
+ uint32_t Pre_Prio_NA : 1;
+ uint32_t Pre_Free_NA : 1;
+ uint32_t Pre_Stack_NA : 1;
+ uint32_t Pre_Ext_NA : 1;
+ uint32_t Post_Status : 3;
+ uint32_t Post_Name : 2;
+ uint32_t Post_IdVar : 2;
+ uint32_t Post_CreateExt : 2;
+ uint32_t Post_DelExt : 2;
+} RtemsTaskReqCreateErrors_Entry;
+
/**
* @brief Test context for spec:/rtems/task/req/create-errors test case.
*/
@@ -175,16 +191,33 @@ typedef struct {
void *seized_objects;
- /**
- * @brief This member defines the pre-condition states for the next action.
- */
- size_t pcs[ 7 ];
-
- /**
- * @brief This member indicates if the test action loop is currently
- * executed.
- */
- bool in_action_loop;
+ struct {
+ /**
+ * @brief This member defines the pre-condition states for the next action.
+ */
+ size_t pcs[ 7 ];
+
+ /**
+ * @brief If this member is true, then the test action loop is executed.
+ */
+ bool in_action_loop;
+
+ /**
+ * @brief This member contains the next transition map index.
+ */
+ size_t index;
+
+ /**
+ * @brief This member contains the current transition map entry.
+ */
+ RtemsTaskReqCreateErrors_Entry entry;
+
+ /**
+ * @brief If this member is true, then the current transition variant
+ * should be skipped.
+ */
+ bool skip;
+ } Map;
} RtemsTaskReqCreateErrors_Context;
static RtemsTaskReqCreateErrors_Context
@@ -709,7 +742,7 @@ static void RtemsTaskReqCreateErrors_Setup_Wrap( void *arg )
RtemsTaskReqCreateErrors_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsTaskReqCreateErrors_Setup( ctx );
}
@@ -728,7 +761,7 @@ static void RtemsTaskReqCreateErrors_Teardown_Wrap( void *arg )
RtemsTaskReqCreateErrors_Context *ctx;
ctx = arg;
- ctx->in_action_loop = false;
+ ctx->Map.in_action_loop = false;
RtemsTaskReqCreateErrors_Teardown( ctx );
}
@@ -775,22 +808,6 @@ static void RtemsTaskReqCreateErrors_Cleanup(
T_surrender_objects( &ctx->seized_objects, rtems_task_delete );
}
-typedef struct {
- uint32_t Skip : 1;
- uint32_t Pre_Name_NA : 1;
- uint32_t Pre_Id_NA : 1;
- uint32_t Pre_SysTsk_NA : 1;
- uint32_t Pre_Prio_NA : 1;
- uint32_t Pre_Free_NA : 1;
- uint32_t Pre_Stack_NA : 1;
- uint32_t Pre_Ext_NA : 1;
- uint32_t Post_Status : 3;
- uint32_t Post_Name : 2;
- uint32_t Post_IdVar : 2;
- uint32_t Post_CreateExt : 2;
- uint32_t Post_DelExt : 2;
-} RtemsTaskReqCreateErrors_Entry;
-
static const RtemsTaskReqCreateErrors_Entry
RtemsTaskReqCreateErrors_Entries[] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, RtemsTaskReqCreateErrors_Post_Status_InvName,
@@ -852,8 +869,13 @@ static size_t RtemsTaskReqCreateErrors_Scope( void *arg, char *buf, size_t n )
ctx = arg;
- if ( ctx->in_action_loop ) {
- return T_get_scope( RtemsTaskReqCreateErrors_PreDesc, buf, n, ctx->pcs );
+ if ( ctx->Map.in_action_loop ) {
+ return T_get_scope(
+ RtemsTaskReqCreateErrors_PreDesc,
+ buf,
+ n,
+ ctx->Map.pcs
+ );
}
return 0;
@@ -867,15 +889,47 @@ static T_fixture RtemsTaskReqCreateErrors_Fixture = {
.initial_context = &RtemsTaskReqCreateErrors_Instance
};
-static inline RtemsTaskReqCreateErrors_Entry RtemsTaskReqCreateErrors_GetEntry(
- size_t index
+static inline RtemsTaskReqCreateErrors_Entry RtemsTaskReqCreateErrors_PopEntry(
+ RtemsTaskReqCreateErrors_Context *ctx
)
{
+ size_t index;
+
+ index = ctx->Map.index;
+ ctx->Map.index = index + 1;
return RtemsTaskReqCreateErrors_Entries[
RtemsTaskReqCreateErrors_Map[ index ]
];
}
+static void RtemsTaskReqCreateErrors_TestVariant(
+ RtemsTaskReqCreateErrors_Context *ctx
+)
+{
+ RtemsTaskReqCreateErrors_Pre_Name_Prepare( ctx, ctx->Map.pcs[ 0 ] );
+ RtemsTaskReqCreateErrors_Pre_Id_Prepare( ctx, ctx->Map.pcs[ 1 ] );
+ RtemsTaskReqCreateErrors_Pre_SysTsk_Prepare( ctx, ctx->Map.pcs[ 2 ] );
+ RtemsTaskReqCreateErrors_Pre_Prio_Prepare( ctx, ctx->Map.pcs[ 3 ] );
+ RtemsTaskReqCreateErrors_Pre_Free_Prepare( ctx, ctx->Map.pcs[ 4 ] );
+ RtemsTaskReqCreateErrors_Pre_Stack_Prepare( ctx, ctx->Map.pcs[ 5 ] );
+ RtemsTaskReqCreateErrors_Pre_Ext_Prepare( ctx, ctx->Map.pcs[ 6 ] );
+ RtemsTaskReqCreateErrors_Action( ctx );
+ RtemsTaskReqCreateErrors_Post_Status_Check(
+ ctx,
+ ctx->Map.entry.Post_Status
+ );
+ RtemsTaskReqCreateErrors_Post_Name_Check( ctx, ctx->Map.entry.Post_Name );
+ RtemsTaskReqCreateErrors_Post_IdVar_Check( ctx, ctx->Map.entry.Post_IdVar );
+ RtemsTaskReqCreateErrors_Post_CreateExt_Check(
+ ctx,
+ ctx->Map.entry.Post_CreateExt
+ );
+ RtemsTaskReqCreateErrors_Post_DelExt_Check(
+ ctx,
+ ctx->Map.entry.Post_DelExt
+ );
+}
+
/**
* @fn void T_case_body_RtemsTaskReqCreateErrors( void )
*/
@@ -885,96 +939,49 @@ T_TEST_CASE_FIXTURE(
)
{
RtemsTaskReqCreateErrors_Context *ctx;
- size_t index;
ctx = T_fixture_context();
- ctx->in_action_loop = true;
- index = 0;
+ ctx->Map.in_action_loop = true;
+ ctx->Map.index = 0;
for (
- ctx->pcs[ 0 ] = RtemsTaskReqCreateErrors_Pre_Name_Valid;
- ctx->pcs[ 0 ] < RtemsTaskReqCreateErrors_Pre_Name_NA;
- ++ctx->pcs[ 0 ]
+ ctx->Map.pcs[ 0 ] = RtemsTaskReqCreateErrors_Pre_Name_Valid;
+ ctx->Map.pcs[ 0 ] < RtemsTaskReqCreateErrors_Pre_Name_NA;
+ ++ctx->Map.pcs[ 0 ]
) {
for (
- ctx->pcs[ 1 ] = RtemsTaskReqCreateErrors_Pre_Id_Valid;
- ctx->pcs[ 1 ] < RtemsTaskReqCreateErrors_Pre_Id_NA;
- ++ctx->pcs[ 1 ]
+ ctx->Map.pcs[ 1 ] = RtemsTaskReqCreateErrors_Pre_Id_Valid;
+ ctx->Map.pcs[ 1 ] < RtemsTaskReqCreateErrors_Pre_Id_NA;
+ ++ctx->Map.pcs[ 1 ]
) {
for (
- ctx->pcs[ 2 ] = RtemsTaskReqCreateErrors_Pre_SysTsk_Yes;
- ctx->pcs[ 2 ] < RtemsTaskReqCreateErrors_Pre_SysTsk_NA;
- ++ctx->pcs[ 2 ]
+ ctx->Map.pcs[ 2 ] = RtemsTaskReqCreateErrors_Pre_SysTsk_Yes;
+ ctx->Map.pcs[ 2 ] < RtemsTaskReqCreateErrors_Pre_SysTsk_NA;
+ ++ctx->Map.pcs[ 2 ]
) {
for (
- ctx->pcs[ 3 ] = RtemsTaskReqCreateErrors_Pre_Prio_Valid;
- ctx->pcs[ 3 ] < RtemsTaskReqCreateErrors_Pre_Prio_NA;
- ++ctx->pcs[ 3 ]
+ ctx->Map.pcs[ 3 ] = RtemsTaskReqCreateErrors_Pre_Prio_Valid;
+ ctx->Map.pcs[ 3 ] < RtemsTaskReqCreateErrors_Pre_Prio_NA;
+ ++ctx->Map.pcs[ 3 ]
) {
for (
- ctx->pcs[ 4 ] = RtemsTaskReqCreateErrors_Pre_Free_Yes;
- ctx->pcs[ 4 ] < RtemsTaskReqCreateErrors_Pre_Free_NA;
- ++ctx->pcs[ 4 ]
+ ctx->Map.pcs[ 4 ] = RtemsTaskReqCreateErrors_Pre_Free_Yes;
+ ctx->Map.pcs[ 4 ] < RtemsTaskReqCreateErrors_Pre_Free_NA;
+ ++ctx->Map.pcs[ 4 ]
) {
for (
- ctx->pcs[ 5 ] = RtemsTaskReqCreateErrors_Pre_Stack_Normal;
- ctx->pcs[ 5 ] < RtemsTaskReqCreateErrors_Pre_Stack_NA;
- ++ctx->pcs[ 5 ]
+ ctx->Map.pcs[ 5 ] = RtemsTaskReqCreateErrors_Pre_Stack_Normal;
+ ctx->Map.pcs[ 5 ] < RtemsTaskReqCreateErrors_Pre_Stack_NA;
+ ++ctx->Map.pcs[ 5 ]
) {
for (
- ctx->pcs[ 6 ] = RtemsTaskReqCreateErrors_Pre_Ext_Ok;
- ctx->pcs[ 6 ] < RtemsTaskReqCreateErrors_Pre_Ext_NA;
- ++ctx->pcs[ 6 ]
+ ctx->Map.pcs[ 6 ] = RtemsTaskReqCreateErrors_Pre_Ext_Ok;
+ ctx->Map.pcs[ 6 ] < RtemsTaskReqCreateErrors_Pre_Ext_NA;
+ ++ctx->Map.pcs[ 6 ]
) {
- RtemsTaskReqCreateErrors_Entry entry;
-
- entry = RtemsTaskReqCreateErrors_GetEntry( index );
- ++index;
-
+ ctx->Map.entry = RtemsTaskReqCreateErrors_PopEntry( ctx );
RtemsTaskReqCreateErrors_Prepare( ctx );
- RtemsTaskReqCreateErrors_Pre_Name_Prepare(
- ctx,
- ctx->pcs[ 0 ]
- );
- RtemsTaskReqCreateErrors_Pre_Id_Prepare( ctx, ctx->pcs[ 1 ] );
- RtemsTaskReqCreateErrors_Pre_SysTsk_Prepare(
- ctx,
- ctx->pcs[ 2 ]
- );
- RtemsTaskReqCreateErrors_Pre_Prio_Prepare(
- ctx,
- ctx->pcs[ 3 ]
- );
- RtemsTaskReqCreateErrors_Pre_Free_Prepare(
- ctx,
- ctx->pcs[ 4 ]
- );
- RtemsTaskReqCreateErrors_Pre_Stack_Prepare(
- ctx,
- ctx->pcs[ 5 ]
- );
- RtemsTaskReqCreateErrors_Pre_Ext_Prepare( ctx, ctx->pcs[ 6 ] );
- RtemsTaskReqCreateErrors_Action( ctx );
- RtemsTaskReqCreateErrors_Post_Status_Check(
- ctx,
- entry.Post_Status
- );
- RtemsTaskReqCreateErrors_Post_Name_Check(
- ctx,
- entry.Post_Name
- );
- RtemsTaskReqCreateErrors_Post_IdVar_Check(
- ctx,
- entry.Post_IdVar
- );
- RtemsTaskReqCreateErrors_Post_CreateExt_Check(
- ctx,
- entry.Post_CreateExt
- );
- RtemsTaskReqCreateErrors_Post_DelExt_Check(
- ctx,
- entry.Post_DelExt
- );
+ RtemsTaskReqCreateErrors_TestVariant( ctx );
RtemsTaskReqCreateErrors_Cleanup( ctx );
}
}