Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
test_queue.h File Reference
#include <ztest.h>
#include <irq_offload.h>
#include <ztest_error_hook.h>

Go to the source code of this file.

Data Structures

struct  qdata
 

Typedefs

typedef struct qdata qdata_t
 

Functions

void test_queue_thread2thread (void)
 Verify data passing between threads using queue. More...
 
void test_queue_thread2isr (void)
 Verify data passing between thread and ISR. More...
 
void test_queue_isr2thread (void)
 Verify data passing between ISR and thread. More...
 
void test_queue_get_2threads (void)
 Verify k_queue_get() More...
 
void test_queue_get_fail (void)
 Test k_queue_get() failure scenario. More...
 
void test_queue_loop (void)
 Test queue operations in loop. More...
 
void test_queue_supv_to_user (void)
 Verify queue elements and cancel wait from a user thread. More...
 
void test_auto_free (void)
 Test to verify free of allocated elements of queue. More...
 
void test_queue_alloc_prepend_user (void)
 verify allocate and feature "Last In, First Out" More...
 
void test_queue_alloc_append_user (void)
 verify feature of queue "First In, First Out" More...
 
void test_queue_init_null (void)
 Test k_queue_init() failure scenario. More...
 
void test_queue_alloc_append_null (void)
 Test k_queue_alloc_append() failure scenario. More...
 
void test_queue_alloc_prepend_null (void)
 Test k_queue_alloc_prepend() failure scenario. More...
 
void test_queue_get_null (void)
 Test k_queue_get() failure scenario. More...
 
void test_queue_is_empty_null (void)
 Test k_queue_is_empty() failure scenario. More...
 
void test_queue_peek_head_null (void)
 Test k_queue_peek_head() failure scenario. More...
 
void test_queue_peek_tail_null (void)
 Test k_queue_peek_tail() failure scenario. More...
 
void test_queue_cancel_wait_error (void)
 Test k_queue_merge_slist() failure scenario. More...
 
void test_queue_alloc (void)
 Test queue alloc append and prepend. More...
 
void test_queue_poll_race (void)
 
void test_multiple_queues (void)
 
void test_queue_multithread_competition (void)
 Test multi-threads to get data from a queue. More...
 
void test_access_kernel_obj_with_priv_data (void)
 Test access kernel object with private data using system call. More...
 
void test_queue_append_list_error (void)
 Test k_queue_append_list() failure scenario. More...
 
void test_queue_merge_list_error (void)
 Test k_queue_merge_slist() failure scenario. More...
 

Variables

struct k_heap test_pool
 

Typedef Documentation

◆ qdata_t

typedef struct qdata qdata_t

Function Documentation

◆ test_access_kernel_obj_with_priv_data()

void test_access_kernel_obj_with_priv_data ( void  )

Test access kernel object with private data using system call.

  • When defining system calls, it is very important to ensure that access to the API’s private data is done exclusively through system call interfaces. Private kernel data should never be made available to user mode threads directly. For example, the k_queue APIs were intentionally not made available as they store bookkeeping information about the queue directly in the queue buffers which are visible from user mode.
  • Current test makes user thread try to access private kernel data within their associated data structures. Kernel will track that system call access to these object with the kernel object permission system. Current user thread doesn't have permission on it, trying to access &pqueue kernel object will happen kernel oops, because current user thread doesn't have permission on k_queue object with private kernel data.

◆ test_multiple_queues()

void test_multiple_queues ( void  )

◆ test_queue_poll_race()

void test_queue_poll_race ( void  )

Variable Documentation

◆ test_pool

struct k_heap test_pool
extern