Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
de150e93
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
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看板
提交
de150e93
编写于
11月 29, 2021
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix codedex
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
9febfb7f
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
71 addition
and
30 deletion
+71
-30
services/param/adapter/param_persistadp.c
services/param/adapter/param_persistadp.c
+3
-3
services/param/adapter/param_selinux.c
services/param/adapter/param_selinux.c
+2
-2
services/param/client/param_request.c
services/param/client/param_request.c
+1
-1
services/param/cmd/param_cmd.c
services/param/cmd/param_cmd.c
+1
-1
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+1
-0
services/param/service/param_service.c
services/param/service/param_service.c
+5
-4
services/param/trigger/trigger_manager.c
services/param/trigger/trigger_manager.c
+14
-6
services/param/trigger/trigger_processor.c
services/param/trigger/trigger_processor.c
+1
-1
services/param/watcher/proxy/watcher_manager.h
services/param/watcher/proxy/watcher_manager.h
+4
-4
test/unittest/init/mount_unittest.cpp
test/unittest/init/mount_unittest.cpp
+1
-1
test/unittest/param/client_unittest.cpp
test/unittest/param/client_unittest.cpp
+6
-0
test/unittest/param/dac_unittest.cpp
test/unittest/param/dac_unittest.cpp
+5
-2
test/unittest/param/param_unittest.cpp
test/unittest/param/param_unittest.cpp
+4
-1
test/unittest/param/selinux_unittest.cpp
test/unittest/param/selinux_unittest.cpp
+6
-3
test/unittest/param/trigger_unittest.cpp
test/unittest/param/trigger_unittest.cpp
+17
-1
未找到文件。
services/param/adapter/param_persistadp.c
浏览文件 @
de150e93
...
...
@@ -50,10 +50,10 @@ static int LoadPersistParam(PersistParamGetPtr persistParamGet, void *context)
int
ret
=
persistParamGet
(
info
[
0
].
value
,
info
[
1
].
value
,
context
);
PARAM_CHECK
(
ret
==
0
,
continue
,
"Failed to set param %d %s"
,
ret
,
buff
);
}
if
(
info
)
{
if
(
info
!=
NULL
)
{
free
(
info
);
}
if
(
buff
)
{
if
(
buff
!=
NULL
)
{
free
(
buff
);
}
(
void
)
fclose
(
fp
);
...
...
@@ -107,4 +107,4 @@ int RegisterPersistParamOps(PersistParamOps *ops)
ops
->
batchSave
=
BatchSavePersistParam
;
ops
->
batchSaveEnd
=
BatchSavePersistParamEnd
;
return
0
;
}
}
\ No newline at end of file
services/param/adapter/param_selinux.c
浏览文件 @
de150e93
...
...
@@ -84,10 +84,10 @@ static int LoadParamLabels(const char *fileName, SecurityLabelFunc label, void *
PARAM_CHECK
(
ret
==
0
,
continue
,
"Failed to write param info %d %s"
,
ret
,
buff
);
infoCount
++
;
}
if
(
buff
)
{
if
(
buff
!=
NULL
)
{
free
(
buff
);
}
if
(
info
)
{
if
(
info
!=
NULL
)
{
free
(
info
);
}
(
void
)
fclose
(
fp
);
...
...
services/param/client/param_request.c
浏览文件 @
de150e93
...
...
@@ -184,7 +184,7 @@ int SystemSetParameter(const char *name, const char *value)
uint32_t
msgSize
=
sizeof
(
ParamMessage
)
+
sizeof
(
ParamMsgContent
)
+
PARAM_ALIGN
(
strlen
(
value
)
+
1
);
uint32_t
labelLen
=
0
;
ParamSecurityOps
*
ops
=
GetClientParamSecurityOps
();
if
(
NeedCheckParamPermission
(
name
))
{
if
(
NeedCheckParamPermission
(
name
)
==
1
)
{
ret
=
CheckParamPermission
(
&
g_clientSpace
.
paramSpace
,
g_clientSpace
.
paramSpace
.
securityLabel
,
name
,
DAC_WRITE
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Forbit to set parameter %s"
,
name
);
}
else
if
(
!
LABEL_IS_ALL_PERMITTED
(
g_clientSpace
.
paramSpace
.
securityLabel
))
{
// check local can check permissions
...
...
services/param/cmd/param_cmd.c
浏览文件 @
de150e93
...
...
@@ -168,7 +168,7 @@ int RunParamCommand(int argc, char *argv[])
}
for
(
size_t
i
=
0
;
i
<
sizeof
(
paramCmds
)
/
sizeof
(
paramCmds
[
0
]);
i
++
)
{
if
(
strcmp
(
argv
[
1
],
paramCmds
[
i
].
name
)
==
0
)
{
if
(
argv
[
1
]
!=
NULL
&&
strcmp
(
argv
[
1
],
paramCmds
[
i
].
name
)
==
0
)
{
if
(
argc
<
paramCmds
[
i
].
minArg
)
{
printf
(
"usage: %s
\n
"
,
paramCmds
[
i
].
help
);
return
0
;
...
...
services/param/manager/param_manager.c
浏览文件 @
de150e93
...
...
@@ -76,6 +76,7 @@ int InitParamWorkSpace(ParamWorkSpace *workSpace, int onlyRead)
void
CloseParamWorkSpace
(
ParamWorkSpace
*
workSpace
)
{
PARAM_CHECK
(
workSpace
!=
NULL
,
return
,
"Invalid workSpace"
);
CloseWorkSpace
(
&
workSpace
->
paramSpace
);
if
(
workSpace
->
paramSecurityOps
.
securityFreeLabel
!=
NULL
)
{
workSpace
->
paramSecurityOps
.
securityFreeLabel
(
workSpace
->
securityLabel
);
...
...
services/param/service/param_service.c
浏览文件 @
de150e93
...
...
@@ -494,7 +494,8 @@ static int OnIncomingConnect(const ParamTaskPtr server, uint32_t flags)
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to create client"
);
ParamWatcher
*
watcher
=
(
ParamWatcher
*
)
ParamGetTaskUserData
(
client
);
PARAM_CHECK
(
watcher
!=
NULL
,
return
-
1
,
"Failed to get watcher"
);
PARAM_CHECK
(
watcher
!=
NULL
,
ParamTaskClose
(
client
);
return
-
1
,
"Failed to get watcher"
);
ListInit
(
&
watcher
->
node
);
PARAM_TRIGGER_HEAD_INIT
(
watcher
->
triggerHead
);
ListAddTail
(
&
GetTriggerWorkSpace
()
->
waitList
,
&
watcher
->
node
);
...
...
@@ -547,7 +548,7 @@ static int LoadParamFromCmdLine(void)
};
char
*
data
=
ReadFileData
(
PARAM_CMD_LINE
);
PARAM_CHECK
(
data
!=
NULL
,
return
-
1
,
"Failed to read file %s"
,
PARAM_CMD_LINE
);
char
*
value
=
malloc
(
PARAM_CONST_VALUE_LEN_MAX
);
char
*
value
=
calloc
(
1
,
PARAM_CONST_VALUE_LEN_MAX
+
1
);
PARAM_CHECK
(
value
!=
NULL
,
free
(
data
);
return
-
1
,
"Failed to read file %s"
,
PARAM_CMD_LINE
);
...
...
@@ -556,11 +557,11 @@ static int LoadParamFromCmdLine(void)
if
(
ret
==
0
)
{
PARAM_LOGD
(
"Add param from cmdline %s %s"
,
cmdLines
[
i
],
value
);
ret
=
CheckParamName
(
cmdLines
[
i
],
0
);
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Invalid name %s"
,
cmdLines
[
i
]);
PARAM_CHECK
(
ret
==
0
,
break
,
"Invalid name %s"
,
cmdLines
[
i
]);
uint32_t
dataIndex
=
0
;
PARAM_LOGE
(
"**** cmdLines[%d] %s, value %s"
,
i
,
cmdLines
[
i
],
value
);
ret
=
WriteParam
(
&
g_paramWorkSpace
.
paramSpace
,
cmdLines
[
i
],
value
,
&
dataIndex
,
0
);
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to write param %s %s"
,
cmdLines
[
i
],
value
);
PARAM_CHECK
(
ret
==
0
,
break
,
"Failed to write param %s %s"
,
cmdLines
[
i
],
value
);
}
else
{
PARAM_LOGE
(
"Can not find arrt %s"
,
cmdLines
[
i
]);
}
...
...
services/param/trigger/trigger_manager.c
浏览文件 @
de150e93
...
...
@@ -29,7 +29,7 @@
int
AddCommand
(
TriggerNode
*
trigger
,
uint32_t
cmdKeyIndex
,
const
char
*
content
)
{
PARAM_CHECK
(
trigger
!=
NULL
,
return
-
1
,
"trigger is null"
);
PARAM_CHECK
(
trigger
!=
NULL
&&
trigger
->
triggerHead
!=
NULL
,
return
-
1
,
"trigger is null"
);
uint32_t
size
=
sizeof
(
CommandNode
);
size
+=
(
content
==
NULL
)
?
1
:
(
strlen
(
content
)
+
1
);
size
=
PARAM_ALIGN
(
size
);
...
...
@@ -109,7 +109,7 @@ void ClearTrigger(TriggerHeader *head)
{
PARAM_CHECK
(
head
!=
NULL
,
return
,
"head is null"
);
ListNode
*
node
=
head
->
triggerList
.
next
;
while
(
node
!=
&
head
->
triggerList
)
{
while
(
node
!=
&
head
->
triggerList
&&
node
!=
NULL
)
{
ListRemove
(
node
);
ListInit
(
node
);
TriggerNode
*
trigger
=
ListEntry
(
node
,
TriggerNode
,
node
);
...
...
@@ -121,20 +121,24 @@ void ClearTrigger(TriggerHeader *head)
void
FreeTrigger
(
TriggerNode
*
trigger
)
{
PARAM_CHECK
(
trigger
!=
NULL
&&
trigger
->
triggerHead
!=
NULL
,
return
,
"trigger is null"
);
PARAM_CHECK
(
trigger
!=
NULL
,
return
,
"trigger is null"
);
PARAM_LOGD
(
"FreeTrigger %s"
,
trigger
->
name
);
TriggerHeader
*
triggerHead
=
trigger
->
triggerHead
;
CommandNode
*
cmd
=
trigger
->
firstCmd
;
while
(
cmd
!=
NULL
)
{
CommandNode
*
next
=
cmd
->
next
;
free
(
cmd
);
triggerHead
->
cmdNodeCount
--
;
if
(
triggerHead
!=
NULL
)
{
triggerHead
->
cmdNodeCount
--
;
}
cmd
=
next
;
}
trigger
->
lastCmd
=
NULL
;
trigger
->
firstCmd
=
NULL
;
ListRemove
(
&
trigger
->
node
);
triggerHead
->
triggerCount
--
;
if
(
triggerHead
!=
NULL
)
{
triggerHead
->
triggerCount
--
;
}
// 如果在执行队列,从队列中移走
if
(
!
TRIGGER_IN_QUEUE
(
trigger
))
{
...
...
@@ -357,6 +361,7 @@ int CheckTrigger(TriggerWorkSpace *workSpace, int type,
int
MarkTriggerToParam
(
const
TriggerWorkSpace
*
workSpace
,
const
TriggerHeader
*
triggerHead
,
const
char
*
name
)
{
PARAM_CHECK
(
name
!=
NULL
,
return
0
,
"name is null"
);
int
ret
=
0
;
TriggerNode
*
trigger
=
GetNextTrigger
(
triggerHead
,
NULL
);
while
(
trigger
!=
NULL
)
{
...
...
@@ -445,6 +450,7 @@ void ClearWatcherTrigger(const ParamWatcher *watcher)
static
void
DumpTriggerQueue
(
const
TriggerWorkSpace
*
workSpace
,
int
index
)
{
const
int
maxCmd
=
1024
*
64
;
PARAM_CHECK
(
workSpace
!=
NULL
,
return
,
"Invalid workSpace "
);
TriggerNode
*
trigger
=
GetNextTrigger
(
&
workSpace
->
triggerHead
[
index
],
NULL
);
while
(
trigger
!=
NULL
)
{
...
...
@@ -454,11 +460,13 @@ static void DumpTriggerQueue(const TriggerWorkSpace *workSpace, int index)
printf
(
"trigger condition %s
\n
"
,
trigger
->
condition
);
}
int
count
=
0
;
CommandNode
*
cmd
=
GetNextCmdNode
(
trigger
,
NULL
);
while
(
cmd
!=
NULL
)
{
while
(
cmd
!=
NULL
&&
count
<
maxCmd
)
{
printf
(
"
\t
command name %s
\n
"
,
GetCmdKey
(
cmd
->
cmdKeyIndex
));
printf
(
"
\t
command args %s
\n
"
,
cmd
->
content
);
cmd
=
GetNextCmdNode
(
trigger
,
cmd
);
count
++
;
}
trigger
=
GetNextTrigger
(
&
workSpace
->
triggerHead
[
index
],
trigger
);
}
...
...
services/param/trigger/trigger_processor.c
浏览文件 @
de150e93
...
...
@@ -52,7 +52,7 @@ static void TestTimerCallback(ParamTaskPtr timer, void *context)
static
uint32_t
value
=
0
;
int
count
=
0
;
while
(
count
<
MAX_COUNT
)
{
int
wait
=
READ_DURATION
+
READ_DURATION
;
// 100ms
const
int
wait
=
READ_DURATION
+
READ_DURATION
;
// 100ms
sprintf_s
(
buffer
,
sizeof
(
buffer
),
"%u"
,
value
);
PARAM_LOGI
(
"set param name: %s, value %s"
,
TEST_PARAM_NAME
,
buffer
);
SystemWriteParam
(
TEST_PARAM_NAME
,
buffer
);
...
...
services/param/watcher/proxy/watcher_manager.h
浏览文件 @
de150e93
...
...
@@ -93,8 +93,8 @@ public:
watcher_
->
OnParamerterChange
(
name
,
value
);
#endif
}
ListNode
groupNode_
{
};
private:
ListNode
groupNode_
;
uint32_t
watcherId_
=
{
0
};
sptr
<
IWatcher
>
watcher_
;
WatcherGroupPtr
group_
{
nullptr
};
...
...
@@ -110,15 +110,15 @@ public:
void
AddWatcher
(
const
ParamWatcherPtr
&
watcher
);
void
ProcessParameterChange
(
const
std
::
string
&
name
,
const
std
::
string
&
value
);
const
std
::
string
GetKeyPrefix
()
const
std
::
string
GetKeyPrefix
()
const
{
return
keyPrefix_
;
}
bool
Emptry
()
bool
Emptry
()
const
{
return
ListEmpty
(
watchers_
);
}
uint32_t
GetGroupId
()
uint32_t
GetGroupId
()
const
{
return
groupId_
;
}
...
...
test/unittest/init/mount_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -38,7 +38,7 @@ HWTEST_F(MountUnitTest, TestMountRequriedPartitions, TestSize.Level0)
if
(
fstab
!=
NULL
)
{
int
ret
=
MountRequriedPartitions
(
fstab
);
EXPECT_EQ
(
ret
,
-
1
);
ReleaseFstab
(
fstab
)
;
ReleaseFstab
(
fstab
)
;
}
}
}
// namespace init_ut
test/unittest/param/client_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -41,6 +41,9 @@ static void ClientCheckParamValue(const char *name, const char *expectValue)
// 多线程测试
static
void
*
TestSendParamSetMsg
(
void
*
args
)
{
if
(
args
==
nullptr
)
{
return
nullptr
;
}
std
::
string
name
=
(
char
*
)
args
;
printf
(
"TestSendParamSetMsg name :
\'
%s
\'
\n
"
,
name
.
c_str
());
SystemSetParameter
(
name
.
c_str
(),
name
.
c_str
());
...
...
@@ -50,6 +53,9 @@ static void *TestSendParamSetMsg(void *args)
static
void
*
TestSendParamWaitMsg
(
void
*
args
)
{
if
(
args
==
nullptr
)
{
return
nullptr
;
}
std
::
string
name
=
"Wati."
;
name
=
name
+
(
char
*
)
args
;
printf
(
"TestSendParamWaitMsg name :
\'
%s
\'
\n
"
,
name
.
c_str
());
...
...
test/unittest/param/dac_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -171,6 +171,9 @@ public:
}
ParamSecurityLabel
*
tmp
=
nullptr
;
ret
=
clientParamSercurityOps
.
securityDecodeLabel
(
&
tmp
,
buffer
.
data
(),
buffer
.
size
());
if
(
label
==
nullptr
||
tmp
==
nullptr
)
{
return
-
1
;
}
EXPECT_EQ
(
ret
,
0
);
EXPECT_EQ
(
label
->
cred
.
gid
,
tmp
->
cred
.
gid
);
EXPECT_EQ
(
label
->
cred
.
uid
,
tmp
->
cred
.
uid
);
...
...
@@ -178,8 +181,8 @@ public:
}
private:
ParamSecurityOps
initParamSercurityOps
;
ParamSecurityOps
clientParamSercurityOps
;
ParamSecurityOps
initParamSercurityOps
{}
;
ParamSecurityOps
clientParamSercurityOps
{}
;
};
HWTEST_F
(
DacUnitTest
,
TestDacGetLabel
,
TestSize
.
Level0
)
...
...
test/unittest/param/param_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -116,6 +116,7 @@ public:
ParamSecruityNode
*
node
=
(
ParamSecruityNode
*
)
GetTrieNode
(
&
GetParamWorkSpace
()
->
paramSpace
,
labelIndex
);
if
(
paramNode
==
nullptr
||
node
==
nullptr
)
{
EXPECT_EQ
(
1
,
0
);
return
0
;
}
EXPECT_EQ
(
node
->
gid
,
auditData
.
dacData
.
gid
);
return
0
;
...
...
@@ -149,6 +150,7 @@ public:
ParamSecruityNode
*
node
=
(
ParamSecruityNode
*
)
GetTrieNode
(
&
GetParamWorkSpace
()
->
paramSpace
,
labelIndex
);
if
(
paramNode
==
nullptr
||
node
==
nullptr
)
{
EXPECT_EQ
(
1
,
0
);
return
0
;
}
EXPECT_EQ
((
int
)
node
->
gid
,
203
);
// 203 test gid
return
0
;
...
...
@@ -173,6 +175,7 @@ public:
ParamSecruityNode
*
node
=
(
ParamSecruityNode
*
)
GetTrieNode
(
&
GetParamWorkSpace
()
->
paramSpace
,
labelIndex
);
if
(
paramNode
==
nullptr
||
node
==
nullptr
)
{
EXPECT_EQ
(
1
,
0
);
return
0
;
}
EXPECT_EQ
(
node
->
gid
,
auditData
.
dacData
.
gid
);
return
0
;
...
...
@@ -371,7 +374,7 @@ public:
do
{
uint32_t
offset
=
0
;
int
ret
=
FillParamMsgContent
(
request
,
&
offset
,
PARAM_VALUE
,
value
,
strlen
(
value
));
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to fill value"
);
PARAM_CHECK
(
ret
==
0
,
break
,
"Failed to fill value"
);
ProcessMessage
((
const
ParamTaskPtr
)
g_worker
,
(
const
ParamMessage
*
)
request
);
}
while
(
0
);
free
(
request
);
...
...
test/unittest/param/selinux_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -222,6 +222,9 @@ public:
}
ParamSecurityLabel
*
tmp
=
nullptr
;
ret
=
clientParamSercurityOps
.
securityDecodeLabel
(
&
tmp
,
buffer
.
data
(),
buffer
.
size
());
if
(
tmp
==
nullptr
||
label
==
nullptr
)
{
return
-
1
;
}
EXPECT_EQ
(
ret
,
0
);
EXPECT_EQ
(
label
->
cred
.
gid
,
tmp
->
cred
.
gid
);
EXPECT_EQ
(
label
->
cred
.
uid
,
tmp
->
cred
.
uid
);
...
...
@@ -233,8 +236,8 @@ public:
}
private:
ParamSecurityOps
initParamSercurityOps
;
ParamSecurityOps
clientParamSercurityOps
;
ParamSecurityOps
initParamSercurityOps
{}
;
ParamSecurityOps
clientParamSercurityOps
{}
;
};
HWTEST_F
(
SelinuxUnitTest
,
TestSelinuxGetLabel
,
TestSize
.
Level0
)
...
...
@@ -278,7 +281,7 @@ HWTEST_F(SelinuxUnitTest, TestSeliniuxLabelEncode, TestSize.Level0)
{
SelinuxUnitTest
test
;
std
::
vector
<
char
>
buffer
;
ParamSecurityLabel
*
label
;
ParamSecurityLabel
*
=
nullptr
;
test
.
TestEncode
(
label
,
buffer
);
test
.
TestDecode
(
label
,
buffer
);
}
\ No newline at end of file
test/unittest/param/trigger_unittest.cpp
浏览文件 @
de150e93
...
...
@@ -128,6 +128,9 @@ public:
TriggerNode
*
node
=
AddTrigger
(
GetTriggerHeader
(
TRIGGER_BOOT
),
"init-later"
,
""
,
0
);
TriggerNode
*
trigger
=
GetTriggerByName
(
GetTriggerWorkSpace
(),
"init-later"
);
EXPECT_EQ
(
node
,
trigger
);
if
(
trigger
==
nullptr
)
{
return
-
1
;
}
EXPECT_EQ
(
strcmp
(
trigger
->
name
,
"init-later"
),
0
);
// add command
...
...
@@ -146,13 +149,17 @@ public:
TriggerNode
*
node
=
AddTrigger
(
GetTriggerHeader
(
TRIGGER_PARAM
),
triggerName
,
"test_param.000=1"
,
0
);
TriggerNode
*
trigger
=
GetTriggerByName
(
GetTriggerWorkSpace
(),
triggerName
);
EXPECT_EQ
(
trigger
,
node
);
if
(
trigger
==
nullptr
)
{
return
-
1
;
}
EXPECT_EQ
(
strcmp
(
trigger
->
name
,
triggerName
),
0
);
// add command
int
cmdIndex
=
0
;
GetMatchCmd
(
"reboot "
,
&
cmdIndex
);
int
ret
=
AddCommand
(
trigger
,
cmdIndex
,
nullptr
);
ret
|=
AddCommand
(
trigger
,
cmdIndex
,
"update: aaaaaaa"
);
EXPECT_EQ
(
ret
,
0
);
ret
=
AddCommand
(
trigger
,
cmdIndex
,
"update: aaaaaaa"
);
EXPECT_EQ
(
ret
,
0
);
return
0
;
}
...
...
@@ -392,6 +399,9 @@ public:
TriggerNode
*
node
=
AddTrigger
(
GetTriggerHeader
(
TRIGGER_PARAM
),
triggerName
,
buffer
,
0
);
TriggerNode
*
trigger
=
GetTriggerByName
(
GetTriggerWorkSpace
(),
triggerName
);
EXPECT_EQ
(
trigger
,
node
);
if
(
trigger
==
nullptr
)
{
return
-
1
;
}
const
uint32_t
cmdIndex
=
103
;
ret
=
AddCommand
(
trigger
,
cmdIndex
,
value
);
EXPECT_EQ
(
ret
,
0
);
...
...
@@ -423,6 +433,9 @@ public:
TriggerNode
*
node
=
AddTrigger
(
GetTriggerHeader
(
TRIGGER_PARAM
),
triggerName
,
buffer
,
0
);
TriggerNode
*
trigger
=
GetTriggerByName
(
GetTriggerWorkSpace
(),
triggerName
);
EXPECT_EQ
(
trigger
,
node
);
if
(
trigger
==
nullptr
)
{
return
-
1
;
}
const
uint32_t
cmdIndex
=
105
;
ret
=
AddCommand
(
trigger
,
cmdIndex
,
value
);
EXPECT_EQ
(
ret
,
0
);
...
...
@@ -457,6 +470,9 @@ public:
const
int
testCmdIndex
=
1105
;
int
ret
=
AddCommand
(
trigger
,
testCmdIndex
,
value
);
EXPECT_EQ
(
ret
,
0
);
if
(
trigger
==
nullptr
)
{
return
-
1
;
}
TRIGGER_SET_FLAG
(
trigger
,
TRIGGER_FLAGS_SUBTRIGGER
);
char
buffer
[
triggerBuffer
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录