diff options
| author | Meco Man <[email protected]> | 2022-06-30 21:17:04 -0400 |
|---|---|---|
| committer | guo <[email protected]> | 2022-07-01 11:39:28 +0800 |
| commit | f27110decd495271ae3c6cd5b2cdfb6d75bba7a0 (patch) | |
| tree | 435f40841f6765b499227368fbed3fe59ccaf3a5 /examples | |
| parent | ff4b6a66714a9e2763afb158af1aefe8729844d2 (diff) | |
[utest] fix a bug
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/utest/testcases/kernel/memheap_tc.c | 6 | ||||
| -rw-r--r-- | examples/utest/testcases/kernel/mutex_tc.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/utest/testcases/kernel/memheap_tc.c b/examples/utest/testcases/kernel/memheap_tc.c index fe81cd1472..a2551032a7 100644 --- a/examples/utest/testcases/kernel/memheap_tc.c +++ b/examples/utest/testcases/kernel/memheap_tc.c @@ -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++) diff --git a/examples/utest/testcases/kernel/mutex_tc.c b/examples/utest/testcases/kernel/mutex_tc.c index 9a25219a1a..18be02fcbe 100644 --- a/examples/utest/testcases/kernel/mutex_tc.c +++ b/examples/utest/testcases/kernel/mutex_tc.c @@ -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); } |
