zephyr/tests/kernel/poll/src/main.c
Paul Sokolovsky 14742d79fe tests: k_poll: Add testcase to poll fifo which gets k_fifo_cancel_wait
In this case k_poll() returns -EINTR, while still fills in event
states.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-30 09:28:29 -04:00

34 lines
927 B
C

/*
* Copyright (c) 2017 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
extern void test_poll_no_wait(void);
extern void test_poll_wait(void);
extern void test_poll_cancel_main_low_prio(void);
extern void test_poll_cancel_main_high_prio(void);
extern void test_poll_multi(void);
extern void test_poll_threadstate(void);
extern void test_poll_grant_access(void);
K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4);
/*test case main entry*/
void test_main(void)
{
test_poll_grant_access();
k_thread_resource_pool_assign(k_current_get(), &test_pool);
ztest_test_suite(poll_api,
ztest_user_unit_test(test_poll_no_wait),
ztest_unit_test(test_poll_wait),
ztest_unit_test(test_poll_cancel_main_low_prio),
ztest_unit_test(test_poll_cancel_main_high_prio),
ztest_unit_test(test_poll_multi),
ztest_unit_test(test_poll_threadstate));
ztest_run_test_suite(poll_api);
}