tests: stack: Add description for test cases
Add description for test cases and some uncrustify changes Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
This commit is contained in:
parent
6c30f5955e
commit
cb499d3232
4 changed files with 19 additions and 11 deletions
|
@ -14,9 +14,9 @@ extern void test_stack_user_pop_fail(void);
|
|||
|
||||
K_MEM_POOL_DEFINE(test_pool, 128, 128, 2, 4);
|
||||
#else
|
||||
#define dummy_test(_name) \
|
||||
static void _name(void) \
|
||||
{ \
|
||||
#define dummy_test(_name) \
|
||||
static void _name(void) \
|
||||
{ \
|
||||
ztest_test_skip(); \
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ static void tstack_thread_isr(struct k_stack *pstack)
|
|||
*/
|
||||
|
||||
/**
|
||||
* @brief Test to verify data passing between threads via stack
|
||||
* @see k_stack_init(), k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
void test_stack_thread2thread(void)
|
||||
|
@ -106,6 +107,7 @@ void test_stack_thread2thread(void)
|
|||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
/**
|
||||
* @brief Verifies data passing between user threads via stack
|
||||
* @see k_stack_init(), k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
void test_stack_user_thread2thread(void)
|
||||
|
@ -121,6 +123,7 @@ void test_stack_user_thread2thread(void)
|
|||
#endif
|
||||
|
||||
/**
|
||||
* @brief Verifies data passing between thread and ISR via stack
|
||||
* @see k_stack_init(), k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
void test_stack_thread2isr(void)
|
||||
|
|
|
@ -29,6 +29,7 @@ static void stack_pop_fail(struct k_stack *stack)
|
|||
*/
|
||||
|
||||
/**
|
||||
* @brief Verifies stack pop functionality
|
||||
* @see k_stack_init(), k_stack_pop()
|
||||
*/
|
||||
void test_stack_pop_fail(void)
|
||||
|
@ -40,6 +41,7 @@ void test_stack_pop_fail(void)
|
|||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
/**
|
||||
* @brief Verifies stack pop from a user thread
|
||||
* @see k_stack_init(), k_stack_pop()
|
||||
*/
|
||||
void test_stack_user_pop_fail(void)
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
#include <ztest.h>
|
||||
#include <irq_offload.h>
|
||||
|
||||
#define TSTACK_SIZE 512
|
||||
#define STACK_LEN 4
|
||||
#define TSTACK_SIZE 512
|
||||
#define STACK_LEN 4
|
||||
|
||||
/* stack objects used in this test */
|
||||
K_STACK_DEFINE(stack1, STACK_LEN);
|
||||
|
@ -89,7 +89,7 @@ static void thread_entry_fn_single(void *p1, void *p2, void *p3)
|
|||
k_stack_pop((struct k_stack *)p1, &tmp[i - 1], K_NO_WAIT);
|
||||
}
|
||||
zassert_false(memcmp(tmp, data1, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
|
||||
/* Push items from stack */
|
||||
for (i = 0; i < STACK_LEN; i++) {
|
||||
|
@ -114,7 +114,7 @@ static void thread_entry_fn_dual(void *p1, void *p2, void *p3)
|
|||
|
||||
}
|
||||
zassert_false(memcmp(tmp, data2, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
}
|
||||
|
||||
static void thread_entry_fn_isr(void *p1, void *p2, void *p3)
|
||||
|
@ -122,7 +122,7 @@ static void thread_entry_fn_isr(void *p1, void *p2, void *p3)
|
|||
/* Pop items from stack2 */
|
||||
irq_offload(tIsr_entry_pop, p2);
|
||||
zassert_false(memcmp(data_isr, data2, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
|
||||
/* Push items to stack1 */
|
||||
irq_offload(tIsr_entry_push, p1);
|
||||
|
@ -137,6 +137,7 @@ static void thread_entry_fn_isr(void *p1, void *p2, void *p3)
|
|||
*/
|
||||
|
||||
/**
|
||||
* @brief Verify data passing between threads using single stack
|
||||
* @see k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
static void test_single_stack_play(void)
|
||||
|
@ -166,13 +167,14 @@ static void test_single_stack_play(void)
|
|||
}
|
||||
|
||||
zassert_false(memcmp(tmp, data2, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
|
||||
/* Clear the spawn thread to avoid side effect */
|
||||
k_thread_abort(tid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Verify data passing between threads using dual stack
|
||||
* @see k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
static void test_dual_stack_play(void)
|
||||
|
@ -194,13 +196,14 @@ static void test_dual_stack_play(void)
|
|||
}
|
||||
|
||||
zassert_false(memcmp(tmp, data1, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
|
||||
/* Clear the spawn thread to avoid side effect */
|
||||
k_thread_abort(tid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Verify data passing between thread and ISR
|
||||
* @see k_stack_push(), #K_STACK_DEFINE(x), k_stack_pop()
|
||||
*/
|
||||
static void test_isr_stack_play(void)
|
||||
|
@ -224,7 +227,7 @@ static void test_isr_stack_play(void)
|
|||
irq_offload(tIsr_entry_pop, &stack1);
|
||||
|
||||
zassert_false(memcmp(data_isr, data1, STACK_LEN),
|
||||
"Push & Pop items does not match");
|
||||
"Push & Pop items does not match");
|
||||
|
||||
/* Clear the spawn thread to avoid side effect */
|
||||
k_thread_abort(tid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue