Skip to content

Commit

Permalink
tests: posix: test support for SCHED_OTHER
Browse files Browse the repository at this point in the history
Ensure we test `SCHED_OTHER` functionality along with other
scheduling policies and priorities.

Signed-off-by: Chris Friedt <[email protected]>
  • Loading branch information
cfriedt authored and jgl-meta committed Apr 29, 2023
1 parent b9828a7 commit 27c25e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/posix/common/src/pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,26 +618,31 @@ ZTEST(posix_apis, test_sched_policy)
static const int policies[] = {
SCHED_FIFO,
SCHED_RR,
SCHED_OTHER,
SCHED_INVALID,
};
static const char *const policy_names[] = {
"SCHED_FIFO",
"SCHED_RR",
"SCHED_OTHER",
"SCHED_INVALID",
};
static const bool policy_enabled[] = {
IS_ENABLED(CONFIG_COOP_ENABLED),
IS_ENABLED(CONFIG_PREEMPT_ENABLED),
IS_ENABLED(CONFIG_PREEMPT_ENABLED),
false,
};
static int nprio[] = {
CONFIG_NUM_COOP_PRIORITIES,
CONFIG_NUM_PREEMPT_PRIORITIES,
CONFIG_NUM_PREEMPT_PRIORITIES,
42,
};
const char *const prios[] = {"pmin", "pmax"};

BUILD_ASSERT(!(SCHED_INVALID == SCHED_FIFO || SCHED_INVALID == SCHED_RR),
BUILD_ASSERT(!(SCHED_INVALID == SCHED_FIFO || SCHED_INVALID == SCHED_RR ||
SCHED_INVALID == SCHED_OTHER),
"SCHED_INVALID is itself invalid");

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

0 comments on commit 27c25e9

Please sign in to comment.