tests: thread_api: test k_thread_cpu_pin
add a few asserts to test the new API. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
e2a3e72a02
commit
26b28b9527
1 changed files with 6 additions and 0 deletions
|
@ -41,6 +41,9 @@ void test_threads_cpu_mask(void)
|
||||||
ret = k_thread_cpu_mask_disable(k_current_get(), 0);
|
ret = k_thread_cpu_mask_disable(k_current_get(), 0);
|
||||||
zassert_true(ret == -EINVAL, "");
|
zassert_true(ret == -EINVAL, "");
|
||||||
|
|
||||||
|
ret = k_thread_cpu_pin(k_current_get(), 0);
|
||||||
|
zassert_true(ret == -EINVAL, "");
|
||||||
|
|
||||||
for (pass = 0; pass < 4; pass++) {
|
for (pass = 0; pass < 4; pass++) {
|
||||||
if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY) && pass == 1) {
|
if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY) && pass == 1) {
|
||||||
/* Pass 1 enables more than one CPU in the
|
/* Pass 1 enables more than one CPU in the
|
||||||
|
@ -75,6 +78,9 @@ void test_threads_cpu_mask(void)
|
||||||
} else {
|
} else {
|
||||||
ret = k_thread_cpu_mask_enable(thread, 0);
|
ret = k_thread_cpu_mask_enable(thread, 0);
|
||||||
zassert_true(ret == 0, "");
|
zassert_true(ret == 0, "");
|
||||||
|
|
||||||
|
ret = k_thread_cpu_pin(thread, 0);
|
||||||
|
zassert_true(ret == 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start it. If it is runnable, it will do so
|
/* Start it. If it is runnable, it will do so
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue