提交 90b27645 编写于 作者: 1 15929983503

hisysevent添加监听限制1018用例修改优化

Signed-off-by: N15929983503 <duanhaizhen@huawei.com>
上级 075c3a36
......@@ -539,9 +539,9 @@ describe('hiSysEventJsSecondTest', function () {
*/
it('testHiSysEventApi42', 3, async function (done) {
console.info('testHiSysEventApi42 start')
var watcher = []
try {
var watcher = []
for (var i = 0; i < 30; i++) {
for (var i = 0; i < 31; i++) {
watcher[i] = {
rules: [{
domain: "RELIABILITY" + i,
......@@ -555,19 +555,25 @@ describe('hiSysEventJsSecondTest', function () {
}
hiSysEvent.addWatcher(watcher[i])
}
setTimeout(() => {
var watcher = []
for (var i = 0; i < 30; i++) {
hiSysEvent.removeWatcher(watcher[i])
}
}, 5000)
done()
}catch (err) {
console.error(`testHiSysEventApi42 > error code: ${err.code}, error msg: ${err.message}`)
console.error(`testHiSysEventApi42 > addWatcher error code: ${err.code}, error msg: ${err.message}`)
expect(err.code == 11200101).assertTrue()
console.info('testHiSysEventApi42 end')
console.info('testHiSysEventApi42 addWatcher end')
done()
}
setTimeout(() => {
try {
for (var i = 0; i < 31; i++) {
hiSysEvent.removeWatcher(watcher[i])
}
}catch (err) {
console.error(`testHiSysEventApi42 > remove error code: ${err.code}, error msg: ${err.message}`)
expect(err.code == 11200201).assertTrue()
console.info('testHiSysEventApi42 remove end')
done()
}
}, 5000)
done()
})
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册