diff --git a/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp b/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp index fc35c97..5fa30ea 100644 --- a/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp +++ b/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp @@ -21,11 +21,11 @@ namespace OHOS { namespace Kernel { namespace AccessToken { -const char *DEVACCESSTOKENID = "/dev/access_token_id"; +const char *g_devaccesstokenid = "/dev/access_token_id"; int GetTokenid(unsigned long long *token) { - int fd = open(DEVACCESSTOKENID, O_RDWR); + int fd = open(g_devaccesstokenid, O_RDWR); if (fd < 0) { return -1; } @@ -40,7 +40,7 @@ int GetTokenid(unsigned long long *token) int SetTokenid(unsigned long long *token) { - int fd = open(DEVACCESSTOKENID, O_RDWR); + int fd = open(g_devaccesstokenid, O_RDWR); if (fd < 0) { return -1; } @@ -182,7 +182,7 @@ int AccessTokenidGrpTestOther(uint8_t *dataToken) int GetfTokenid(unsigned long long *ftoken) { - int fd = open(DEVACCESSTOKENID, O_RDWR); + int fd = open(g_devaccesstokenid, O_RDWR); if (fd < 0) { return -1; } @@ -199,7 +199,7 @@ int GetfTokenid(unsigned long long *ftoken) int SetfTokenid(unsigned long long *ftoken) { - int fd = open(DEVACCESSTOKENID, O_RDWR); + int fd = open(g_devaccesstokenid, O_RDWR); if (fd < 0) { return -1; } diff --git a/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp b/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp index 2668d4c..dc502cb 100644 --- a/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_ENABLE = "/sys/fs/f2fs/loop1/hc_enable"; +const char *g_hcEnable = "/sys/fs/f2fs/loop1/hc_enable"; namespace OHOS { bool HcEnableFuzzer(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_ENABLE, size); + bool ret = HcFuzzTest(data, g_hcEnable, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp index 49d7010..11b331f 100644 --- a/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_HOT_DATA_LOWER_LIMIT = "/sys/fs/f2fs/loop1/hc_hot_data_lower_limit"; +const char *g_hcHotDataLowerLimit = "/sys/fs/f2fs/loop1/hc_hot_data_lower_limit"; namespace OHOS { bool HcHotDataLowerLimitFuzzer(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_HOT_DATA_LOWER_LIMIT, size); + bool ret = HcFuzzTest(data, g_hcHotDataLowerLimit, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp b/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp index f40fa83..96df8a2 100644 --- a/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_HOT_DATA_WATERLINE = "/sys/fs/f2fs/loop1/hc_hot_data_waterline"; +const char *g_hcHotDataWaterline = "/sys/fs/f2fs/loop1/hc_hot_data_waterline"; namespace OHOS { bool HcHotDataWaterlineFuzzer(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_HOT_DATA_WATERLINE, size); + bool ret = HcFuzzTest(data, g_hcHotDataWaterline, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp index 923339e..b2ea4c7 100644 --- a/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_HOT_NODE_LOWER_LIMIT = "/sys/fs/f2fs/loop1/hc_hot_node_lower_limit"; +const char *g_hcHotNodeLowerLimit = "/sys/fs/f2fs/loop1/hc_hot_node_lower_limit"; namespace OHOS { bool HcHotNodeLowerLimitFuzzTest(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_HOT_NODE_LOWER_LIMIT, size); + bool ret = HcFuzzTest(data, g_hcHotNodeLowerLimit, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp b/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp index 868f6db..53abec0 100644 --- a/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_HOT_NODE_WATERLINE = "/sys/fs/f2fs/loop1/hc_hot_node_waterline"; +const char *g_hcHotNodeWaterline = "/sys/fs/f2fs/loop1/hc_hot_node_waterline"; namespace OHOS { bool HcHotNodeWaterlineFuzzTest(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_HOT_NODE_WATERLINE, size); + bool ret = HcFuzzTest(data, g_hcHotNodeWaterline, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp index b4a59bc..e1bceaf 100644 --- a/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_WARM_DATA_LOWER_LIMIT = "/sys/fs/f2fs/loop1/hc_warm_data_lower_limit"; +const char *g_hcWarmDataLowerLimit = "/sys/fs/f2fs/loop1/hc_warm_data_lower_limit"; namespace OHOS { bool HcWarmDataLowerLimitFuzzTest(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_WARM_DATA_LOWER_LIMIT, size); + bool ret = HcFuzzTest(data, g_hcWarmDataLowerLimit, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp index 3001463..48b8334 100644 --- a/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_WARM_DATA_WATERLINE = "/sys/fs/f2fs/loop1/hc_warm_data_waterline"; +const char *g_hcWarmDataWaterline = "/sys/fs/f2fs/loop1/hc_warm_data_waterline"; namespace OHOS { bool HcWarmDataWaterLineFuzzTest(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_WARM_DATA_WATERLINE, size); + bool ret = HcFuzzTest(data, g_hcWarmDataWaterline, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp index d5ec619..443a127 100644 --- a/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_WARM_NODE_LOWER_LIMIT = "/sys/fs/f2fs/loop1/hc_warm_node_lower_limit"; +const char *g_hcWarmNodeLowerLimit = "/sys/fs/f2fs/loop1/hc_warm_node_lower_limit"; namespace OHOS { bool HcWarmNodeLowerLimit(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_WARM_NODE_LOWER_LIMIT, size); + bool ret = HcFuzzTest(data, g_hcWarmNodeLowerLimit, size); return ret; } } // namespace OHOS diff --git a/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp index e13cde7..f54a321 100644 --- a/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp @@ -13,12 +13,12 @@ #include #include "hccommon.h" -const char *HC_WARM_NODE_WATERLINE = "/sys/fs/f2fs/loop1/hc_warm_node_waterline"; +const char *g_hcWarmNodeWaterline = "/sys/fs/f2fs/loop1/hc_warm_node_waterline"; namespace OHOS { bool HcWarmNodeLowerWaterLine(const uint8_t *data, size_t size) { - bool ret = HcFuzzTest(data, HC_WARM_NODE_WATERLINE, size); + bool ret = HcFuzzTest(data, g_hcWarmNodeWaterline, size); return ret; } } // namespace OHOS diff --git a/test/tracepointtest/emmc.h b/test/tracepointtest/emmc.h index 166c686..5f11f46 100644 --- a/test/tracepointtest/emmc.h +++ b/test/tracepointtest/emmc.h @@ -13,8 +13,8 @@ #define TRACE_SYSTEM emmc #define TRACE_INCLUDE_PATH trace/hooks -#if !defined(_TRACE_HOOKS_EMMC_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_HOOKS_EMMC_H +#if !defined(TRACE_HOOKS_EMMC_H) || defined(TRACE_HEADER_MULTI_READ) +#define TRACE_HOOKS_EMMC_H #include #include diff --git a/test/tracepointtest/tracepoint_test/tracepoint_test.c b/test/tracepointtest/tracepoint_test/tracepoint_test.c index 2510ee0..158ad02 100644 --- a/test/tracepointtest/tracepoint_test/tracepoint_test.c +++ b/test/tracepointtest/tracepoint_test/tracepoint_test.c @@ -33,4 +33,4 @@ static void tracepoint_test_exit_module(void) /* module entry points */ module_init(tracepoint_test_init_module); module_exit(tracepoint_test_exit_module); -MODULE_LICENSE ("GPL v2"); +MODULE_LICENSE("GPL v2"); diff --git a/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c b/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c index a2e0b24..b0cc4ef 100644 --- a/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c +++ b/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c @@ -32,4 +32,4 @@ static void aml_emmc_partition_test_exit_module(void) /* module entry points */ module_init(aml_emmc_partition_test_init_module); module_exit(aml_emmc_partition_test_exit_module); -MODULE_LICENSE ("GPL v2"); +MODULE_LICENSE("GPL v2"); diff --git a/test/tracepointtest/vendordommap_test/vendordommap_test.c b/test/tracepointtest/vendordommap_test/vendordommap_test.c index e109b62..720343b 100644 --- a/test/tracepointtest/vendordommap_test/vendordommap_test.c +++ b/test/tracepointtest/vendordommap_test/vendordommap_test.c @@ -32,4 +32,4 @@ static void mmap_test_exit_module(void) /* module entry points */ module_init(mmap_test_init_module); module_exit(mmap_test_exit_module); -MODULE_LICENSE ("GPL v2"); +MODULE_LICENSE("GPL v2"); diff --git a/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c b/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c index 4f67eb5..1ebf548 100644 --- a/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c +++ b/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c @@ -32,4 +32,4 @@ static void mprotect_pkey_test_exit_module(void) /* module entry points */ module_init(mprotect_pkey_test_init_module); module_exit(mprotect_pkey_test_exit_module); -MODULE_LICENSE ("GPL v2"); +MODULE_LICENSE("GPL v2"); diff --git a/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c b/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c index 8cbbb85..5776e80 100644 --- a/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c +++ b/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c @@ -32,4 +32,4 @@ static void fake_boot_partition_test_exit_module(void) /* module entry points */ module_init(fake_boot_partition_test_init_module); module_exit(fake_boot_partition_test_exit_module); -MODULE_LICENSE ("GPL v2"); +MODULE_LICENSE("GPL v2"); diff --git a/test/unittest/accesstokenid/accesstokenid_test.cpp b/test/unittest/accesstokenid/accesstokenid_test.cpp index 00f6898..f867bbf 100644 --- a/test/unittest/accesstokenid/accesstokenid_test.cpp +++ b/test/unittest/accesstokenid/accesstokenid_test.cpp @@ -55,9 +55,9 @@ constexpr unsigned int ACCESS_TOKEN_GRPID = 3020; constexpr unsigned int ACCESS_TOKEN_OTHER_UID = 1234; constexpr unsigned int ACCESS_TOKEN_OTHER_GRPID = 1234; -const char dev_accesstokenid[] = "/dev/access_token_id"; +const char DEV_ACCESSTOKENID[] = "/dev/access_token_id"; -struct tokeninfo { +struct Tokeninfo { pid_t pid; pid_t tid; unsigned long long tokenid; @@ -85,9 +85,9 @@ static unsigned long long GenRand64(void) static int GetTokenid(unsigned long long *token) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return -1; } @@ -104,9 +104,9 @@ static int GetTokenid(unsigned long long *token) static int SetTokenid(unsigned long long *token) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return -1; } @@ -123,9 +123,9 @@ static int SetTokenid(unsigned long long *token) static int GetfTokenid(unsigned long long *ftoken) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return -1; } @@ -142,9 +142,9 @@ static int GetfTokenid(unsigned long long *ftoken) static int SetfTokenid(unsigned long long *ftoken) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return -1; } @@ -169,7 +169,7 @@ static void GetCurToken(unsigned long long *token, unsigned long long *ftoken) static void *CheckChildThreadInheritance(void *args) { - struct tokeninfo *tinfo = static_cast (args); + struct Tokeninfo *tinfo = static_cast(args); tinfo->pid = getpid(); tinfo->tid = gettid(); @@ -182,7 +182,7 @@ static void *CheckChildThreadInheritance(void *args) static void *CheckChildThreadSetIndepent(void *args) { - struct tokeninfo *tinfo = static_cast (args); + struct Tokeninfo *tinfo = static_cast(args); unsigned long long tokenSet = GenRand64(); unsigned long long ftokenSet = GenRand64(); unsigned long long tokenidGet = INVAL_TOKEN; @@ -288,7 +288,7 @@ HWTEST_F(AccesstokenidTest, CheckChildThreadInheritance, Function | MediumTest | unsigned long long tokenSet = GenRand64(); unsigned long long ftokenSet = GenRand64(); - struct tokeninfo tinfo; + struct Tokeninfo tinfo; tinfo.pid = getpid(); tinfo.tid = gettid(); tinfo.tokenid = INVAL_TOKEN; @@ -330,7 +330,7 @@ HWTEST_F(AccesstokenidTest, CheckChildThreadSetIndepent, Function | MediumTest | unsigned long long tokenSet = GenRand64(); unsigned long long ftokenSet = GenRand64(); - struct tokeninfo tinfo; + struct Tokeninfo tinfo; tinfo.pid = getpid(); tinfo.tid = gettid(); tinfo.tokenid = INVAL_TOKEN; @@ -365,9 +365,9 @@ HWTEST_F(AccesstokenidTest, CheckChildThreadSetIndepent, Function | MediumTest | */ HWTEST_F(AccesstokenidTest, AbnormalGetTokenid, Function | MediumTest | Level1) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -385,9 +385,9 @@ HWTEST_F(AccesstokenidTest, AbnormalGetTokenid, Function | MediumTest | Level1) */ HWTEST_F(AccesstokenidTest, AbnormalSetTokenid, Function | MediumTest | Level1) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -405,9 +405,9 @@ HWTEST_F(AccesstokenidTest, AbnormalSetTokenid, Function | MediumTest | Level1) */ HWTEST_F(AccesstokenidTest, AbnormalGetfTokenid, Function | MediumTest | Level1) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -425,9 +425,9 @@ HWTEST_F(AccesstokenidTest, AbnormalGetfTokenid, Function | MediumTest | Level1) */ HWTEST_F(AccesstokenidTest, AbnormalSetfTokenid, Function | MediumTest | Level1) { - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -447,9 +447,9 @@ HWTEST_F(AccesstokenidTest, AbnormalIoctlCmd, Function | MediumTest | Level1) { unsigned long long token; - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -477,9 +477,9 @@ HWTEST_F(AccesstokenidTest, OtherUidSetTokenid, Function | MediumTest | Level1) printf("setuid error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -505,9 +505,9 @@ HWTEST_F(AccesstokenidTest, OtherUidGetTokenid, Function | MediumTest | Level1) printf("setuid error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -535,9 +535,9 @@ HWTEST_F(AccesstokenidTest, WithoutGrpSetfTokenid, Function | MediumTest | Level printf("setgroups error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -565,9 +565,9 @@ HWTEST_F(AccesstokenidTest, WithoutGrpGetfTokenid, Function | MediumTest | Level printf("setgroups error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -595,9 +595,9 @@ HWTEST_F(AccesstokenidTest, WithGrpSetfTokenid, Function | MediumTest | Level1) printf("setgroups error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } @@ -625,9 +625,9 @@ HWTEST_F(AccesstokenidTest, WithGrpGetfTokenid, Function | MediumTest | Level1) printf("setgroups error %d \r\n", ret); } - int fd = open(dev_accesstokenid, O_RDWR); + int fd = open(DEV_ACCESSTOKENID, O_RDWR); if (fd < 0) { - printf("open %s failed\r\n", dev_accesstokenid); + printf("open %s failed\r\n", DEV_ACCESSTOKENID); return; } diff --git a/test/unittest/rtg/rtg_test.cpp b/test/unittest/rtg/rtg_test.cpp index d8035fb..cb5390f 100644 --- a/test/unittest/rtg/rtg_test.cpp +++ b/test/unittest/rtg/rtg_test.cpp @@ -175,7 +175,7 @@ static int CreateNewRtgGrp(int prioType, int rtNum) return ret; } -static int DestroyRtgGrp(int GrpId) +static int DestroyRtgGrp(int grpId) { struct RtgGrpData grpData; int ret; @@ -185,7 +185,7 @@ static int DestroyRtgGrp(int GrpId) } (void)memset_s(&grpData, sizeof(struct RtgGrpData), 0, sizeof(struct RtgGrpData)); grpData.rtgCmd = CMD_DESTROY_RTG_GRP; - grpData.grpId = GrpId; + grpData.grpId = grpId; ret = ioctl(fd, CMD_ID_SET_RTG, &grpData); close(fd);