tests: kernel: added tests for k_mem_pool_alloc from isr
Added tests to invoke k_mem_pool_alloc() from isr context Jira: ZEP-1631 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This commit is contained in:
parent
ab6d4c1a42
commit
189aa475e1
2 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
extern void test_mpool_alloc_free_thread(void);
|
extern void test_mpool_alloc_free_thread(void);
|
||||||
|
extern void test_mpool_alloc_free_isr(void);
|
||||||
extern void test_mpool_kdefine_extern(void);
|
extern void test_mpool_kdefine_extern(void);
|
||||||
extern void test_mpool_alloc_size(void);
|
extern void test_mpool_alloc_size(void);
|
||||||
extern void test_mpool_alloc_timeout(void);
|
extern void test_mpool_alloc_timeout(void);
|
||||||
|
@ -17,6 +18,7 @@ void test_main(void *p1, void *p2, void *p3)
|
||||||
{
|
{
|
||||||
ztest_test_suite(test_mpool_api,
|
ztest_test_suite(test_mpool_api,
|
||||||
ztest_unit_test(test_mpool_alloc_free_thread),
|
ztest_unit_test(test_mpool_alloc_free_thread),
|
||||||
|
ztest_unit_test(test_mpool_alloc_free_isr),
|
||||||
ztest_unit_test(test_mpool_kdefine_extern),
|
ztest_unit_test(test_mpool_kdefine_extern),
|
||||||
ztest_unit_test(test_mpool_alloc_size),
|
ztest_unit_test(test_mpool_alloc_size),
|
||||||
ztest_unit_test(test_mpool_alloc_timeout),
|
ztest_unit_test(test_mpool_alloc_timeout),
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
#include <irq_offload.h>
|
||||||
#include "test_mpool.h"
|
#include "test_mpool.h"
|
||||||
|
|
||||||
/** TESTPOINT: Statically define and initialize a memory pool*/
|
/** TESTPOINT: Statically define and initialize a memory pool*/
|
||||||
|
@ -75,6 +76,11 @@ void test_mpool_alloc_free_thread(void)
|
||||||
tmpool_alloc_free(NULL);
|
tmpool_alloc_free(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_mpool_alloc_free_isr(void)
|
||||||
|
{
|
||||||
|
irq_offload(tmpool_alloc_free, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void test_mpool_alloc_size(void)
|
void test_mpool_alloc_size(void)
|
||||||
{
|
{
|
||||||
struct k_mem_block block[BLK_NUM_MIN];
|
struct k_mem_block block[BLK_NUM_MIN];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue