From 28fabc299fa0a1c95ea5124473d6446a812aa9e2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 8 May 2023 22:03:44 +0200 Subject: validation: rtems_scheduler_get_maximum_priority() Validate this directive for the EDF SMP scheduler. Update #3716. --- testsuites/validation/tc-scheduler-smp-only.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'testsuites') diff --git a/testsuites/validation/tc-scheduler-smp-only.c b/testsuites/validation/tc-scheduler-smp-only.c index b4ff000000..c975ba2a66 100644 --- a/testsuites/validation/tc-scheduler-smp-only.c +++ b/testsuites/validation/tc-scheduler-smp-only.c @@ -52,6 +52,7 @@ #include "config.h" #endif +#include #include #include "ts-config.h" @@ -93,6 +94,9 @@ * * - Check that processor 1 has scheduler B assigned. * + * - Check that scheduler B has the maximum priority of the EDF SMP + * scheduler. + * * - Check that processor 2 has scheduler C assigned if it is present. * * - Check that processor 3 has scheduler C assigned if it is present. @@ -165,9 +169,10 @@ static void RtemsSchedulerValSmpOnly_Action_1( void ) */ static void RtemsSchedulerValSmpOnly_Action_2( void ) { - rtems_status_code sc; - rtems_id id[ 4 ]; - rtems_id id_by_cpu; + rtems_status_code sc; + rtems_id id[ 4 ]; + rtems_id id_by_cpu; + rtems_task_priority priority; sc = rtems_scheduler_ident( TEST_SCHEDULER_A_NAME, &id[ 0 ]); T_step_rsc_success( 3, sc ); @@ -215,17 +220,24 @@ static void RtemsSchedulerValSmpOnly_Action_2( void ) T_step_rsc_success( 13, sc ); T_step_eq_u32( 14, id[ 1 ], id_by_cpu ); + /* + * Check that scheduler B has the maximum priority of the EDF SMP scheduler. + */ + sc = rtems_scheduler_get_maximum_priority( id_by_cpu, &priority ); + T_step_rsc_success( 15, sc ); + T_step_eq_u32( 16, priority, (uint32_t) INT_MAX ); + /* * Check that processor 2 has scheduler C assigned if it is present. */ sc = rtems_scheduler_ident_by_processor( 2, &id_by_cpu ); - T_step_true( 15, sc == RTEMS_INVALID_NAME || id[ 2 ] == id_by_cpu ); + T_step_true( 17, sc == RTEMS_INVALID_NAME || id[ 2 ] == id_by_cpu ); /* * Check that processor 3 has scheduler C assigned if it is present. */ sc = rtems_scheduler_ident_by_processor( 3, &id_by_cpu ); - T_step_true( 16, sc == RTEMS_INVALID_NAME || id[ 2 ] == id_by_cpu ); + T_step_true( 18, sc == RTEMS_INVALID_NAME || id[ 2 ] == id_by_cpu ); } /** @@ -233,7 +245,7 @@ static void RtemsSchedulerValSmpOnly_Action_2( void ) */ T_TEST_CASE( RtemsSchedulerValSmpOnly ) { - T_plan( 17 ); + T_plan( 19 ); RtemsSchedulerValSmpOnly_Action_0(); RtemsSchedulerValSmpOnly_Action_1(); -- cgit v1.2.3