zephyr/tests/kernel/fifo/fifo_api/src/test_fifo_fail.c
Andy Ross fed9f5aa04 tests/fifo_api: Move k_fifo off stack
Putting spinlocks (or things containing them) onto the stack is a
KERNEL_COHERENCE violation.  This doesn't need to be there so just
make it static.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 11:14:27 -05:00

34 lines
613 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "test_fifo.h"
#define TIMEOUT K_MSEC(100)
/**
* @addtogroup kernel_fifo_tests
* @{
*/
/**
* @brief Test FIFO get fail
* @details test zephyr fifo_get when no data to read,
* it should returns NULL.
* @see k_fifo_init(), k_fifo_get()
*/
void test_fifo_get_fail(void *p1, void *p2, void *p3)
{
static struct k_fifo fifo;
k_fifo_init(&fifo);
/**TESTPOINT: fifo get returns NULL*/
zassert_is_null(k_fifo_get(&fifo, K_NO_WAIT), NULL);
zassert_is_null(k_fifo_get(&fifo, TIMEOUT), NULL);
}
/**
* @}
*/