From 4a540be37e1627557c821eb3e27bed19116dc0c1 Mon Sep 17 00:00:00 2001 From: chenxuihui Date: Mon, 6 Feb 2023 15:33:56 +0800 Subject: [PATCH] =?UTF-8?q?DFX=203.1Release=E5=88=86=E6=94=AF=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenxuihui --- .../main/js/default/test/HiChecker.test.js | 24 ++++++++++++------- .../main/js/default/test/faultlogger.test.js | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/default/test/HiChecker.test.js b/hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/default/test/HiChecker.test.js index 76288c23d..1f0aea7eb 100644 --- a/hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/default/test/HiChecker.test.js +++ b/hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/default/test/HiChecker.test.js @@ -86,15 +86,21 @@ describe('HiCheckerTest', function () { */ it('HiCheckerTest003', 0, async function (done) { console.info('HiCheckerTest003 start'); - hichecker.addRule(-1); - console.log('add wrong rule!'); - expect(hichecker.contains(-1)).assertEqual(false); - hichecker.addRule(0); - console.log('add wrong rule!'); - expect(hichecker.contains(0)).assertEqual(false); - hichecker.addRule(999999); - console.log('add wrong rule!'); - expect(hichecker.contains(-1)).assertEqual(false); + hichecker.addRule(1n); + console.log('add right rule!'); + expect(hichecker.contains(1n)).assertEqual(true); + try { + hichecker.addRule(0n); + } catch(e) { + console.log('add wrong rule!'); + expect(hichecker.contains(0n)).assertEqual(false); + } + try { + hichecker.addRule(999999n); + } catch(e) { + console.log('add wrong rule!'); + expect(hichecker.contains(999999n)).assertEqual(false); + } done(); }) diff --git a/hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/default/test/faultlogger.test.js b/hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/default/test/faultlogger.test.js index 87647c8b9..0b21f697d 100755 --- a/hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/default/test/faultlogger.test.js +++ b/hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/default/test/faultlogger.test.js @@ -110,7 +110,7 @@ describe("FaultlogJsTest", function () { expect(typeof(ret[i].module) == "string").assertTrue(); expect(typeof(ret[i].summary) == "string").assertTrue(); expect(typeof(ret[i].fullLog) == "string").assertTrue(); - expect(typeof(ret[i].timestamp) == "number").assertTrue(); + expect(typeof(ret[i].ts) == "number").assertTrue(); expect(true).assertTrue(); } else { expect(false).assertTrue(); -- GitLab