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:
Anas Nashif 2022-04-19 11:21:29 -04:00
commit 26b28b9527

View file

@ -41,6 +41,9 @@ void test_threads_cpu_mask(void)
ret = k_thread_cpu_mask_disable(k_current_get(), 0);
zassert_true(ret == -EINVAL, "");
ret = k_thread_cpu_pin(k_current_get(), 0);
zassert_true(ret == -EINVAL, "");
for (pass = 0; pass < 4; pass++) {
if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY) && pass == 1) {
/* Pass 1 enables more than one CPU in the
@ -75,6 +78,9 @@ void test_threads_cpu_mask(void)
} else {
ret = k_thread_cpu_mask_enable(thread, 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