tests/kernel/poll: test object runtime init functions

Change-Id: I04eac2e5cf5e49ea92fd6195c94a25e783aab253
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
Benjamin Walsh 2017-02-02 16:47:52 -05:00 committed by Anas Nashif
commit e440759dbb

View file

@ -29,14 +29,18 @@ struct fifo_msg {
#define FIFO_MSG_VALUE 0xdeadbeef
/* verify k_poll() without waiting */
static struct k_sem no_wait_sem = K_SEM_INITIALIZER(no_wait_sem, 1, 1);
static struct k_fifo no_wait_fifo = K_FIFO_INITIALIZER(no_wait_fifo);
static struct k_poll_signal no_wait_signal = K_POLL_SIGNAL_INITIALIZER();
static struct k_sem no_wait_sem;
static struct k_fifo no_wait_fifo;
static struct k_poll_signal no_wait_signal;
void test_poll_no_wait(void)
{
struct fifo_msg msg = { NULL, FIFO_MSG_VALUE }, *msg_ptr;
k_sem_init(&no_wait_sem, 1, 1);
k_fifo_init(&no_wait_fifo);
k_poll_signal_init(&no_wait_signal);
struct k_poll_event events[] = {
K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SEM_AVAILABLE,
K_POLL_MODE_NOTIFY_ONLY,