[rtems commit] validation: Use common wording
Sebastian Huber
sebh at rtems.org
Mon Mar 8 10:06:56 UTC 2021
Module: rtems
Branch: master
Commit: e76470dfa76b48f01a0f5bd5263f3b16b95766bd
Changeset: http://git.rtems.org/rtems/commit/?id=e76470dfa76b48f01a0f5bd5263f3b16b95766bd
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Mar 8 10:49:51 2021 +0100
validation: Use common wording
---
testsuites/validation/tc-barrier-delete.c | 59 +++++++++++++-----------
testsuites/validation/tc-barrier-release.c | 44 +++++++++---------
testsuites/validation/tc-barrier-wait.c | 44 +++++++++---------
testsuites/validation/tc-signal-send.c | 2 +-
testsuites/validation/tc-task-construct-errors.c | 3 +-
testsuites/validation/tc-task-create-errors.c | 5 +-
6 files changed, 82 insertions(+), 75 deletions(-)
diff --git a/testsuites/validation/tc-barrier-delete.c b/testsuites/validation/tc-barrier-delete.c
index a676889..e54e5c6 100644
--- a/testsuites/validation/tc-barrier-delete.c
+++ b/testsuites/validation/tc-barrier-delete.c
@@ -66,8 +66,8 @@
*/
typedef enum {
- RtemsBarrierReqDelete_Pre_Id_Valid,
- RtemsBarrierReqDelete_Pre_Id_Invalid,
+ RtemsBarrierReqDelete_Pre_Id_NoObj,
+ RtemsBarrierReqDelete_Pre_Id_Barrier,
RtemsBarrierReqDelete_Pre_Id_NA
} RtemsBarrierReqDelete_Pre_Id;
@@ -78,10 +78,10 @@ typedef enum {
} RtemsBarrierReqDelete_Post_Status;
typedef enum {
- RtemsBarrierReqDelete_Post_Id_Valid,
- RtemsBarrierReqDelete_Post_Id_Invalid,
- RtemsBarrierReqDelete_Post_Id_NA
-} RtemsBarrierReqDelete_Post_Id;
+ RtemsBarrierReqDelete_Post_Name_Valid,
+ RtemsBarrierReqDelete_Post_Name_Invalid,
+ RtemsBarrierReqDelete_Post_Name_NA
+} RtemsBarrierReqDelete_Post_Name;
typedef enum {
RtemsBarrierReqDelete_Post_Flush_Yes,
@@ -121,8 +121,8 @@ static RtemsBarrierReqDelete_Context
RtemsBarrierReqDelete_Instance;
static const char * const RtemsBarrierReqDelete_PreDesc_Id[] = {
- "Valid",
- "Invalid",
+ "NoObj",
+ "Barrier",
"NA"
};
@@ -182,19 +182,19 @@ static void RtemsBarrierReqDelete_Pre_Id_Prepare(
)
{
switch ( state ) {
- case RtemsBarrierReqDelete_Pre_Id_Valid: {
+ case RtemsBarrierReqDelete_Pre_Id_NoObj: {
/*
- * The ``id`` parameter shall be associated with the barrier.
+ * The ``id`` parameter shall not be associated with a barrier.
*/
- ctx->id = ctx->barrier_id;
+ ctx->id = 0;
break;
}
- case RtemsBarrierReqDelete_Pre_Id_Invalid: {
+ case RtemsBarrierReqDelete_Pre_Id_Barrier: {
/*
- * The ``id`` parameter shall be invalid.
+ * The ``id`` parameter shall be associated with a barrier.
*/
- ctx->id = 0;
+ ctx->id = ctx->barrier_id;
break;
}
@@ -231,16 +231,16 @@ static void RtemsBarrierReqDelete_Post_Status_Check(
}
}
-static void RtemsBarrierReqDelete_Post_Id_Check(
- RtemsBarrierReqDelete_Context *ctx,
- RtemsBarrierReqDelete_Post_Id state
+static void RtemsBarrierReqDelete_Post_Name_Check(
+ RtemsBarrierReqDelete_Context *ctx,
+ RtemsBarrierReqDelete_Post_Name state
)
{
rtems_status_code sc;
rtems_id id;
switch ( state ) {
- case RtemsBarrierReqDelete_Post_Id_Valid: {
+ case RtemsBarrierReqDelete_Post_Name_Valid: {
/*
* The unique object name shall identify the barrier.
*/
@@ -251,7 +251,7 @@ static void RtemsBarrierReqDelete_Post_Id_Check(
break;
}
- case RtemsBarrierReqDelete_Post_Id_Invalid: {
+ case RtemsBarrierReqDelete_Post_Name_Invalid: {
/*
* The unique object name shall not identify the barrier.
*/
@@ -260,7 +260,7 @@ static void RtemsBarrierReqDelete_Post_Id_Check(
break;
}
- case RtemsBarrierReqDelete_Post_Id_NA:
+ case RtemsBarrierReqDelete_Post_Name_NA:
break;
}
}
@@ -378,13 +378,13 @@ static T_fixture RtemsBarrierReqDelete_Fixture = {
static const uint8_t RtemsBarrierReqDelete_TransitionMap[][ 3 ] = {
{
- RtemsBarrierReqDelete_Post_Status_Ok,
- RtemsBarrierReqDelete_Post_Id_Invalid,
- RtemsBarrierReqDelete_Post_Flush_Yes
- }, {
RtemsBarrierReqDelete_Post_Status_InvId,
- RtemsBarrierReqDelete_Post_Id_Valid,
+ RtemsBarrierReqDelete_Post_Name_Valid,
RtemsBarrierReqDelete_Post_Flush_No
+ }, {
+ RtemsBarrierReqDelete_Post_Status_Ok,
+ RtemsBarrierReqDelete_Post_Name_Invalid,
+ RtemsBarrierReqDelete_Post_Flush_Yes
}
};
@@ -422,6 +422,11 @@ static void RtemsBarrierReqDelete_Cleanup( RtemsBarrierReqDelete_Context *ctx )
sc = rtems_barrier_delete( ctx->barrier_id );
T_rsc_success( sc );
+
+ ++ctx->wait_expected;
+ T_eq_u32( ctx->wait_done, ctx->wait_expected );
+
+ ctx->barrier_id = 0;
}
}
@@ -438,7 +443,7 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqDelete, &RtemsBarrierReqDelete_Fixture )
index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqDelete_Pre_Id_Valid;
+ ctx->pcs[ 0 ] = RtemsBarrierReqDelete_Pre_Id_NoObj;
ctx->pcs[ 0 ] < RtemsBarrierReqDelete_Pre_Id_NA;
++ctx->pcs[ 0 ]
) {
@@ -459,7 +464,7 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqDelete, &RtemsBarrierReqDelete_Fixture )
ctx,
RtemsBarrierReqDelete_TransitionMap[ index ][ 0 ]
);
- RtemsBarrierReqDelete_Post_Id_Check(
+ RtemsBarrierReqDelete_Post_Name_Check(
ctx,
RtemsBarrierReqDelete_TransitionMap[ index ][ 1 ]
);
diff --git a/testsuites/validation/tc-barrier-release.c b/testsuites/validation/tc-barrier-release.c
index 36d7743..f931760 100644
--- a/testsuites/validation/tc-barrier-release.c
+++ b/testsuites/validation/tc-barrier-release.c
@@ -67,11 +67,11 @@
*/
typedef enum {
- RtemsBarrierReqRelease_Pre_Barrier_NoObj,
- RtemsBarrierReqRelease_Pre_Barrier_Manual,
- RtemsBarrierReqRelease_Pre_Barrier_Auto,
- RtemsBarrierReqRelease_Pre_Barrier_NA
-} RtemsBarrierReqRelease_Pre_Barrier;
+ RtemsBarrierReqRelease_Pre_Id_NoObj,
+ RtemsBarrierReqRelease_Pre_Id_Manual,
+ RtemsBarrierReqRelease_Pre_Id_Auto,
+ RtemsBarrierReqRelease_Pre_Id_NA
+} RtemsBarrierReqRelease_Pre_Id;
typedef enum {
RtemsBarrierReqRelease_Pre_Released_Valid,
@@ -133,7 +133,7 @@ typedef struct {
static RtemsBarrierReqRelease_Context
RtemsBarrierReqRelease_Instance;
-static const char * const RtemsBarrierReqRelease_PreDesc_Barrier[] = {
+static const char * const RtemsBarrierReqRelease_PreDesc_Id[] = {
"NoObj",
"Manual",
"Auto",
@@ -153,7 +153,7 @@ static const char * const RtemsBarrierReqRelease_PreDesc_Waiting[] = {
};
static const char * const * const RtemsBarrierReqRelease_PreDesc[] = {
- RtemsBarrierReqRelease_PreDesc_Barrier,
+ RtemsBarrierReqRelease_PreDesc_Id,
RtemsBarrierReqRelease_PreDesc_Released,
RtemsBarrierReqRelease_PreDesc_Waiting,
NULL
@@ -206,21 +206,21 @@ static void Worker( rtems_task_argument arg )
}
}
-static void RtemsBarrierReqRelease_Pre_Barrier_Prepare(
- RtemsBarrierReqRelease_Context *ctx,
- RtemsBarrierReqRelease_Pre_Barrier state
+static void RtemsBarrierReqRelease_Pre_Id_Prepare(
+ RtemsBarrierReqRelease_Context *ctx,
+ RtemsBarrierReqRelease_Pre_Id state
)
{
switch ( state ) {
- case RtemsBarrierReqRelease_Pre_Barrier_NoObj: {
+ case RtemsBarrierReqRelease_Pre_Id_NoObj: {
/*
- * The ``id`` parameter shall be invalid.
+ * The ``id`` parameter shall not be associated with a barrier.
*/
ctx->id = 0xffffffff;
break;
}
- case RtemsBarrierReqRelease_Pre_Barrier_Manual: {
+ case RtemsBarrierReqRelease_Pre_Id_Manual: {
/*
* The ``id`` parameter shall be associated with a manual release
* barrier.
@@ -229,7 +229,7 @@ static void RtemsBarrierReqRelease_Pre_Barrier_Prepare(
break;
}
- case RtemsBarrierReqRelease_Pre_Barrier_Auto: {
+ case RtemsBarrierReqRelease_Pre_Id_Auto: {
/*
* The ``id`` parameter shall be associated with an automatic release
* barrier.
@@ -238,7 +238,7 @@ static void RtemsBarrierReqRelease_Pre_Barrier_Prepare(
break;
}
- case RtemsBarrierReqRelease_Pre_Barrier_NA:
+ case RtemsBarrierReqRelease_Pre_Id_NA:
break;
}
}
@@ -522,7 +522,7 @@ static const uint8_t RtemsBarrierReqRelease_TransitionMap[][ 2 ] = {
static const struct {
uint8_t Skip : 1;
- uint8_t Pre_Barrier_NA : 1;
+ uint8_t Pre_Id_NA : 1;
uint8_t Pre_Released_NA : 1;
uint8_t Pre_Waiting_NA : 1;
} RtemsBarrierReqRelease_TransitionInfo[] = {
@@ -573,13 +573,13 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqRelease, &RtemsBarrierReqRelease_Fixture )
index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Barrier_NoObj;
- ctx->pcs[ 0 ] < RtemsBarrierReqRelease_Pre_Barrier_NA;
+ ctx->pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Id_NoObj;
+ ctx->pcs[ 0 ] < RtemsBarrierReqRelease_Pre_Id_NA;
++ctx->pcs[ 0 ]
) {
- if ( RtemsBarrierReqRelease_TransitionInfo[ index ].Pre_Barrier_NA ) {
- ctx->pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Barrier_NA;
- index += ( RtemsBarrierReqRelease_Pre_Barrier_NA - 1 )
+ if ( RtemsBarrierReqRelease_TransitionInfo[ index ].Pre_Id_NA ) {
+ ctx->pcs[ 0 ] = RtemsBarrierReqRelease_Pre_Id_NA;
+ index += ( RtemsBarrierReqRelease_Pre_Id_NA - 1 )
* RtemsBarrierReqRelease_Pre_Released_NA
* RtemsBarrierReqRelease_Pre_Waiting_NA;
}
@@ -610,7 +610,7 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqRelease, &RtemsBarrierReqRelease_Fixture )
continue;
}
- RtemsBarrierReqRelease_Pre_Barrier_Prepare( ctx, ctx->pcs[ 0 ] );
+ 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 );
diff --git a/testsuites/validation/tc-barrier-wait.c b/testsuites/validation/tc-barrier-wait.c
index a6b3527..6fd5b02 100644
--- a/testsuites/validation/tc-barrier-wait.c
+++ b/testsuites/validation/tc-barrier-wait.c
@@ -66,11 +66,11 @@
*/
typedef enum {
- RtemsBarrierReqWait_Pre_Barrier_NoObj,
- RtemsBarrierReqWait_Pre_Barrier_Manual,
- RtemsBarrierReqWait_Pre_Barrier_Auto,
- RtemsBarrierReqWait_Pre_Barrier_NA
-} RtemsBarrierReqWait_Pre_Barrier;
+ RtemsBarrierReqWait_Pre_Id_NoObj,
+ RtemsBarrierReqWait_Pre_Id_Manual,
+ RtemsBarrierReqWait_Pre_Id_Auto,
+ RtemsBarrierReqWait_Pre_Id_NA
+} RtemsBarrierReqWait_Pre_Id;
typedef enum {
RtemsBarrierReqWait_Pre_Timeout_Ticks,
@@ -130,7 +130,7 @@ typedef struct {
static RtemsBarrierReqWait_Context
RtemsBarrierReqWait_Instance;
-static const char * const RtemsBarrierReqWait_PreDesc_Barrier[] = {
+static const char * const RtemsBarrierReqWait_PreDesc_Id[] = {
"NoObj",
"Manual",
"Auto",
@@ -152,7 +152,7 @@ static const char * const RtemsBarrierReqWait_PreDesc_Satisfy[] = {
};
static const char * const * const RtemsBarrierReqWait_PreDesc[] = {
- RtemsBarrierReqWait_PreDesc_Barrier,
+ RtemsBarrierReqWait_PreDesc_Id,
RtemsBarrierReqWait_PreDesc_Timeout,
RtemsBarrierReqWait_PreDesc_Satisfy,
NULL
@@ -256,21 +256,21 @@ static void Worker( rtems_task_argument arg )
}
}
-static void RtemsBarrierReqWait_Pre_Barrier_Prepare(
- RtemsBarrierReqWait_Context *ctx,
- RtemsBarrierReqWait_Pre_Barrier state
+static void RtemsBarrierReqWait_Pre_Id_Prepare(
+ RtemsBarrierReqWait_Context *ctx,
+ RtemsBarrierReqWait_Pre_Id state
)
{
switch ( state ) {
- case RtemsBarrierReqWait_Pre_Barrier_NoObj: {
+ case RtemsBarrierReqWait_Pre_Id_NoObj: {
/*
- * The ``id`` parameter shall be invalid.
+ * The ``id`` parameter shall not be associated with a barrier.
*/
ctx->id = 0xffffffff;
break;
}
- case RtemsBarrierReqWait_Pre_Barrier_Manual: {
+ case RtemsBarrierReqWait_Pre_Id_Manual: {
/*
* The ``id`` parameter shall be associated with a manual release
* barrier.
@@ -279,7 +279,7 @@ static void RtemsBarrierReqWait_Pre_Barrier_Prepare(
break;
}
- case RtemsBarrierReqWait_Pre_Barrier_Auto: {
+ case RtemsBarrierReqWait_Pre_Id_Auto: {
/*
* The ``id`` parameter shall be associated with an automatic release
* barrier.
@@ -288,7 +288,7 @@ static void RtemsBarrierReqWait_Pre_Barrier_Prepare(
break;
}
- case RtemsBarrierReqWait_Pre_Barrier_NA:
+ case RtemsBarrierReqWait_Pre_Id_NA:
break;
}
}
@@ -608,7 +608,7 @@ static const uint8_t RtemsBarrierReqWait_TransitionMap[][ 1 ] = {
static const struct {
uint8_t Skip : 1;
- uint8_t Pre_Barrier_NA : 1;
+ uint8_t Pre_Id_NA : 1;
uint8_t Pre_Timeout_NA : 1;
uint8_t Pre_Satisfy_NA : 1;
} RtemsBarrierReqWait_TransitionInfo[] = {
@@ -681,13 +681,13 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqWait, &RtemsBarrierReqWait_Fixture )
index = 0;
for (
- ctx->pcs[ 0 ] = RtemsBarrierReqWait_Pre_Barrier_NoObj;
- ctx->pcs[ 0 ] < RtemsBarrierReqWait_Pre_Barrier_NA;
+ ctx->pcs[ 0 ] = RtemsBarrierReqWait_Pre_Id_NoObj;
+ ctx->pcs[ 0 ] < RtemsBarrierReqWait_Pre_Id_NA;
++ctx->pcs[ 0 ]
) {
- if ( RtemsBarrierReqWait_TransitionInfo[ index ].Pre_Barrier_NA ) {
- ctx->pcs[ 0 ] = RtemsBarrierReqWait_Pre_Barrier_NA;
- index += ( RtemsBarrierReqWait_Pre_Barrier_NA - 1 )
+ if ( RtemsBarrierReqWait_TransitionInfo[ index ].Pre_Id_NA ) {
+ ctx->pcs[ 0 ] = RtemsBarrierReqWait_Pre_Id_NA;
+ index += ( RtemsBarrierReqWait_Pre_Id_NA - 1 )
* RtemsBarrierReqWait_Pre_Timeout_NA
* RtemsBarrierReqWait_Pre_Satisfy_NA;
}
@@ -718,7 +718,7 @@ T_TEST_CASE_FIXTURE( RtemsBarrierReqWait, &RtemsBarrierReqWait_Fixture )
continue;
}
- RtemsBarrierReqWait_Pre_Barrier_Prepare( ctx, ctx->pcs[ 0 ] );
+ 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 );
diff --git a/testsuites/validation/tc-signal-send.c b/testsuites/validation/tc-signal-send.c
index 382a716..0d9f67f 100644
--- a/testsuites/validation/tc-signal-send.c
+++ b/testsuites/validation/tc-signal-send.c
@@ -372,7 +372,7 @@ static void RtemsSignalReqSend_Pre_Task_Prepare(
switch ( state ) {
case RtemsSignalReqSend_Pre_Task_NoObj: {
/*
- * The ``id`` parameter shall be invalid.
+ * The ``id`` parameter shall not be associated with a task.
*/
ctx->id = 0xffffffff;
break;
diff --git a/testsuites/validation/tc-task-construct-errors.c b/testsuites/validation/tc-task-construct-errors.c
index 7d4e562..24402d9 100644
--- a/testsuites/validation/tc-task-construct-errors.c
+++ b/testsuites/validation/tc-task-construct-errors.c
@@ -420,7 +420,8 @@ static void RtemsTaskReqConstructErrors_Pre_Prio_Prepare(
switch ( state ) {
case RtemsTaskReqConstructErrors_Pre_Prio_Valid: {
/*
- * The initial priority of the task configuration shall be valid.
+ * The initial priority of the task configuration shall be valid and
+ * non-zero.
*/
ctx->config.initial_priority = 254;
break;
diff --git a/testsuites/validation/tc-task-create-errors.c b/testsuites/validation/tc-task-create-errors.c
index 99cfc67..bf0f085 100644
--- a/testsuites/validation/tc-task-create-errors.c
+++ b/testsuites/validation/tc-task-create-errors.c
@@ -383,7 +383,7 @@ static void RtemsTaskReqCreateErrors_Pre_Prio_Prepare(
switch ( state ) {
case RtemsTaskReqCreateErrors_Pre_Prio_Valid: {
/*
- * The ``initial_priority`` parameter shall be valid.
+ * The ``initial_priority`` parameter shall be valid and non-zero.
*/
ctx->initial_priority = 254;
break;
@@ -446,7 +446,8 @@ static void RtemsTaskReqCreateErrors_Pre_Stack_Prepare(
case RtemsTaskReqCreateErrors_Pre_Stack_Normal: {
/*
* The ``initial_priority`` parameter shall be greater than or equal to
- * the configured minimum size.
+ * the configured minimum size and less than or equal to the maximum
+ * stack size which can be allocated by the system.
*/
ctx->stack_size = RTEMS_MINIMUM_STACK_SIZE;
break;
More information about the vc
mailing list