Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
94a80566
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
94a80566
编写于
11月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1457 添加新增接口ut
Merge pull request !1457 from Mupceet/add_new_interface_ut
上级
df5a6501
38faede1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
8 deletion
+27
-8
interfaces/innerkits/init_module_engine/include/init_module_engine.h
...innerkits/init_module_engine/include/init_module_engine.h
+0
-2
interfaces/innerkits/init_module_engine/stub/libinit.stub.json
...faces/innerkits/init_module_engine/stub/libinit.stub.json
+0
-1
services/param/manager/param_server.c
services/param/manager/param_server.c
+0
-5
test/unittest/innerkits/innerkits_unittest.cpp
test/unittest/innerkits/innerkits_unittest.cpp
+25
-0
test/unittest/param/param_stub.cpp
test/unittest/param/param_stub.cpp
+2
-0
未找到文件。
interfaces/innerkits/init_module_engine/include/init_module_engine.h
浏览文件 @
94a80566
...
...
@@ -34,8 +34,6 @@ int SystemWriteParam(const char *name, const char *value);
int
SystemReadParam
(
const
char
*
name
,
char
*
value
,
unsigned
int
*
len
);
int
LoadParamsFile
(
const
char
*
fileName
,
bool
onlyAdd
);
typedef
int
(
*
CmdExecutor
)(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
);
int
AddCmdExecutor
(
const
char
*
cmdName
,
CmdExecutor
execCmd
);
...
...
interfaces/innerkits/init_module_engine/stub/libinit.stub.json
浏览文件 @
94a80566
[
{
"name"
:
"SystemWriteParam"
},
{
"name"
:
"SystemReadParam"
},
{
"name"
:
"LoadParamsFile"
},
{
"name"
:
"SplitString"
},
{
"name"
:
"AddCmdExecutor"
},
{
"name"
:
"RemoveCmdExecutor"
},
...
...
services/param/manager/param_server.c
浏览文件 @
94a80566
...
...
@@ -193,11 +193,6 @@ static int ProcessParamFile(const char *fileName, void *context)
return
LoadDefaultParam_
(
fileName
,
mode
,
exclude
,
ARRAY_LENGTH
(
exclude
),
LoadOneParam_
);
}
int
LoadParamsFile
(
const
char
*
fileName
,
bool
onlyAdd
)
{
return
LoadDefaultParams
(
fileName
,
onlyAdd
?
LOAD_PARAM_ONLY_ADD
:
LOAD_PARAM_NORMAL
);
}
int
LoadDefaultParams
(
const
char
*
fileName
,
uint32_t
mode
)
{
PARAM_CHECK
(
fileName
!=
NULL
,
return
-
1
,
"Invalid filename for load"
);
...
...
test/unittest/innerkits/innerkits_unittest.cpp
浏览文件 @
94a80566
...
...
@@ -225,4 +225,29 @@ HWTEST_F(InnerkitsUnitTest, TestSysCap, TestSize.Level1)
ret
=
HasSystemCapability
(
"SystemCapability.ArkUI.ArkUI.Napi"
);
EXPECT_EQ
(
ret
,
true
);
}
// TestControlService
HWTEST_F
(
InnerkitsUnitTest
,
TestControlService
,
TestSize
.
Level1
)
{
ServiceControl
(
"deviceinfoservice"
,
START
);
ServiceControl
(
"deviceinfoservice"
,
STOP
);
ServiceControl
(
"deviceinfoservice"
,
RESTART
);
ServiceControl
(
"param_watcher"
,
RESTART
);
EXPECT_EQ
(
ServiceControl
(
nullptr
,
RESTART
),
-
1
);
const
char
*
argv
[]
=
{
"testArg"
};
ServiceControlWithExtra
(
"deviceinfoservice"
,
RESTART
,
argv
,
1
);
ServiceControlWithExtra
(
nullptr
,
RESTART
,
argv
,
1
);
ServiceControlWithExtra
(
nullptr
,
3
,
argv
,
1
);
// 3 is action
ServiceControlWithExtra
(
"notservie"
,
RESTART
,
argv
,
1
);
ServiceSetReady
(
"deviceinfoservice"
);
ServiceSetReady
(
nullptr
);
ServiceWaitForStatus
(
"deviceinfoservice"
,
SERVICE_READY
,
1
);
ServiceWaitForStatus
(
"deviceinfoservice"
,
SERVICE_READY
,
-
1
);
ServiceWaitForStatus
(
nullptr
,
SERVICE_READY
,
1
);
StartServiceByTimer
(
"deviceinfoservice"
,
1
);
StartServiceByTimer
(
"deviceinfoservice"
,
0
);
StartServiceByTimer
(
nullptr
,
0
);
StopServiceTimer
(
"deviceinfoservice"
);
}
}
// namespace init_ut
test/unittest/param/param_stub.cpp
浏览文件 @
94a80566
...
...
@@ -21,6 +21,7 @@
#include "param_security.h"
#include "param_utils.h"
#include "init_group_manager.h"
#include "beget_ext.h"
#ifdef PARAM_LOAD_CFG_FROM_CODE
#include "param_cfg.h"
#endif
...
...
@@ -443,6 +444,7 @@ int TestFreeLocalSecurityLabel(ParamSecurityLabel *srcLabel)
static
__attribute__
((
constructor
(
101
)))
void
ParamTestStubInit
(
void
)
{
EnableInitLog
(
INIT_DEBUG
);
SetInitLogLevel
(
INIT_DEBUG
);
PARAM_LOGI
(
"ParamTestStubInit"
);
PrepareInitUnitTestEnv
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录