mirror of https://github.com/RT-Thread/rt-thread
[utest] fix a bug
This commit is contained in:
parent
ff4b6a6671
commit
f27110decd
|
@ -22,19 +22,19 @@
|
||||||
static void memheap_test(void)
|
static void memheap_test(void)
|
||||||
{
|
{
|
||||||
struct rt_memheap heap1;
|
struct rt_memheap heap1;
|
||||||
rt_ubase_t ptr_start;
|
void * ptr_start;
|
||||||
void *ptr[SLICE_NUM];
|
void *ptr[SLICE_NUM];
|
||||||
int i, cnt = 0;
|
int i, cnt = 0;
|
||||||
|
|
||||||
/* init heap */
|
/* 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)
|
if (ptr_start == RT_NULL)
|
||||||
{
|
{
|
||||||
rt_kprintf("totle size too big,can not malloc memory!");
|
rt_kprintf("totle size too big,can not malloc memory!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_memheap_init(&heap1, HEAP_NAME, (void *)ptr_start, HEAP_SIZE);
|
rt_memheap_init(&heap1, HEAP_NAME, ptr_start, HEAP_SIZE);
|
||||||
|
|
||||||
/* test start */
|
/* test start */
|
||||||
for (i = 0; i < SLICE_NUM; i++)
|
for (i = 0; i < SLICE_NUM; i++)
|
||||||
|
|
|
@ -336,7 +336,7 @@ static void test_dynamic_mutex_create(void)
|
||||||
|
|
||||||
/* PRIO mode */
|
/* PRIO mode */
|
||||||
dynamic_mutex = rt_mutex_create("dynamic_mutex", RT_IPC_FLAG_PRIO);
|
dynamic_mutex = rt_mutex_create("dynamic_mutex", RT_IPC_FLAG_PRIO);
|
||||||
if (RT_NULL == result)
|
if (RT_NULL == dynamic_mutex)
|
||||||
{
|
{
|
||||||
uassert_true(RT_FALSE);
|
uassert_true(RT_FALSE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue