提交 6c1587bf 编写于 作者: O openharmony_ci 提交者: Gitee

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

Merge pull request !343 from kenneth/testsuite
......@@ -203,11 +203,11 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
#endif
#if (LOSCFG_TEST == 1)
//ret = los_TestInit();
//if (ret != LOS_OK) {
// PRINT_ERR("los_TestInit error\n");
// return ret;
//}
ret = los_TestInit();
if (ret != LOS_OK) {
PRINT_ERR("los_TestInit error\n");
return ret;
}
#endif
#if (LOSCFG_PLATFORM_EXC == 1)
......
......@@ -337,6 +337,7 @@ extern VOID ItSuiteLosHwi(void);
extern VOID ItSuiteLosMem(void);
extern VOID ItSuiteLosDynlink(void);
extern VOID ItSuite_Los_FatFs(void);
extern VOID ItSuiteLosPm(void);
extern VOID ItSuite_Cmsis_Lostask(void);
extern VOID ItSuite_Cmsis_Lostask_add(void);
......
......@@ -47,7 +47,6 @@ UINT32 g_testTaskIdHwi = 0xFFFF;
static UINT32 Testcase(VOID)
{
UINT32 ret;
UINT32 loop;
HWI_PRIOR_T hwiPrio = 2;
HWI_MODE_T mode = 0;
HWI_ARG_T arg = 0;
......@@ -67,7 +66,6 @@ static UINT32 Testcase(VOID)
return LOS_OK;
EXIT:
LOS_TaskDelete(g_testTaskIdHwi);
TestHwiDelete(HWI_NUM_TEST);
......
......@@ -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",
]
}
......@@ -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 */
......
......@@ -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();
......
......@@ -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);
}
......
......@@ -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);
}
}
......
......@@ -31,6 +31,7 @@
#include "osTest.h"
#include "It_los_pm.h"
#include "los_timer.h"
#include "los_sched.h"
#define myprintf // printf
#define TEST_LOOP 5
......@@ -98,7 +99,6 @@ static UINT32 SystemPmEarly(UINT32 mode)
static VOID SystemPmLate(UINT32 mode)
{
UINT32 ret;
LosTaskCB *taskCB = NULL;
ICUNIT_ASSERT_EQUAL_VOID(mode, LOS_SYS_LIGHT_SLEEP, mode);
......@@ -154,12 +154,12 @@ static void TaskSampleEntry2(void)
while (1) {
if (g_testSample2Count == TEST_FLAGS) {
g_testSample2Count = 0;
LOS_PmLockRequest("TaskSampleEntry2");
(VOID)LOS_PmLockRequest("TaskSampleEntry2");
myprintf("%s request pm lock\n", __FUNCTION__);
}
myprintf("TaskSampleEntry2 running...count: %u\n\r", g_testSample2Count);
LOS_TaskDelay(20); /* sleep 20 ticks */
(VOID)LOS_TaskDelay(20); /* sleep 20 ticks */
if (g_testSample2Count <= TEST_TASK1_LOOP) { /* */
g_testSample2Count++;
......@@ -174,7 +174,7 @@ static void TaskSampleEntry2(void)
}
}
LOS_PmLockRelease("TaskSampleEntry2");
(VOID)LOS_PmLockRelease("TaskSampleEntry2");
myprintf("TaskSampleEntry2 exit\n");
}
......@@ -184,7 +184,7 @@ static void TaskSampleEntry1(void)
while (1) {
if (g_testSample1Count == 0) {
LOS_PmLockRequest("TaskSampleEntry1");
(VOID)LOS_PmLockRequest("TaskSampleEntry1");
myprintf("%s request pm lock\n", __FUNCTION__);
}
......@@ -205,7 +205,7 @@ static void TaskSampleEntry1(void)
}
}
LOS_PmLockRelease("TaskSampleEntry1");
(VOID)LOS_PmLockRelease("TaskSampleEntry1");
myprintf("TaskSampleEntry1 exit\n");
}
......
......@@ -31,6 +31,7 @@
#include "osTest.h"
#include "It_los_pm.h"
#include "los_timer.h"
#include "los_sched.h"
#define TEST_LOOP 5
static EVENT_CB_S g_pmTestEvent;
......
......@@ -30,11 +30,11 @@
*/
#include "It_los_queue.h"
#include "los_membox.h"
#define LOS_MEMBOX_MAGIC_SIZE 4
static UINT32 g_uwQueueID122 = 0;
static unsigned char g_aucMailBoxPool[40 + LOS_MEMBOX_MAGIC_SIZE] = {0};
static VOID *g_pMailBox = NULL;
static BOOL g_bTaskFinish1 = FALSE;
static BOOL g_bTaskFinish2 = FALSE;
......@@ -61,7 +61,6 @@ EXIT:
static VOID StTaskAllocNoWait(VOID)
{
UINT32 ret;
VOID *memBox = NULL;
memBox = OsQueueMailAlloc(g_uwQueueID122, (VOID *)g_aucMailBoxPool, LOS_NO_WAIT);
......@@ -139,5 +138,3 @@ VOID LltLosQueue003(VOID)
{
TEST_ADD_CASE("LltLosQueue003", Testcase, TEST_LOS, TEST_QUE, TEST_LEVEL1, TEST_FUNCTION);
}
......@@ -60,10 +60,7 @@ static UINT32 Testcase(VOID)
{
UINT32 ret;
QUEUE_INFO_S queueInfo;
UINT32 i;
UINT32 queueID[LOSCFG_BASE_IPC_QUEUE_LIMIT + 1];
CHAR buff1[QUEUE_SHORT_BUFFER_LENGTH] = "UniDSP";
CHAR buff2[QUEUE_SHORT_BUFFER_LENGTH] = " ";
TSK_INIT_PARAM_S task1 = {0};
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
......
......@@ -55,7 +55,6 @@ extern EVENT_CB_S g_eventCB3;
#define TIMER_LOS_SELF_DELETED 1
extern UINT32 g_idleTaskID;
static UINT32 g_usSwTmrMaxNum;
static UINT32 g_swtmrId1;
static UINT32 g_swtmrId2;
......
......@@ -99,7 +99,7 @@ char *g_strLevel[] = {
"LEVEL0", "LEVEL1", "LEVEL2", "LEVEL3"
};
char *g_strType[] = {
"FUNCTITON", "PRESSURE", "PERFORMANCE"
"FUNCTION", "PRESSURE", "PERFORMANCE"
};
iUINT32 ICunitRunF()
......@@ -127,7 +127,7 @@ iUINT32 ICunitRunF()
} else {
g_failResult++;
iCunit_Case_FailedCnt++;
PRINTF(" [Failed]-%s-%s-%s-%s-%s-[Errline: %d RetCode:0x%x]\n", psubCaseArray->pcCaseID,
PRINTF(" [Failed]-%s-%s-%s-%s-%s-[Errline: %d RetCode:0x%lx]\n", psubCaseArray->pcCaseID,
g_strLayer[psubCaseArray->testcase_layer], g_strModule[psubCaseArray->testcase_module],
g_strLevel[psubCaseArray->testcase_level], g_strType[psubCaseArray->testcase_type],
psubCaseArray->errLine, psubCaseArray->retCode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册