Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
test_mslab_api.c File Reference
#include <zephyr/ztest.h>
#include "test_mslab.h"

Functions

 K_MEM_SLAB_DEFINE (kmslab, 16, 3, 8)
 
 K_SEM_DEFINE (SEM_HELPERDONE, 0, 1)
 
 K_SEM_DEFINE (SEM_REGRESSDONE, 0, 1)
 
static K_THREAD_STACK_DEFINE (stack,(1024+CONFIG_TEST_EXTRA_STACK_SIZE))
 
void * mslab_setup (void)
 
void tmslab_alloc_free (void *data)
 
static void tmslab_alloc_align (void *data)
 
static void tmslab_alloc_timeout (void *data)
 
static void tmslab_used_get (void *data)
 
static void helper_thread (void *p0, void *p1, void *p2)
 
 ZTEST (mslab_api, test_mslab_kinit)
 Initialize the memory slab using k_mem_slab_init() and allocates/frees blocks.
 
 ZTEST (mslab_api, test_mslab_kdefine)
 Verify K_MEM_SLAB_DEFINE() with allocates/frees blocks.
 
 ZTEST (mslab_api, test_mslab_alloc_free_thread)
 Verify alloc and free of blocks from mem_slab.
 
 ZTEST (mslab_api, test_mslab_alloc_align)
 Allocate memory blocks and check for alignment of 8 bytes.
 
 ZTEST (mslab_api, test_mslab_alloc_timeout)
 Verify allocation of memory blocks with timeouts.
 
 ZTEST (mslab_api, test_mslab_used_get)
 Verify count of allocated blocks.
 
 ZTEST (mslab_api, test_mslab_pending)
 Verify pending of allocating blocks.
 

Variables

static char tslab [16 *3]
 
static struct k_mem_slab mslab
 
static struct k_thread HELPER
 

Function Documentation

◆ helper_thread()

static void helper_thread ( void *  p0,
void *  p1,
void *  p2 
)
static

◆ K_MEM_SLAB_DEFINE()

K_MEM_SLAB_DEFINE ( kmslab  ,
16  ,
,
 
)

◆ K_SEM_DEFINE() [1/2]

K_SEM_DEFINE ( SEM_HELPERDONE  ,
,
 
)

◆ K_SEM_DEFINE() [2/2]

K_SEM_DEFINE ( SEM_REGRESSDONE  ,
,
 
)

◆ K_THREAD_STACK_DEFINE()

static K_THREAD_STACK_DEFINE ( stack  ,
(1024+CONFIG_TEST_EXTRA_STACK_SIZE)   
)
static

◆ mslab_setup()

void * mslab_setup ( void  )

◆ tmslab_alloc_align()

static void tmslab_alloc_align ( void *  data)
static

◆ tmslab_alloc_free()

void tmslab_alloc_free ( void *  data)

◆ tmslab_alloc_timeout()

static void tmslab_alloc_timeout ( void *  data)
static

◆ tmslab_used_get()

static void tmslab_used_get ( void *  data)
static

Variable Documentation

◆ HELPER

struct k_thread HELPER
static

◆ mslab

struct k_mem_slab mslab
static

◆ tslab

char tslab[16 * 3]
static