Skip to content

Commit 27c25e9

Browse files
cfriedtjgl-meta
authored andcommitted
tests: posix: test support for SCHED_OTHER
Ensure we test `SCHED_OTHER` functionality along with other scheduling policies and priorities. Signed-off-by: Chris Friedt <[email protected]>
1 parent b9828a7 commit 27c25e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/posix/common/src/pthread.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,26 +618,31 @@ ZTEST(posix_apis, test_sched_policy)
618618
static const int policies[] = {
619619
SCHED_FIFO,
620620
SCHED_RR,
621+
SCHED_OTHER,
621622
SCHED_INVALID,
622623
};
623624
static const char *const policy_names[] = {
624625
"SCHED_FIFO",
625626
"SCHED_RR",
627+
"SCHED_OTHER",
626628
"SCHED_INVALID",
627629
};
628630
static const bool policy_enabled[] = {
629631
IS_ENABLED(CONFIG_COOP_ENABLED),
630632
IS_ENABLED(CONFIG_PREEMPT_ENABLED),
633+
IS_ENABLED(CONFIG_PREEMPT_ENABLED),
631634
false,
632635
};
633636
static int nprio[] = {
634637
CONFIG_NUM_COOP_PRIORITIES,
635638
CONFIG_NUM_PREEMPT_PRIORITIES,
639+
CONFIG_NUM_PREEMPT_PRIORITIES,
636640
42,
637641
};
638642
const char *const prios[] = {"pmin", "pmax"};
639643

640-
BUILD_ASSERT(!(SCHED_INVALID == SCHED_FIFO || SCHED_INVALID == SCHED_RR),
644+
BUILD_ASSERT(!(SCHED_INVALID == SCHED_FIFO || SCHED_INVALID == SCHED_RR ||
645+
SCHED_INVALID == SCHED_OTHER),
641646
"SCHED_INVALID is itself invalid");
642647

643648
for (int policy = 0; policy < ARRAY_SIZE(policies); ++policy) {

0 commit comments

Comments
 (0)