Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
04bd26e0
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看板
提交
04bd26e0
编写于
3月 17, 2022
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:ut用例问题
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
76dc5f3c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
2 deletion
+18
-2
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+2
-0
test/unittest/init/service_socket_unittest.cpp
test/unittest/init/service_socket_unittest.cpp
+3
-1
test/unittest/param/watcher_agent_unittest.cpp
test/unittest/param/watcher_agent_unittest.cpp
+9
-1
test/unittest/param/watcher_proxy_unittest.cpp
test/unittest/param/watcher_proxy_unittest.cpp
+4
-0
未找到文件。
test/unittest/BUILD.gn
浏览文件 @
04bd26e0
...
...
@@ -182,6 +182,8 @@ ohos_unittest("init_ut") {
]
defines = [
"READ_CHECK",
"PARAM_SUPPORT_DAC_CHECK",
"INIT_AGENT",
"STARTUP_INIT_TEST",
"PARAM_SUPPORT_SAVE_PERSIST",
...
...
test/unittest/init/service_socket_unittest.cpp
浏览文件 @
04bd26e0
...
...
@@ -38,7 +38,9 @@ HWTEST_F(ServiceSocketUnitTest, TestCreateSocket, TestSize.Level0)
ASSERT_NE
(
service
,
nullptr
);
ServiceSocket
*
sockopt
=
(
ServiceSocket
*
)
calloc
(
1
,
sizeof
(
ServiceSocket
)
+
strlen
(
testSocName
)
+
1
);
ASSERT_NE
(
sockopt
,
nullptr
);
sockopt
->
type
=
SOCK_SEQPACKET
;
sockopt
->
type
=
SOCK_STREAM
;
sockopt
->
protocol
=
0
;
sockopt
->
family
=
PF_UNIX
;
sockopt
->
sockFd
=
-
1
;
sockopt
->
uid
=
1000
;
sockopt
->
gid
=
1000
;
...
...
test/unittest/param/watcher_agent_unittest.cpp
浏览文件 @
04bd26e0
...
...
@@ -23,6 +23,7 @@
#include "iwatcher_manager.h"
#include "message_parcel.h"
#include "param_utils.h"
#include "param_request.h"
#include "sys_param.h"
#include "system_ability_definition.h"
#include "watcher.h"
...
...
@@ -43,7 +44,14 @@ public:
WatcherAgentUnitTest
()
{}
virtual
~
WatcherAgentUnitTest
()
{}
void
SetUp
()
{}
void
SetUp
()
{
ParamWorkSpace
*
space
=
GetClientParamWorkSpace
();
if
(
space
!=
nullptr
&&
space
->
securityLabel
!=
nullptr
)
{
space
->
securityLabel
->
cred
.
uid
=
1000
;
// 1000 test uid
space
->
securityLabel
->
cred
.
gid
=
1000
;
// 1000 test gid
}
}
void
TearDown
()
{}
void
TestBody
()
{}
...
...
test/unittest/param/watcher_proxy_unittest.cpp
浏览文件 @
04bd26e0
...
...
@@ -68,6 +68,7 @@ public:
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
sptr
<
IWatcher
>
watcher
=
new
TestWatcher
();
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
...
...
@@ -87,6 +88,7 @@ public:
MessageParcel
data
;
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
DEL_WATCHER
,
data
,
reply
,
option
);
...
...
@@ -138,6 +140,8 @@ public:
MessageParcel
data
;
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
sptr
<
IWatcher
>
watcher
=
new
TestWatcher
();
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录