提交 f03eb2e7 编写于 作者: C cheng_jinsong 提交者: Gitee

Merge branch 'master' of gitee.com:openharmony/startup_init_lite into fixcache

Signed-off-by: Ncheng_jinsong <chengjinsong2@huawei.com>
...@@ -270,7 +270,7 @@ FstabItem *FindFstabItemForPath(Fstab fstab, const char *path) ...@@ -270,7 +270,7 @@ FstabItem *FindFstabItemForPath(Fstab fstab, const char *path)
{ {
FstabItem *item = NULL; FstabItem *item = NULL;
if (path == NULL || *path == '\0' || *path != '/') { if (path == NULL || *path != '/') {
return NULL; return NULL;
} }
......
...@@ -128,3 +128,4 @@ dev_dma_heap:x:3070: ...@@ -128,3 +128,4 @@ dev_dma_heap:x:3070:
dev_memory:x:3071: dev_memory:x:3071:
dev_lcd_backlight:x:3072: dev_lcd_backlight:x:3072:
dev_vibrator:x:3080: dev_vibrator:x:3080:
vcodec:x:3073:
...@@ -124,4 +124,5 @@ device_attest:x:3049:3049:::/bin/false ...@@ -124,4 +124,5 @@ device_attest:x:3049:3049:::/bin/false
dev_dma_heap:x:3070:3070:::/bin/false dev_dma_heap:x:3070:3070:::/bin/false
dev_memory:x:3071:3071:::/bin/false dev_memory:x:3071:3071:::/bin/false
dev_lcd_backlight:x:3072:3072:::/bin/false dev_lcd_backlight:x:3072:3072:::/bin/false
dev_vibrator:x:3080:3080:::/bin/false dev_vibrator:x:3080:3080:::/bin/false
\ No newline at end of file vcodec:x:3073:3073:::/bin/false
\ No newline at end of file
...@@ -62,8 +62,12 @@ static int DoRebootPanic(int id, const char *name, int argc, const char **argv) ...@@ -62,8 +62,12 @@ static int DoRebootPanic(int id, const char *name, int argc, const char **argv)
if (panic == NULL) { if (panic == NULL) {
return reboot(RB_AUTOBOOT); return reboot(RB_AUTOBOOT);
} }
fwrite((void *)"c", 1, 1, panic); if (fwrite((void *)"c", 1, 1, panic) != 1) {
fclose(panic); (void)fclose(panic);
PLUGIN_LOGI("fwrite to panic failed");
return -1;
}
(void)fclose(panic);
#endif #endif
return 0; return 0;
} }
...@@ -141,7 +145,6 @@ static int DoRebootOther(int id, const char *name, int argc, const char **argv) ...@@ -141,7 +145,6 @@ static int DoRebootOther(int id, const char *name, int argc, const char **argv)
static void RebootAdpInit(void) static void RebootAdpInit(void)
{ {
// sample {"reboot,shutdown", "reboot.shutdown", "reboot.shutdown"},
// add default reboot cmd // add default reboot cmd
(void)AddCmdExecutor("reboot", DoReboot); (void)AddCmdExecutor("reboot", DoReboot);
(void)AddCmdExecutor("reboot.other", DoRebootOther); (void)AddCmdExecutor("reboot.other", DoRebootOther);
......
...@@ -744,7 +744,7 @@ STATIC_INLINE const char *CachedParameterCheck(CachedParameter *param) ...@@ -744,7 +744,7 @@ STATIC_INLINE const char *CachedParameterCheck(CachedParameter *param)
const char *CachedParameterGet(CachedHandle handle) const char *CachedParameterGet(CachedHandle handle)
{ {
CachedParameter *param = (CachedParameter *)handle; CachedParameter *param = (CachedParameter *)handle;
PARAM_CHECK(param != NULL, return NULL, "Invalid handle %p", handle); PARAM_CHECK(param != NULL, return NULL, "Invalid handle");
return CachedParameterCheck(param); return CachedParameterCheck(param);
} }
......
...@@ -38,6 +38,10 @@ WatcherManager::~WatcherManager() ...@@ -38,6 +38,10 @@ WatcherManager::~WatcherManager()
uint32_t WatcherManager::AddRemoteWatcher(uint32_t id, const sptr<IWatcher> &watcher) uint32_t WatcherManager::AddRemoteWatcher(uint32_t id, const sptr<IWatcher> &watcher)
{ {
if (id == getpid()) {
WATCHER_LOGE("Failed to add remote watcher %d", id);
return 0;
}
WATCHER_CHECK(watcher != nullptr, return 0, "Invalid remote watcher"); WATCHER_CHECK(watcher != nullptr, return 0, "Invalid remote watcher");
WATCHER_CHECK(deathRecipient_ != nullptr, return 0, "Invalid deathRecipient_"); WATCHER_CHECK(deathRecipient_ != nullptr, return 0, "Invalid deathRecipient_");
sptr<IRemoteObject> object = watcher->AsObject(); sptr<IRemoteObject> object = watcher->AsObject();
......
...@@ -177,7 +177,6 @@ ohos_unittest("init_unittest") { ...@@ -177,7 +177,6 @@ ohos_unittest("init_unittest") {
"init/utils_unittest.cpp", "init/utils_unittest.cpp",
"innerkits/innerkits_unittest.cpp", "innerkits/innerkits_unittest.cpp",
"loopevent/loopevent_unittest.cpp", "loopevent/loopevent_unittest.cpp",
"loopevent/loopserver_unittest.cpp",
"loopevent/loopsignal_unittest.cpp", "loopevent/loopsignal_unittest.cpp",
"modules/modules_unittest.cpp", "modules/modules_unittest.cpp",
"param/client_unittest.cpp", "param/client_unittest.cpp",
......
...@@ -36,44 +36,6 @@ public: ...@@ -36,44 +36,6 @@ public:
void TearDown() {}; void TearDown() {};
}; };
HWTEST_F(CmdsUnitTest, TestCmdExecByName, TestSize.Level1)
{
DoCmdByName("load_param ", " /system/etc/param onlyadd");
DoCmdByName("symlink ", "/proc/self/fd/0 /dev/stdin");
DoCmdByName("symlink ", "/notfile ");
DoCmdByName("insmod ",
"libdemo.z.so anony=1 mmz_allocator=hisi mmz=anonymous,0,0xA8000000,384M || report_error");
DoCmdByName("insmod ", "/vendor/modules/hi_irq.ko");
DoCmdByName("insmod ", STARTUP_INIT_UT_PATH"/test_insmod");
DoCmdByName("setparam ", "sys.usb.config ${persist.sys.usb.config}");
DoCmdByName("load_persist_params ", "");
DoCmdByName("trigger ", "");
DoCmdByName("domainname ", "localdomain");
DoCmdByName("hostname ", "localhost");
DoCmdByName("sleep ", "1");
DoCmdByName("setrlimit ", "RLIMIT_NICE 40 40");
DoCmdByName("setrlimit ", "RLIMIT_NICE unlimited unlimited");
DoCmdByName("setrlimit ", "RLIMIT_NICE2 40 40");
DoCmdByName("start ", "init_ut");
DoCmdByName("stop ", "init_ut");
DoCmdByName("reset ", "init_ut");
DoCmdByName("reboot ", "");
DoCmdByName("ifup ", "lo");
DoCmdByName("mknode ", "/dev/null b 0666 1 3");
DoCmdByName("mknode ", "/dev/null C 0666 1 3");
DoCmdByName("mknode ", "/dev/null F 0666 1 3");
DoCmdByName("mknode ", "/dev/null A 0666 1 3");
DoCmdByName("makedev ", "999 999");
DoCmdByName("mount_fstab ", "/wwwwwww");
DoCmdByName("umount_fstab ", "/wwwwwww");
DoCmdByName("mksandbox ", "system chipset");
DoCmdByName("mksandbox ", "system");
DoCmdByName("mksandbox ", "notsupport");
DoCmdByName("mksandbox ", "");
DoCmdByName("mksandbox ", nullptr);
}
HWTEST_F(CmdsUnitTest, TestCmdExecByName1, TestSize.Level1) HWTEST_F(CmdsUnitTest, TestCmdExecByName1, TestSize.Level1)
{ {
DoCmdByName("timer_start ", "media_service|5000"); DoCmdByName("timer_start ", "media_service|5000");
......
...@@ -343,7 +343,7 @@ HWTEST_F(InitGroupManagerUnitTest, TestUpdaterServiceFds, TestSize.Level1) ...@@ -343,7 +343,7 @@ HWTEST_F(InitGroupManagerUnitTest, TestUpdaterServiceFds, TestSize.Level1)
{ {
Service *service = AddService("test_service8"); Service *service = AddService("test_service8");
ASSERT_NE(nullptr, service); ASSERT_NE(nullptr, service);
int *fds = (int *)malloc(sizeof(int) * 1); // ServiceStop will release fds int fds[1] = { -1 }; // ServiceStop will release fds
UpdaterServiceFds(nullptr, nullptr, 0); UpdaterServiceFds(nullptr, nullptr, 0);
UpdaterServiceFds(service, fds, 1); UpdaterServiceFds(service, fds, 1);
UpdaterServiceFds(service, fds, 0); UpdaterServiceFds(service, fds, 0);
......
...@@ -87,8 +87,7 @@ HWTEST_F(ServiceUnitTest, case02, TestSize.Level1) ...@@ -87,8 +87,7 @@ HWTEST_F(ServiceUnitTest, case02, TestSize.Level1)
int ret = ParseOneService(serviceItem, service); int ret = ParseOneService(serviceItem, service);
EXPECT_EQ(ret, 0); EXPECT_EQ(ret, 0);
int *fds = (int *)malloc(sizeof(int) * 1); // ServiceStop will release fds int fds[1] = {-1}; // ServiceStop will release fds
ASSERT_NE(nullptr, fds);
UpdaterServiceFds(service, fds, 1); UpdaterServiceFds(service, fds, 1);
service->attribute = SERVICE_ATTR_ONDEMAND; service->attribute = SERVICE_ATTR_ONDEMAND;
ret = ServiceStart(service); ret = ServiceStart(service);
...@@ -130,16 +129,12 @@ HWTEST_F(ServiceUnitTest, TestServiceStartAbnormal, TestSize.Level1) ...@@ -130,16 +129,12 @@ HWTEST_F(ServiceUnitTest, TestServiceStartAbnormal, TestSize.Level1)
int ret = ParseOneService(serviceItem, service); int ret = ParseOneService(serviceItem, service);
EXPECT_EQ(ret, 0); EXPECT_EQ(ret, 0);
const char *path = "/data/init_ut/test_service_unused";
ret = strncpy_s(service->pathArgs.argv[0], strlen(path) + 1, path, strlen(path));
EXPECT_EQ(ret, 0);
ret = ServiceStart(service); ret = ServiceStart(service);
EXPECT_EQ(ret, -1); EXPECT_EQ(ret, 0);
service->attribute &= SERVICE_ATTR_INVALID; service->attribute &= SERVICE_ATTR_INVALID;
ret = ServiceStart(service); ret = ServiceStart(service);
EXPECT_EQ(ret, -1); EXPECT_EQ(ret, 0);
service->pid = -1; service->pid = -1;
ret = ServiceStop(service); ret = ServiceStop(service);
......
...@@ -246,7 +246,7 @@ HWTEST_F(InnerkitsUnitTest, MountAllWithFstabFile_unittest, TestSize.Level1) ...@@ -246,7 +246,7 @@ HWTEST_F(InnerkitsUnitTest, MountAllWithFstabFile_unittest, TestSize.Level1)
EXPECT_EQ(MountAllWithFstabFile("/testErrorFile", 0), -1); EXPECT_EQ(MountAllWithFstabFile("/testErrorFile", 0), -1);
EXPECT_EQ(MountAllWithFstabFile(nullptr, 0), -1); EXPECT_EQ(MountAllWithFstabFile(nullptr, 0), -1);
EXPECT_EQ(GetMountStatusForMountPoint(nullptr), -1); EXPECT_EQ(GetMountStatusForMountPoint(nullptr), -1);
FstabItem fstabItem; FstabItem fstabItem = {};
fstabItem.fsType = strdup("notSupport"); fstabItem.fsType = strdup("notSupport");
EXPECT_EQ(MountOneItem(nullptr), -1); EXPECT_EQ(MountOneItem(nullptr), -1);
EXPECT_EQ(MountOneItem(&fstabItem), 0); EXPECT_EQ(MountOneItem(&fstabItem), 0);
...@@ -349,7 +349,9 @@ HWTEST_F(InnerkitsUnitTest, TestControlFd, TestSize.Level1) ...@@ -349,7 +349,9 @@ HWTEST_F(InnerkitsUnitTest, TestControlFd, TestSize.Level1)
ProcessPtyWrite(nullptr, STDERR_FILENO, &events, nullptr); ProcessPtyWrite(nullptr, STDERR_FILENO, &events, nullptr);
close(fd); close(fd);
CmdOnClose(agent->task); if (agent) {
CmdOnClose(agent->task);
}
} }
HWTEST_F(InnerkitsUnitTest, TestControlFdServer, TestSize.Level1) HWTEST_F(InnerkitsUnitTest, TestControlFdServer, TestSize.Level1)
...@@ -361,7 +363,7 @@ HWTEST_F(InnerkitsUnitTest, TestControlFdServer, TestSize.Level1) ...@@ -361,7 +363,7 @@ HWTEST_F(InnerkitsUnitTest, TestControlFdServer, TestSize.Level1)
UNUSED(context); UNUSED(context);
}, LE_GetDefaultLoop()); }, LE_GetDefaultLoop());
TaskHandle testServer; TaskHandle testServer = NULL;
LE_StreamServerInfo info = {}; LE_StreamServerInfo info = {};
info.baseInfo.flags = TASK_STREAM | TASK_SERVER | TASK_PIPE | TASK_TEST; info.baseInfo.flags = TASK_STREAM | TASK_SERVER | TASK_PIPE | TASK_TEST;
info.server = (char *)"/data/testSock1"; info.server = (char *)"/data/testSock1";
...@@ -432,7 +434,7 @@ HWTEST_F(InnerkitsUnitTest, TestHoldFd2, TestSize.Level1) ...@@ -432,7 +434,7 @@ HWTEST_F(InnerkitsUnitTest, TestHoldFd2, TestSize.Level1)
int *fds = nullptr; int *fds = nullptr;
char buffer[MAX_FD_HOLDER_BUFFER + 1] = {}; char buffer[MAX_FD_HOLDER_BUFFER + 1] = {};
pid_t requestPid = -1; pid_t requestPid = -1;
struct msghdr msghdr; struct msghdr msghdr = {};
GetFdsFromMsg(&fdCount, &requestPid, msghdr); GetFdsFromMsg(&fdCount, &requestPid, msghdr);
msghdr.msg_flags = MSG_TRUNC; msghdr.msg_flags = MSG_TRUNC;
GetFdsFromMsg(&fdCount, &requestPid, msghdr); GetFdsFromMsg(&fdCount, &requestPid, msghdr);
......
...@@ -83,63 +83,6 @@ HWTEST_F(ModuleMgrUnitTest, PluginAddCmd, TestSize.Level1) ...@@ -83,63 +83,6 @@ HWTEST_F(ModuleMgrUnitTest, PluginAddCmd, TestSize.Level1)
RemoveCmdExecutor("testCmd4", cmdExecId4); RemoveCmdExecutor("testCmd4", cmdExecId4);
} }
HWTEST_F(ModuleMgrUnitTest, ModuleInstallTest, TestSize.Level1)
{
int ret;
int cnt;
// Create module manager
ASSERT_EQ(ModuleMgrCreate(nullptr), nullptr);
ModuleMgrDestroy(nullptr);
MODULE_MGR *moduleMgr = ModuleMgrCreate("init");
ASSERT_NE(moduleMgr, nullptr);
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 0);
// Install one module
#ifdef SUPPORT_64BIT
ret = ModuleMgrInstall(moduleMgr, "/system/lib64/init/libbootchart", 0, NULL);
#else
ret = ModuleMgrInstall(moduleMgr, "/system/lib/init/libbootchart", 0, NULL);
#endif
ASSERT_EQ(ret, 0);
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 1);
// Uninstall the module
ModuleMgrUninstall(moduleMgr, "bootchart");
InitModuleMgrUnInstall("bootchart");
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 0);
// Install two module
ret = ModuleMgrInstall(moduleMgr, "bootchart", 0, NULL);
ASSERT_EQ(ret, 0);
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 1);
ret = ModuleMgrInstall(moduleMgr, "notexist", 0, NULL);
ASSERT_NE(ret, 0);
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 1);
// Uninstall the module
ModuleMgrUninstall(moduleMgr, "bootchart");
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 0);
ModuleMgrUninstall(moduleMgr, "notexist");
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 0);
ModuleMgrDestroy(moduleMgr);
// test updater mode
int fd = open("/bin/updater", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, S_IRWXU);
ASSERT_NE(fd, 0);
ModuleMgrScan("init/autorun");
unlink("/bin/updater");
close(fd);
}
static void TestModuleDump(const MODULE_INFO *moduleInfo) static void TestModuleDump(const MODULE_INFO *moduleInfo)
{ {
printf("%s\n", moduleInfo->name); printf("%s\n", moduleInfo->name);
...@@ -176,31 +119,4 @@ HWTEST_F(ModuleMgrUnitTest, ModuleTraversalTest, TestSize.Level1) ...@@ -176,31 +119,4 @@ HWTEST_F(ModuleMgrUnitTest, ModuleTraversalTest, TestSize.Level1)
ModuleMgrGetArgs(); ModuleMgrGetArgs();
ModuleMgrDestroy(moduleMgr); ModuleMgrDestroy(moduleMgr);
} }
HWTEST_F(ModuleMgrUnitTest, ModuleScanTest, TestSize.Level1)
{
// Scan all modules test init
MODULE_MGR *moduleMgr = ModuleMgrScan("init");
ASSERT_NE(moduleMgr, nullptr);
int cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_GE(cnt, 1);
ModuleMgrUninstall(nullptr, nullptr);
ModuleMgrUninstall(moduleMgr, NULL);
cnt = ModuleMgrGetCnt(moduleMgr);
ASSERT_EQ(cnt, 0);
ModuleMgrDestroy(moduleMgr);
// scan /lib/init/
#ifdef SUPPORT_64BIT
moduleMgr = ModuleMgrScan("/lib64/init");
#else
moduleMgr = ModuleMgrScan("/lib/init");
#endif
ASSERT_NE(moduleMgr, nullptr);
ModuleMgrGetCnt(nullptr);
cnt = ModuleMgrGetCnt(moduleMgr);
ModuleMgrDestroy(moduleMgr);
EXPECT_EQ(InitModuleMgrInstall(nullptr), -1);
}
} // namespace init_ut } // namespace init_ut
...@@ -244,20 +244,6 @@ private: ...@@ -244,20 +244,6 @@ private:
ParamTaskPtr serverTask_ = NULL; ParamTaskPtr serverTask_ = NULL;
}; };
HWTEST_F(LoopEventUnittest, StreamTaskTest, TestSize.Level1)
{
LoopEventUnittest loopevtest = LoopEventUnittest();
loopevtest.CreateServerTask();
loopevtest.StreamTaskTest();
LE_StreamInfo streamInfo = {};
streamInfo.recvMessage = OnReceiveRequest;
streamInfo.baseInfo.flags = TASK_PIPE | TASK_CONNECT;
streamInfo.server = (char *)PIPE_NAME;
TaskHandle clientTaskHandlec = nullptr;
LE_CreateStreamClient(LE_GetDefaultLoop(), &clientTaskHandlec, &streamInfo);
EXPECT_NE(clientTaskHandlec, nullptr);
}
HWTEST_F(LoopEventUnittest, LeTaskTest, TestSize.Level1) HWTEST_F(LoopEventUnittest, LeTaskTest, TestSize.Level1)
{ {
LoopEventUnittest loopevtest = LoopEventUnittest(); LoopEventUnittest loopevtest = LoopEventUnittest();
......
...@@ -67,8 +67,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogFile, TestSize.Level1) ...@@ -67,8 +67,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogFile, TestSize.Level1)
{ {
DoBootchartStart(); DoBootchartStart();
FILE *log = fopen("/data/init_ut/ModulesTest.log", "w"); FILE *log = fopen("/data/init_ut/ModulesTest.log", "w");
BootchartLogFile(log, "/proc/stat"); if (log) {
if (log != NULL) { BootchartLogFile(log, "/proc/stat");
(void)fflush(log); (void)fflush(log);
(void)fclose(log); (void)fclose(log);
} }
...@@ -78,8 +78,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogProcessStat, TestSize.Level1) ...@@ -78,8 +78,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogProcessStat, TestSize.Level1)
{ {
FILE *log = fopen("/data/init_ut/ModulesTest.log", "w"); FILE *log = fopen("/data/init_ut/ModulesTest.log", "w");
pid_t selfPid = getpid(); pid_t selfPid = getpid();
BootchartLogProcessStat(log, selfPid);
if (log != NULL) { if (log != NULL) {
BootchartLogProcessStat(log, selfPid);
(void)fflush(log); (void)fflush(log);
(void)fclose(log); (void)fclose(log);
} }
...@@ -88,8 +88,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogProcessStat, TestSize.Level1) ...@@ -88,8 +88,8 @@ HWTEST_F(ModulesUnitTest, TestBootchartLogProcessStat, TestSize.Level1)
HWTEST_F(ModulesUnitTest, TestbootchartLogProcess, TestSize.Level1) HWTEST_F(ModulesUnitTest, TestbootchartLogProcess, TestSize.Level1)
{ {
FILE *log = fopen("/data/init_ut/ModulesTest.log", "w"); FILE *log = fopen("/data/init_ut/ModulesTest.log", "w");
bootchartLogProcess(log); if (log) {
if (log != NULL) { bootchartLogProcess(log);
(void)fflush(log); (void)fflush(log);
(void)fclose(log); (void)fclose(log);
} }
......
...@@ -213,6 +213,6 @@ HWTEST_F(ParamShellUnitTest, TestParamShellcmd2, TestSize.Level1) ...@@ -213,6 +213,6 @@ HWTEST_F(ParamShellUnitTest, TestParamShellcmd2, TestSize.Level1)
BShellEnvLoop(nullptr); BShellEnvLoop(nullptr);
BShellEnvErrString(GetShellHandle(), 1); BShellEnvErrString(GetShellHandle(), 1);
BShellEnvOutputResult(GetShellHandle(), 1); BShellEnvOutputResult(GetShellHandle(), 1);
demoExit();
} }
} // namespace init_ut } // namespace init_ut
...@@ -601,5 +601,5 @@ HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger6, TestSize.Level0) ...@@ -601,5 +601,5 @@ HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger6, TestSize.Level0)
{ {
TriggerUnitTest test; TriggerUnitTest test;
test.TestDumpTrigger(); test.TestDumpTrigger();
CloseTriggerWorkSpace();
} }
...@@ -282,8 +282,8 @@ HWTEST_F(SysparaUnitTest, parameterTest0013, TestSize.Level0) ...@@ -282,8 +282,8 @@ HWTEST_F(SysparaUnitTest, parameterTest0013, TestSize.Level0)
EXPECT_EQ(GetUintParameter("test.int.get", 0), 0); EXPECT_EQ(GetUintParameter("test.int.get", 0), 0);
EXPECT_EQ(GetIntParameter("test.uint.get", 0), TEST_VALUE); EXPECT_EQ(GetIntParameter("test.uint.get", 0), TEST_VALUE);
EXPECT_EQ(GetUintParameter("test.uint.get", 0), TEST_VALUE); EXPECT_EQ(GetUintParameter("test.uint.get", 0), TEST_VALUE);
EXPECT_EQ(GetIntParameter("test.int.default", 10), 10); //key not find,value = default EXPECT_EQ(GetIntParameter("test.int.default", 10), 10); // key not find,value = default
EXPECT_EQ(GetUintParameter("test.uint.default", 10), 10); //key not find,value = default EXPECT_EQ(GetUintParameter("test.uint.default", 10), 10); // key not find,value = default
EXPECT_EQ(IsValidParamValue(nullptr, 0), 0); EXPECT_EQ(IsValidParamValue(nullptr, 0), 0);
EXPECT_EQ(IsValidParamValue("testvalue", strlen("testvalue") + 1), 1); EXPECT_EQ(IsValidParamValue("testvalue", strlen("testvalue") + 1), 1);
EXPECT_EQ(StringToLL("0x11", &out), 0); EXPECT_EQ(StringToLL("0x11", &out), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册