Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
eb64e445
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
eb64e445
编写于
9月 10, 2021
作者:
S
sun_fan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove redundant comments, Change level to 0
Signed-off-by:
N
sun_fan
<
sun_fan1@hoperun.com
>
上级
5c8b04a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
37 deletion
+37
-37
services/test/unittest/common/cmd_func_test.cpp
services/test/unittest/common/cmd_func_test.cpp
+37
-37
未找到文件。
services/test/unittest/common/cmd_func_test.cpp
浏览文件 @
eb64e445
...
...
@@ -133,9 +133,9 @@ public:
** @tc.name: cmdFuncParseCmdTest_001
** @tc.desc: parse function, nullptr test
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_001
,
TestSize
.
Level
0
)
{
// do not crash
ParseCmdLine
(
nullptr
,
nullptr
);
...
...
@@ -145,9 +145,9 @@ HWTEST_F(StartupInitUTest, cmdFuncParseCmdTest_001, TestSize.Level1)
** @tc.name: cmdFuncParseCmdTest_002
** @tc.desc: parse function, invalid strings test
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_002
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_002
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -173,9 +173,9 @@ HWTEST_F(StartupInitUTest, cmdFuncParseCmdTest_002, TestSize.Level1)
** @tc.name: cmdFuncParseCmdTest_003
** @tc.desc: parse function, cmd content empty test
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_003
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_003
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -191,9 +191,9 @@ HWTEST_F(StartupInitUTest, cmdFuncParseCmdTest_003, TestSize.Level1)
** @tc.name: cmdFuncParseCmdTest_004
** @tc.desc: parse function, cmd content too long test
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_004
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_004
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -232,9 +232,9 @@ HWTEST_F(StartupInitUTest, cmdFuncParseCmdTest_004, TestSize.Level1)
** @tc.name: cmdFuncParseCmdTest_005
** @tc.desc: parse function, parse success test
** @tc.type: FUNC
** @tc.require:
AR000F733E
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_005
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncParseCmdTest_005
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -264,9 +264,9 @@ HWTEST_F(StartupInitUTest, cmdFuncParseCmdTest_005, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_001
** @tc.desc: do cmd function, nullptr test
** @tc.type: FUNC
** @tc.require:
AR000F733E
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_001
,
TestSize
.
Level
0
)
{
// do not crash here
DoCmd
(
nullptr
);
...
...
@@ -276,9 +276,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_001, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_002
** @tc.desc: do cmd function, do start fail test
** @tc.type: FUNC
** @tc.require:
AR000F733E
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_002
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_002
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -296,9 +296,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_002, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_003
** @tc.desc: do cmd function, do mkdir fail test
** @tc.type: FUNC
** @tc.require:
AR000F733E
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_003
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_003
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -342,9 +342,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_003, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_004
** @tc.desc: do cmd function, do chmod fail test
** @tc.type: FUNC
** @tc.require:
AR000F732P
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_004
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_004
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -399,9 +399,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_004, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_005
** @tc.desc: do cmd function, do chown fail test
** @tc.type: FUNC
** @tc.require:
AR000F732P
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_005
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_005
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -436,9 +436,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_005, TestSize.Level1)
** @tc.name: cmdFuncDoCmdTest_006
** @tc.desc: do cmd function, do success test
** @tc.type: FUNC
** @tc.require:
AR000F732P
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_006
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoCmdTest_006
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
...
...
@@ -504,9 +504,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoCmdTest_006, TestSize.Level1)
** @tc.name: cfgCheckStat_001
** @tc.desc: init.cfg file state check
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cfgCheckStat_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cfgCheckStat_001
,
TestSize
.
Level
0
)
{
struct
stat
fileStat
=
{
0
};
EXPECT_EQ
(
0
,
stat
(
CFG_FILE
.
c_str
(),
&
fileStat
));
...
...
@@ -769,9 +769,9 @@ static void CheckJobs(const cJSON* fileRoot)
** @tc.name: cfgCheckContent_001
** @tc.desc: init.cfg file content check
** @tc.type: FUNC
** @tc.require:
AR000F733F
** @tc.require:
**/
HWTEST_F
(
StartupInitUTest
,
cfgCheckContent_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cfgCheckContent_001
,
TestSize
.
Level
0
)
{
char
*
fileBuf
=
ReadFileToBuf
();
if
(
fileBuf
==
nullptr
)
{
...
...
@@ -795,7 +795,7 @@ HWTEST_F(StartupInitUTest, cfgCheckContent_001, TestSize.Level1)
* @tc.name: CreateIllegalCfg
* @tc.desc: Create illegal Config file for testing
* @tc.type: FUNC
* @tc.require:
AR000F861Q
* @tc.require:
*/
static
void
CreateIllegalCfg
()
{
...
...
@@ -819,9 +819,9 @@ static void CreateIllegalCfg()
* @tc.name: cmdFuncDoLoadCfgTest_001
* @tc.desc: parse function, parse success test
* @tc.type: FUNC
* @tc.require:
AR000F861Q
* @tc.require:
*/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_001
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
memset_s
(
&
curCmdLine
,
sizeof
(
curCmdLine
),
0
,
sizeof
(
curCmdLine
));
...
...
@@ -835,9 +835,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoLoadCfgTest_001, TestSize.Level1)
* @tc.name: cmdFuncDoLoadCfgTest_002
* @tc.desc: fstab.cfg file fail test
* @tc.type: FUNC
* @tc.require:
AR000F861Q
* @tc.require:
*/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_002
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_002
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
std
::
string
cmdStr
=
"loadcfg "
;
...
...
@@ -875,9 +875,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoLoadCfgTest_002, TestSize.Level1)
* @tc.name: cmdFuncDoLoadCfgTest_003
* @tc.desc: fstab.cfg file success test
* @tc.type: FUNC
* @tc.require:
AR000F861Q
* @tc.require:
*/
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_003
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdFuncDoLoadCfgTest_003
,
TestSize
.
Level
0
)
{
CmdLine
curCmdLine
;
std
::
string
cmdStr
=
"loadcfg "
;
...
...
@@ -924,9 +924,9 @@ HWTEST_F(StartupInitUTest, cmdFuncDoLoadCfgTest_003, TestSize.Level1)
* @tc.name: cmdJobTest_001
* @tc.desc: job functions test
* @tc.type: FUNC
* @tc.require:
AR000F733F
* @tc.require:
*/
HWTEST_F
(
StartupInitUTest
,
cmdJobTest_001
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdJobTest_001
,
TestSize
.
Level
0
)
{
// functions do not crash
ParseAllJobs
(
nullptr
);
...
...
@@ -946,9 +946,9 @@ HWTEST_F(StartupInitUTest, cmdJobTest_001, TestSize.Level1)
* @tc.name: cmdJobTest_002
* @tc.desc: job functions test
* @tc.type: FUNC
* @tc.require:
AR000F733F
* @tc.require:
*/
HWTEST_F
(
StartupInitUTest
,
cmdJobTest_002
,
TestSize
.
Level
1
)
HWTEST_F
(
StartupInitUTest
,
cmdJobTest_002
,
TestSize
.
Level
0
)
{
std
::
string
cfgJson
=
"{
\"
jobs
\"
:[{
\"
name
\"
:
\"
pre-init
\"
,
\"
cmds
\"
:[
\"
mkdir "
+
PRE_INIT_DIR
+
"
\"
]},{
\"
name
\"
:
\"
init
\"
,
\"
cmds
\"
:[
\"
mkdir "
+
INIT_DIR
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录