aboutsummaryrefslogtreecommitdiff
path: root/test/validation/api/scheduler
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2021-05-31 17:25:53 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2021-06-04 10:39:27 +0300
commit968f2d473835b319f37b68503460b27abe1ba9e0 (patch)
treec661b4db9e2e5a8baadc4808d975f8acffe85f56 /test/validation/api/scheduler
parent4a41244773af007718c4cff574eebf968cf96388 (diff)
validation: sched: test predefined group info
Added new test case to check that group info and thread mask can be requested also on predefined schedule groups. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test/validation/api/scheduler')
-rw-r--r--test/validation/api/scheduler/scheduler.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c
index 37f3b4f0b..53141e16c 100644
--- a/test/validation/api/scheduler/scheduler.c
+++ b/test/validation/api/scheduler/scheduler.c
@@ -860,6 +860,44 @@ static void scheduler_test_order_ignore(void)
CU_ASSERT_FATAL(odp_pool_destroy(pool) == 0);
}
+static void scheduler_test_group_info_predef(void)
+{
+ odp_schedule_group_info_t info;
+ odp_thrmask_t thrmask;
+ odp_schedule_group_t group;
+ int thr;
+
+ thr = odp_thread_id();
+
+ group = ODP_SCHED_GROUP_ALL;
+ odp_thrmask_zero(&thrmask);
+ CU_ASSERT(odp_schedule_group_thrmask(group, &thrmask) == 0);
+ CU_ASSERT(odp_thrmask_isset(&thrmask, thr));
+ memset(&info, 0, sizeof(odp_schedule_group_info_t));
+ CU_ASSERT(odp_schedule_group_info(group, &info) == 0);
+ CU_ASSERT(odp_thrmask_equal(&info.thrmask, &thrmask));
+ printf("\n Schedule group all name: %s\n", info.name);
+
+ /* This test case runs a control thread */
+ group = ODP_SCHED_GROUP_CONTROL;
+ odp_thrmask_zero(&thrmask);
+ CU_ASSERT(odp_schedule_group_thrmask(group, &thrmask) == 0);
+ CU_ASSERT(odp_thrmask_isset(&thrmask, thr));
+ memset(&info, 0, sizeof(odp_schedule_group_info_t));
+ CU_ASSERT(odp_schedule_group_info(group, &info) == 0);
+ CU_ASSERT(odp_thrmask_equal(&info.thrmask, &thrmask));
+ printf(" Schedule group control name: %s\n", info.name);
+
+ group = ODP_SCHED_GROUP_WORKER;
+ odp_thrmask_zero(&thrmask);
+ CU_ASSERT(odp_schedule_group_thrmask(group, &thrmask) == 0);
+ CU_ASSERT(!odp_thrmask_isset(&thrmask, thr));
+ memset(&info, 0, sizeof(odp_schedule_group_info_t));
+ CU_ASSERT(odp_schedule_group_info(group, &info) == 0);
+ CU_ASSERT(odp_thrmask_equal(&info.thrmask, &thrmask));
+ printf(" Schedule group worker name: %s\n", info.name);
+}
+
static void scheduler_test_create_group(void)
{
odp_thrmask_t mask;
@@ -3158,6 +3196,7 @@ odp_testinfo_t scheduler_basic_suite[] = {
ODP_TEST_INFO(scheduler_test_max_queues_a),
ODP_TEST_INFO(scheduler_test_max_queues_o),
ODP_TEST_INFO(scheduler_test_order_ignore),
+ ODP_TEST_INFO(scheduler_test_group_info_predef),
ODP_TEST_INFO(scheduler_test_create_group),
ODP_TEST_INFO(scheduler_test_create_max_groups),
ODP_TEST_INFO(scheduler_test_groups),