[utest] fix a bug

This commit is contained in:
Meco Man 2022-06-30 21:17:04 -04:00 committed by guo
parent ff4b6a6671
commit f27110decd
2 changed files with 4 additions and 4 deletions

View File

@ -22,19 +22,19 @@
static void memheap_test(void)
{
struct rt_memheap heap1;
rt_ubase_t ptr_start;
void * ptr_start;
void *ptr[SLICE_NUM];
int i, cnt = 0;
/* init heap */
ptr_start = (rt_ubase_t)rt_malloc_align(HEAP_SIZE, HEAP_ALIGN);
ptr_start = rt_malloc_align(HEAP_SIZE, HEAP_ALIGN);
if (ptr_start == RT_NULL)
{
rt_kprintf("totle size too big,can not malloc memory!");
return;
}
rt_memheap_init(&heap1, HEAP_NAME, (void *)ptr_start, HEAP_SIZE);
rt_memheap_init(&heap1, HEAP_NAME, ptr_start, HEAP_SIZE);
/* test start */
for (i = 0; i < SLICE_NUM; i++)

View File

@ -336,7 +336,7 @@ static void test_dynamic_mutex_create(void)
/* PRIO mode */
dynamic_mutex = rt_mutex_create("dynamic_mutex", RT_IPC_FLAG_PRIO);
if (RT_NULL == result)
if (RT_NULL == dynamic_mutex)
{
uassert_true(RT_FALSE);
}