fix: gcc编译testsuite编译问题修复

修复It_los_mem.h中没有定义LOS_DLNK_NODE_HEAD_SIZE、MIN_DLNK_POOL_SIZE,编译告警等问题。

close #I4DAOU

Signed-off-by: kenneth <zhushangyuan@huawei.com>
This commit is contained in:
kenneth
2021-10-11 12:23:43 +08:00
parent adaefc6133
commit f7d26b8e12
14 changed files with 25 additions and 33 deletions

View File

@@ -62,10 +62,4 @@ static_library("test_mem") {
]
configs += [ "//kernel/liteos_m/testsuits:include" ]
defines = [
"LOS_RECORD_LR_CNT=3",
"LOS_DLNK_NODE_HEAD_SIZE=0",
"MIN_DLNK_POOL_SIZE=0",
]
}

View File

@@ -46,6 +46,9 @@ extern "C" {
#define OS_MEM_WATERLINE YES
#define LOS_DLNK_NODE_HEAD_SIZE 0
#define MIN_DLNK_POOL_SIZE 0
#ifdef OS_MEM_WATERLINE
#define TEST_MEM_MINIUSE (LOS_DLNK_HEAD_SIZE + LOS_DLNK_NODE_HEAD_SIZE + sizeof(LOS_MEM_POOL_INFO))
#endif
@@ -84,7 +87,7 @@ struct TestMemNodeHead {
UINT32 magic;
#endif
#if (LOSCFG_MEM_LEAKCHECK == 1)
UINTPTR linkReg[LOS_RECORD_LR_CNT];
UINTPTR linkReg[LOSCFG_MEM_RECORD_LR_CNT];
#endif
union {
struct TestMemNodeHead *prev; /* The prev is used for current node points to the previous node */

View File

@@ -63,8 +63,10 @@ static UINT32 TestCase(VOID)
ICUNIT_GOTO_NOT_EQUAL(p0, NULL, 0, EXIT);
d[i] = p0;
}
if (!((UINT32)(UINTPTR)g_memPool < (UINT32)(UINTPTR)d[0] < (UINT32)(UINTPTR)d[1] < (UINT32)(UINTPTR)p[1]))
if (!(((UINT32)(UINTPTR)g_memPool < (UINT32)(UINTPTR)d[0]) && ((UINT32)(UINTPTR)d[0] < (UINT32)(UINTPTR)d[1]) &&
((UINT32)(UINTPTR)d[1] < (UINT32)(UINTPTR)p[1]))) {
ICUNIT_GOTO_EQUAL(1, 0, 0, EXIT);
}
EXIT:
MemFree();

View File

@@ -58,7 +58,7 @@ static UINT32 TestCase(VOID)
f0 = LOS_MemAlloc(g_memPool, size / 4); // 4, The reallocated memory size is a quarter of its previous size.
ICUNIT_GOTO_NOT_EQUAL(f0, NULL, f0, EXIT);
if (!((UINT32)(UINTPTR)p[0] < (UINT32)(UINTPTR)f0 < (UINT32)(UINTPTR)p[1])) {
if (!(((UINT32)(UINTPTR)p[0] < (UINT32)(UINTPTR)f0) && ((UINT32)(UINTPTR)f0 < (UINT32)(UINTPTR)p[1]))) {
ICUNIT_GOTO_EQUAL(1, 0, 0, EXIT);
}

View File

@@ -40,7 +40,7 @@ void MemStart(void)
g_testPool = LOS_MemAlloc(LOSCFG_SYS_HEAP_ADDR, TEST_POOL_SIZE);
if ((g_memPool == NULL) || (g_testPool == NULL)) {
PRINT_ERR("alloc failed , mem TestCase would be failed!!!!%x !!! %x", g_memPool, g_testPool);
PRINT_ERR("alloc failed , mem TestCase would be failed!!!!%p !!! %p", g_memPool, g_testPool);
}
}