summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-10 17:03:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-10 17:07:58 +0200
commit58985a4d15233de4ad3c1f534cd18915dc6ea2a6 (patch)
tree9758f1852ef660525a57a197b3c85023632bccce
parentce2758b361e2a19c0f4e2893093d8b506c3619db (diff)
testsuites/validation/tc-task-construct-errors.c
-rw-r--r--testsuites/validation/tc-task-construct-errors.c60
1 files changed, 47 insertions, 13 deletions
diff --git a/testsuites/validation/tc-task-construct-errors.c b/testsuites/validation/tc-task-construct-errors.c
index c31ee29fb8..d82b82d08e 100644
--- a/testsuites/validation/tc-task-construct-errors.c
+++ b/testsuites/validation/tc-task-construct-errors.c
@@ -150,7 +150,8 @@ typedef enum {
} RtemsTaskReqConstructErrors_Post_IdVar;
typedef enum {
- RtemsTaskReqConstructErrors_Post_CreateExt_Yes,
+ RtemsTaskReqConstructErrors_Post_CreateExt_All,
+ RtemsTaskReqConstructErrors_Post_CreateExt_UpToFailing,
RtemsTaskReqConstructErrors_Post_CreateExt_No,
RtemsTaskReqConstructErrors_Post_CreateExt_NA
} RtemsTaskReqConstructErrors_Post_CreateExt;
@@ -191,7 +192,7 @@ typedef struct {
size_t stack_size;
- rtems_id extension_id;
+ rtems_id extension_ids[ 2 ];
void *seized_objects;
@@ -333,6 +334,15 @@ static bool ThreadCreate( rtems_tcb *executing, rtems_tcb *created )
return RtemsTaskReqConstructErrors_Instance.create_extension_status;
}
+static bool SecondThreadCreate( rtems_tcb *executing, rtems_tcb *created )
+{
+ (void) executing;
+ (void) created;
+
+ ++RtemsTaskReqConstructErrors_Instance.create_extension_calls;
+ return true;
+}
+
static void ThreadDelete( rtems_tcb *executing, rtems_tcb *deleted )
{
(void) executing;
@@ -341,9 +351,14 @@ static void ThreadDelete( rtems_tcb *executing, rtems_tcb *deleted )
++RtemsTaskReqConstructErrors_Instance.delete_extension_calls;
}
-static const rtems_extensions_table extensions = {
- .thread_create = ThreadCreate,
- .thread_delete = ThreadDelete
+static const rtems_extensions_table extensions[] = {
+ {
+ .thread_create = ThreadCreate,
+ .thread_delete = ThreadDelete
+ }, {
+ .thread_create = SecondThreadCreate,
+ .thread_delete = ThreadDelete
+ }
};
static void RtemsTaskReqConstructErrors_Pre_Config_Prepare(
@@ -750,11 +765,20 @@ static void RtemsTaskReqConstructErrors_Post_CreateExt_Check(
)
{
switch ( state ) {
- case RtemsTaskReqConstructErrors_Post_CreateExt_Yes: {
+ case RtemsTaskReqConstructErrors_Post_CreateExt_All: {
/*
* The create user extensions shall be invoked during the
* rtems_task_construct() call.
*/
+ T_eq_u32( ctx->create_extension_calls, 2 );
+ break;
+ }
+
+ case RtemsTaskReqConstructErrors_Post_CreateExt_UpToFailing: {
+ /*
+ * The create user extensions up to the failing extension shall be
+ * invoked during the rtems_task_construct() call.
+ */
T_eq_u32( ctx->create_extension_calls, 1 );
break;
}
@@ -784,7 +808,7 @@ static void RtemsTaskReqConstructErrors_Post_DelExt_Check(
* The delete user extensions shall be invoked during the
* rtems_task_construct() call.
*/
- T_eq_u32( ctx->delete_extension_calls, 1 );
+ T_eq_u32( ctx->delete_extension_calls, 2 );
break;
}
@@ -843,9 +867,16 @@ static void RtemsTaskReqConstructErrors_Setup(
tls_variable = var;
sc = rtems_extension_create(
- rtems_build_name( 'T', 'E', 'X', 'T' ),
- &extensions,
- &ctx->extension_id
+ rtems_build_name( 'E', 'X', 'T', '1' ),
+ &extensions[ 0 ],
+ &ctx->extension_ids[ 0 ]
+ );
+ T_rsc_success( sc );
+
+ sc = rtems_extension_create(
+ rtems_build_name( 'E', 'X', 'T', '2' ),
+ &extensions[ 1 ],
+ &ctx->extension_ids[ 1 ]
);
T_rsc_success( sc );
}
@@ -865,7 +896,10 @@ static void RtemsTaskReqConstructErrors_Teardown(
{
rtems_status_code sc;
- sc = rtems_extension_delete( ctx->extension_id );
+ sc = rtems_extension_delete( ctx->extension_ids[ 0 ] );
+ T_rsc_success( sc );
+
+ sc = rtems_extension_delete( ctx->extension_ids[ 1 ] );
T_rsc_success( sc );
}
@@ -981,14 +1015,14 @@ RtemsTaskReqConstructErrors_Entries[] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsTaskReqConstructErrors_Post_Status_Ok,
RtemsTaskReqConstructErrors_Post_Name_Valid,
RtemsTaskReqConstructErrors_Post_IdVar_Set,
- RtemsTaskReqConstructErrors_Post_CreateExt_Yes,
+ RtemsTaskReqConstructErrors_Post_CreateExt_All,
RtemsTaskReqConstructErrors_Post_DelExt_No,
RtemsTaskReqConstructErrors_Post_StoFree_No },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
RtemsTaskReqConstructErrors_Post_Status_Unsat,
RtemsTaskReqConstructErrors_Post_Name_Invalid,
RtemsTaskReqConstructErrors_Post_IdVar_Nop,
- RtemsTaskReqConstructErrors_Post_CreateExt_Yes,
+ RtemsTaskReqConstructErrors_Post_CreateExt_UpToFailing,
RtemsTaskReqConstructErrors_Post_DelExt_Yes,
RtemsTaskReqConstructErrors_Post_StoFree_Yes }
};