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:
Sharron LIU 2017-05-19 14:30:59 +08:00 committed by Anas Nashif
commit 189aa475e1
2 changed files with 8 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include <ztest.h>
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_alloc_size(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_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_alloc_size),
ztest_unit_test(test_mpool_alloc_timeout),

View file

@ -19,6 +19,7 @@
*/
#include <ztest.h>
#include <irq_offload.h>
#include "test_mpool.h"
/** TESTPOINT: Statically define and initialize a memory pool*/
@ -75,6 +76,11 @@ void test_mpool_alloc_free_thread(void)
tmpool_alloc_free(NULL);
}
void test_mpool_alloc_free_isr(void)
{
irq_offload(tmpool_alloc_free, NULL);
}
void test_mpool_alloc_size(void)
{
struct k_mem_block block[BLK_NUM_MIN];