/* Verify data passing between threads using dual stack.  */
ZTEST_USER(stack_usage_1cpu, test_dual_stack_play)
/* Verify data passing between threads using dual stack.  */
ZTEST_USER(stack_usage_1cpu, test_dual_stack_play)
{
	stack_data_t tmp[STACK_LEN];
	uint32_t i;
	k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
				      thread_entry_fn_dual, &stack1, &stack2,
				      NULL, K_PRIO_PREEMPT(0), K_USER |
				      K_INHERIT_PERMS, K_NO_WAIT);
	for (i = 0U; i < STACK_LEN; i++) {
		k_stack_push(&stack2, data2[i]);
		k_stack_pop(&stack1, &tmp[i], K_FOREVER);
	}
	zassert_false(memcmp(tmp, data1, sizeof(tmp)),
		      "Push & Pop items does not match");
	k_thread_abort(tid);
}