From bba832ea08daa24f817a09c635f08ecff0089b42 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Tue, 16 Nov 2021 01:27:06 +0800 Subject: [PATCH] chore: replace YES/NO macros to 1/0 Signed-off-by: Caoruihong Change-Id: I40e31e82c33418019c1afc16ac174919e72fbb07 --- kernel/base/misc/sysinfo_shellcmd.c | 16 +++++----- kernel/extended/liteipc/hm_liteipc.c | 32 +++++++++---------- kernel/extended/liteipc/hm_liteipc.h | 4 +-- kernel/include/los_typedef.h | 10 ------ testsuites/kernel/include/iCunit.h | 2 +- testsuites/kernel/include/osTest.h | 4 +-- .../kernel_base/core/task/It_los_task.c | 2 +- .../kernel_base/ipc/queue/It_los_queue.c | 4 +-- .../kernel_base/ipc/queue/It_los_queue.h | 2 +- testsuites/kernel/src/iCunit.c | 12 +++---- testsuites/kernel/src/osTest.c | 6 ++-- testsuites/unittest/common/include/iCunit.h | 2 +- .../unittest/common/include/los_typedef.h | 10 ------ testsuites/unittest/common/include/osTest.h | 4 +-- testsuites/unittest/common/osTest.cpp | 2 +- testsuites/unittest/liteipc/it_test_liteipc.h | 2 +- testsuites/unittest/liteipc/liteipc.h | 2 +- testsuites/unittest/liteipc/smgr_demo.cpp | 2 +- .../liteipc/smoke/liteipc_test_002.cpp | 6 ++-- .../posix/mqueue/posix_mqueue_test.cpp | 2 +- 20 files changed, 53 insertions(+), 73 deletions(-) diff --git a/kernel/base/misc/sysinfo_shellcmd.c b/kernel/base/misc/sysinfo_shellcmd.c index ba9186f8..46f85f08 100644 --- a/kernel/base/misc/sysinfo_shellcmd.c +++ b/kernel/base/misc/sysinfo_shellcmd.c @@ -42,7 +42,7 @@ #endif -#define SYSINFO_ENABLED(x) (((x) == YES) ? "YES" : "NO") +#define SYSINFO_ENABLED(x) (((x) == TRUE) ? "YES" : "NO") UINT32 OsShellCmdTaskCntGet(VOID) { UINT32 loop; @@ -118,21 +118,21 @@ UINT32 OsShellCmdSwtmrCntGet(VOID) LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdSystemInfoGet(VOID) { - UINT8 isTaskEnable = YES; + UINT8 isTaskEnable = TRUE; #ifdef LOSCFG_BASE_IPC_SEM - UINT8 isSemEnable = YES; + UINT8 isSemEnable = TRUE; #else - UINT8 isSemEnable = NO; + UINT8 isSemEnable = FALSE; #endif #ifdef LOSCFG_BASE_IPC_QUEUE - UINT8 isQueueEnable = YES; + UINT8 isQueueEnable = TRUE; #else - UINT8 isQueueEnable = NO; + UINT8 isQueueEnable = FALSE; #endif #ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE - UINT8 isSwtmrEnable = YES; + UINT8 isSwtmrEnable = TRUE; #else - UINT8 isSwtmrEnable = NO; + UINT8 isSwtmrEnable = FALSE; #endif PRINTK("\n Module Used Total Enabled\n"); diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index 26b6352a..d0c27a38 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -46,8 +46,8 @@ #include "los_vm_phys.h" #include "los_hook.h" -#define USE_TASKID_AS_HANDLE YES -#define USE_MMAP YES +#define USE_TASKID_AS_HANDLE 1 +#define USE_MMAP 1 #define IPC_IO_DATA_MAX 8192UL #define IPC_MSG_DATA_SZ_MAX (IPC_IO_DATA_MAX * sizeof(SpecialObj) / (sizeof(SpecialObj) + sizeof(size_t))) #define IPC_MSG_OBJECT_NUM_MAX (IPC_MSG_DATA_SZ_MAX / sizeof(SpecialObj)) @@ -69,7 +69,7 @@ typedef struct { } IpcUsedNode; STATIC LosMux g_serviceHandleMapMux; -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) STATIC HandleInfo g_cmsTask; #else STATIC HandleInfo g_serviceHandleMap[MAX_SERVICE_NUM]; @@ -100,7 +100,7 @@ STATIC const struct file_operations_vfs g_liteIpcFops = { LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID) { UINT32 ret; -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) g_cmsTask.status = HANDLE_NOT_USED; #else memset_s(g_serviceHandleMap, sizeof(g_serviceHandleMap), 0, sizeof(g_serviceHandleMap)); @@ -417,7 +417,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID) return -EINVAL; } (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) *taskID = serviceHandle ? serviceHandle : g_cmsTask.taskID; (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); return LOS_OK; @@ -435,7 +435,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID) LITE_OS_SEC_TEXT STATIC UINT32 GenerateServiceHandle(UINT32 taskID, HandleStatus status, UINT32 *serviceHandle) { (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) *serviceHandle = taskID ? taskID : LOS_CurTaskIDGet(); /* if taskID is 0, return curTaskID */ if (*serviceHandle != g_cmsTask.taskID) { (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); @@ -458,7 +458,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GenerateServiceHandle(UINT32 taskID, HandleStatus LITE_OS_SEC_TEXT STATIC VOID RefreshServiceHandle(UINT32 serviceHandle, UINT32 result) { -#if (USE_TASKID_AS_HANDLE == NO) +#if (USE_TASKID_AS_HANDLE == 0) (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); if ((result == LOS_OK) && (g_serviceHandleMap[serviceHandle].status == HANDLE_REGISTING)) { g_serviceHandleMap[serviceHandle].status = HANDLE_REGISTED; @@ -580,7 +580,7 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID) return; } -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) UINT32 intSave; LOS_DL_LIST *listHead = NULL; @@ -641,7 +641,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetCms(UINTPTR maxMsgSize) return -EINVAL; } (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) if (g_cmsTask.status == HANDLE_NOT_USED) { g_cmsTask.status = HANDLE_REGISTED; g_cmsTask.taskID = LOS_CurTaskIDGet(); @@ -665,7 +665,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsSet(VOID) { BOOL ret; (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) ret = g_cmsTask.status == HANDLE_REGISTED; #else ret = g_serviceHandleMap[0].status == HANDLE_REGISTED; @@ -678,7 +678,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsTask(UINT32 taskID) { BOOL ret; (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); -#if (USE_TASKID_AS_HANDLE == YES) +#if (USE_TASKID_AS_HANDLE == 1) ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processID == OS_TCB_FROM_TID(g_cmsTask.taskID)->processID) : FALSE; #else ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processID == @@ -937,7 +937,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) UINT32 ret; IpcMsg *msg = content->outMsg; UINT32 flag = content->flag; -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) UINT64 now = LOS_CurrNanosec(); #endif if (((msg->dataSz > 0) && (msg->data == NULL)) || @@ -958,7 +958,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) PRINT_ERR("Liteipc %s, %d\n", __FUNCTION__, __LINE__); return -EACCES; } -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) msg->timestamp = now; #endif break; @@ -970,7 +970,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) if (!IsValidReply(content)) { return -EINVAL; } -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) if (now > msg->timestamp + LITEIPC_TIMEOUT_NS) { #ifdef LOSCFG_KERNEL_HOOK ret = GetTid(msg->target.handle, dstTid); @@ -988,7 +988,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) break; case MT_DEATH_NOTIFY: *dstTid = msg->target.handle; -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) msg->timestamp = now; #endif break; @@ -1083,7 +1083,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c PRINT_ERR("%s, %d\n", __FUNCTION__, __LINE__); ret = -EINVAL; } -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) if (node->msg.timestamp != content->outMsg->timestamp) { PRINT_ERR("Recieve a unmatch reply, drop it\n"); ret = -EINVAL; diff --git a/kernel/extended/liteipc/hm_liteipc.h b/kernel/extended/liteipc/hm_liteipc.h index a14108f8..352c35ff 100644 --- a/kernel/extended/liteipc/hm_liteipc.h +++ b/kernel/extended/liteipc/hm_liteipc.h @@ -46,7 +46,7 @@ extern "C" { #define LITEIPC_DRIVER "/dev/lite_ipc" #define LITEIPC_DRIVER_MODE 0644 #define MAX_SERVICE_NUM LOSCFG_BASE_CORE_TSK_LIMIT -#define USE_TIMESTAMP YES +#define USE_TIMESTAMP 1 typedef enum { HANDLE_NOT_USED, @@ -143,7 +143,7 @@ typedef struct { SvcIdentity target; /**< serviceHandle or targetTaskId, depending on type */ UINT32 code; /**< service function code */ UINT32 flag; -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) UINT64 timestamp; #endif UINT32 dataSz; /**< size of data */ diff --git a/kernel/include/los_typedef.h b/kernel/include/los_typedef.h index 18ec7af4..7c47e9a0 100644 --- a/kernel/include/los_typedef.h +++ b/kernel/include/los_typedef.h @@ -102,16 +102,6 @@ typedef size_t BOOL; #define NULL ((VOID *)0) #endif -#ifdef YES -#undef YES -#endif -#define YES 1 - -#ifdef NO -#undef NO -#endif -#define NO 0 - #define OS_NULL_BYTE ((UINT8)0xFF) #define OS_NULL_SHORT ((UINT16)0xFFFF) #define OS_NULL_INT ((UINT32)0xFFFFFFFF) diff --git a/testsuites/kernel/include/iCunit.h b/testsuites/kernel/include/iCunit.h index c0c67484..6b7e0376 100644 --- a/testsuites/kernel/include/iCunit.h +++ b/testsuites/kernel/include/iCunit.h @@ -73,7 +73,7 @@ typedef unsigned long iiUINT32; #define TEST_MODE (FUNCTION_TEST) -#define TEST_LESSER_MEM NO +#define TEST_LESSER_MEM 0 typedef iUINT32 (*CASE_FUNCTION)(void); diff --git a/testsuites/kernel/include/osTest.h b/testsuites/kernel/include/osTest.h index f401ca20..522a53d4 100644 --- a/testsuites/kernel/include/osTest.h +++ b/testsuites/kernel/include/osTest.h @@ -260,11 +260,11 @@ extern u_long TRandom(void); #define HUAWEI_ENV_NFS 0 #ifndef TEST_RESOURCELEAK_CHECK -#define TEST_RESOURCELEAK_CHECK YES +#define TEST_RESOURCELEAK_CHECK 1 #endif #ifndef TEST_MODULE_CHECK -#define TEST_MODULE_CHECK YES +#define TEST_MODULE_CHECK 1 #endif #define OS_PROCESS_STATUS_PEND OS_PROCESS_STATUS_PENDING diff --git a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c index b200fc64..fb194fa1 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c +++ b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c @@ -37,7 +37,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#define LOSCFG_TEST_UNSOLVED YES +#define LOSCFG_TEST_UNSOLVED 1 volatile UINT64 g_itTimesliceTestCount1 = 0; volatile INT32 g_timesliceTestCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c index a1dd0a3a..e1828b25 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c @@ -75,7 +75,7 @@ VOID ItSuiteLosQueue(VOID) #if defined(LOSCFG_TEST_SMOKE) ItLosQueue001(); ItLosQueue097(); -#if (LOS_MEM_TLSF == YES) +#if (LOS_MEM_TLSF == 1) #else ItLosQueue100(); ItLosQueue105(); @@ -172,7 +172,7 @@ VOID ItSuiteLosQueue(VOID) ItLosQueue096(); ItLosQueue098(); -#if (LOS_MEM_TLSF == YES) +#if (LOS_MEM_TLSF == 1) #else ItLosQueue099(); ItLosQueue101(); diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h index 0309563c..4b090392 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h @@ -65,7 +65,7 @@ extern VOID ItSuiteLosQueue(VOID); #if defined(LOSCFG_TEST_SMOKE) VOID ItLosQueue001(VOID); VOID ItLosQueue097(VOID); -#if (LOS_MEM_TLSF == YES) +#if (LOS_MEM_TLSF == 1) #else VOID ItLosQueue100(VOID); VOID ItLosQueue105(VOID); diff --git a/testsuites/kernel/src/iCunit.c b/testsuites/kernel/src/iCunit.c index 1515ba2d..058327ba 100644 --- a/testsuites/kernel/src/iCunit.c +++ b/testsuites/kernel/src/iCunit.c @@ -33,7 +33,7 @@ #include "iCunit.inc" #include "iCunit_config.h" #include "osTest.h" -#if TEST_RESOURCELEAK_CHECK == YES +#if TEST_RESOURCELEAK_CHECK == 1 #include "los_swtmr_pri.h" #include "los_sem_pri.h" #include "los_queue_pri.h" @@ -81,7 +81,7 @@ char *g_strModule[] = {"TASK", "MEM", "SEM", "MUX", "EVENT", "QUE", "SWTMR", "HW }; UINT32 g_modelNum = sizeof(g_strModule) / sizeof(g_strModule[0]); -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 UINT32 g_failModelResult[sizeof(g_strModule) / sizeof(g_strModule[0])] = {0}; UINT32 g_passModelResult[sizeof(g_strModule) / sizeof(g_strModule[0])] = {0}; @@ -217,7 +217,7 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase) g_iCunitErrLineNo = 0; g_iCunitErrCode = 0; -#if TEST_RESOURCELEAK_CHECK == YES +#if TEST_RESOURCELEAK_CHECK == 1 extern UINT32 LOS_MemTotalUsedGet(VOID * pPool); extern HwiHandleForm g_hwiForm[OS_HWI_MAX_NUM]; extern SWTMR_CTRL_S *g_swtmrCBArray; @@ -399,14 +399,14 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase) psubCase->errLine = g_iCunitErrLineNo; psubCase->retCode = (0 == g_iCunitErrLineNo) ? (caseRet) : (g_iCunitErrCode); -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 g_executModelNum[psubCase->testcase_module]++; #endif ENDING: if (psubCase->errLine == 0 && caseRet == 0) { g_passResult++; -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 g_passModelResult[psubCase->testcase_module]++; #endif @@ -416,7 +416,7 @@ ENDING: g_strLevel[psubCase->testcase_level], g_strType[psubCase->testcase_type]); } } else { -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 if (g_failResult < 50) { // 50 g_errorCase[g_failResult] = *psubCase; } diff --git a/testsuites/kernel/src/osTest.c b/testsuites/kernel/src/osTest.c index 5317ea77..895114ca 100644 --- a/testsuites/kernel/src/osTest.c +++ b/testsuites/kernel/src/osTest.c @@ -103,7 +103,7 @@ UINT8 g_mIndex; UINT32 g_semID3[LOSCFG_BASE_IPC_SEM_CONFIG + 1]; LOS_MEM_POOL_STATUS g_sysMemStatus = { 0 }; -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 extern UINT32 g_failModelResult[]; extern UINT32 g_passModelResult[]; @@ -467,7 +467,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4) g_testCircleCount = 0; dprintf("\t\n --- Test start--- \n"); -#if (TEST_LESSER_MEM == YES) +#if (TEST_LESSER_MEM == 1) UINT32 memusedfirst = 0x600000; // 6M for fs or 3M for kernel LOS_MEM_POOL_STATUS status = { 0 }; LOS_MemInfoGet(OS_SYS_MEM_ADDR, &status); @@ -483,7 +483,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4) TestKernelBase(); TestPosix(); -#if (TEST_MODULE_CHECK == YES) && defined(LOSCFG_TEST) +#if (TEST_MODULE_CHECK == 1) && defined(LOSCFG_TEST) for (int i = 0; i < g_modelNum - 1; i++) { if (g_executModelNum[i] != 0) { dprintf("\nExecuted Model: %s, Executed Model_Num: %d ,failed_count: %d , sucess_count :%d", diff --git a/testsuites/unittest/common/include/iCunit.h b/testsuites/unittest/common/include/iCunit.h index 167f773a..a8fa009c 100644 --- a/testsuites/unittest/common/include/iCunit.h +++ b/testsuites/unittest/common/include/iCunit.h @@ -64,7 +64,7 @@ typedef unsigned long iiUINT32; #define TEST_MODE (FUNCTION_TEST) -#define TEST_LESSER_MEM NO +#define TEST_LESSER_MEM 0 #define TEST_ADD_CASE(string, TestCase, TEST_POSIX, TEST_MEM, TEST_LEVEL0, TEST_FUNCTION) \ do { \ diff --git a/testsuites/unittest/common/include/los_typedef.h b/testsuites/unittest/common/include/los_typedef.h index a80a1dd5..44ab2d8e 100644 --- a/testsuites/unittest/common/include/los_typedef.h +++ b/testsuites/unittest/common/include/los_typedef.h @@ -99,16 +99,6 @@ typedef size_t BOOL; #define NULL ((VOID *)0) #endif -#ifdef YES -#undef YES -#endif -#define YES 1 - -#ifdef NO -#undef NO -#endif -#define NO 0 - #define OS_NULL_BYTE ((UINT8)0xFF) #define OS_NULL_SHORT ((UINT16)0xFFFF) #define OS_NULL_INT ((UINT32)0xFFFFFFFF) diff --git a/testsuites/unittest/common/include/osTest.h b/testsuites/unittest/common/include/osTest.h index c902d829..222980a3 100644 --- a/testsuites/unittest/common/include/osTest.h +++ b/testsuites/unittest/common/include/osTest.h @@ -250,11 +250,11 @@ UINT32 LosTaskDelay(UINT32 tick); #define HUAWEI_ENV_NFS 0 #ifndef TEST_RESOURCELEAK_CHECK -#define TEST_RESOURCELEAK_CHECK YES +#define TEST_RESOURCELEAK_CHECK 1 #endif #ifndef TEST_MODULE_CHECK -#define TEST_MODULE_CHECK YES +#define TEST_MODULE_CHECK 1 #endif extern UINT32 g_shellTestQueueID; diff --git a/testsuites/unittest/common/osTest.cpp b/testsuites/unittest/common/osTest.cpp index ada54c52..3b0ca940 100644 --- a/testsuites/unittest/common/osTest.cpp +++ b/testsuites/unittest/common/osTest.cpp @@ -77,7 +77,7 @@ UINT32 g_testCircleCount = 0; UINT32 g_fatFilesystem; UINT8 g_mUsIndex; -#if TEST_MODULE_CHECK == YES +#if TEST_MODULE_CHECK == 1 extern UINT32 g_FailModelResult[]; extern UINT32 g_PassModelResult[]; diff --git a/testsuites/unittest/liteipc/it_test_liteipc.h b/testsuites/unittest/liteipc/it_test_liteipc.h index 1d4282ad..586f0dc3 100644 --- a/testsuites/unittest/liteipc/it_test_liteipc.h +++ b/testsuites/unittest/liteipc/it_test_liteipc.h @@ -35,7 +35,7 @@ #include "osTest.h" #include "sys/resource.h" -#define USE_TIMESTAMP YES +#define USE_TIMESTAMP 1 extern void ItPosixLiteIpc001(void); extern void ItPosixLiteIpc002(void); diff --git a/testsuites/unittest/liteipc/liteipc.h b/testsuites/unittest/liteipc/liteipc.h index 6ce880fc..2be36686 100644 --- a/testsuites/unittest/liteipc/liteipc.h +++ b/testsuites/unittest/liteipc/liteipc.h @@ -81,7 +81,7 @@ typedef struct { SvcIdentity target; /**< serviceHandle or targetTaskId, depending on type */ uint32_t code; uint32_t flag; -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) uint64_t timestamp; #endif uint32_t dataSz; /**< size of data */ diff --git a/testsuites/unittest/liteipc/smgr_demo.cpp b/testsuites/unittest/liteipc/smgr_demo.cpp index f4c673c4..e8bddda4 100644 --- a/testsuites/unittest/liteipc/smgr_demo.cpp +++ b/testsuites/unittest/liteipc/smgr_demo.cpp @@ -71,7 +71,7 @@ void SendReply(int fd, IpcMsg *dataIn, uint32_t result, uint32_t serviceHandle) data1.outMsg->target.handle = dataIn->taskID; data1.outMsg->target.token = dataIn->target.token; data1.outMsg->code = dataIn->code; -#if (USE_TIMESTAMP == YES) +#if (USE_TIMESTAMP == 1) data1.outMsg->timestamp = dataIn->timestamp; #endif ptr[0] = result; diff --git a/testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp b/testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp index 2dd89a70..4c397ba5 100644 --- a/testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp +++ b/testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp @@ -43,7 +43,7 @@ #include "smgr_demo.h" -#define NEED_BREAK YES +#define NEED_BREAK 1 static int g_ipcFd; char g_serviceName[] = "ohos.testservice"; @@ -71,7 +71,7 @@ static int CallTestServiceLoop(uint32_t id) while (1) { num++; -#if (NEED_BREAK == YES) +#if (NEED_BREAK == 1) if (num > 50000) { break; } @@ -148,7 +148,7 @@ static int TestServiceLoop(void) gettimeofday(&last_time, 0); while (1) { cnt++; -#if (NEED_BREAK == YES) +#if (NEED_BREAK == 1) if (cnt > 100000 - 10) { printf("TestServiceLoop break!\n"); break; diff --git a/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp b/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp index 81df7893..0297556e 100644 --- a/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp +++ b/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp @@ -1343,7 +1343,7 @@ HWTEST_F(PosixMqueueTest, ItPosixQueue203, TestSize.Level0) ItPosixQueue203(); } -#if (LOSCFG_USER_TEST_SMP == YES) +#if (LOSCFG_USER_TEST_SMP == 1) /** * @tc.name: IT_POSIX_QUEUE_204 * @tc.desc: function for PosixMqueueTest