• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
16import hilog from "@ohos.hilog";
17export default function HilogJsTest() {
18  describe("HilogJsTest", () => {
19    beforeAll(() => {
20      console.info("beforeAll called");
21    });
22
23    afterAll(() => {
24      console.info("afterAll called");
25    });
26
27    /**
28     * @tc.number: TEST_HILOG_DEBUG_001
29     * @tc.name  : testHilogDebug001
30     * @tc.desc  : hilog begin interface test.
31     * @tc.size  : MediumTest
32     * @tc.type  : Method
33     * @tc.level : Level 2
34     */
35    it("testHilogDebug001", 2, () => {
36      console.info("testHilogDebug001 start");
37      try {
38        hilog.debug(0x3200, "HILOGTEST", "%{public}s", "hilogJs1800");
39        expect(true).assertTrue();
40      } catch (error) {
41        console.log(`testHilogDebug001 got an error: ${JSON.stringify(error)}`);
42        expect().assertFail();
43      }
44      console.info("testHilogDebug001 end");
45    });
46
47    /**
48     * @tc.number: TEST_HILOG_DEBUG_002
49     * @tc.name  : testHilogDebug002
50     * @tc.desc  : hilog begin interface test.
51     * @tc.size  : MediumTest
52     * @tc.type  : Method
53     * @tc.level : Level 2
54     */
55    it("testHilogDebug002", 2, () => {
56      console.info("testHilogDebug002 start");
57      try {
58        hilog.debug(0x3200, "HILOGTEST", "%{public}d", 2.1);
59        expect(true).assertTrue();
60      } catch (error) {
61        console.log(`testHilogDebug002 got an error: ${JSON.stringify(error)}`);
62        expect().assertFail();
63      }
64      console.info("testHilogDebug002 end");
65    });
66
67    /**
68     * @tc.number: TEST_HILOG_DEBUG_003
69     * @tc.name  : testHilogDebug003
70     * @tc.desc  : hilog begin interface test.
71     * @tc.size  : MediumTest
72     * @tc.type  : Method
73     * @tc.level : Level 2
74     */
75    it("testHilogDebug003", 2, () => {
76      console.info("testHilogDebug003 start");
77      try {
78        hilog.debug(0x3200, "HILOGTEST", "%{public}d", 65535);
79        expect(true).assertTrue();
80      } catch (error) {
81        console.log(`testHilogDebug003 got an error: ${JSON.stringify(error)}`);
82        expect().assertFail();
83      }
84      console.info("testHilogDebug003 end");
85    });
86
87    /**
88     * @tc.number: TEST_HILOG_DEBUG_004
89     * @tc.name  : testHilogDebug004
90     * @tc.desc  : hilog begin interface test.
91     * @tc.size  : MediumTest
92     * @tc.type  : Method
93     * @tc.level : Level 2
94     */
95    it("testHilogDebug004", 2, () => {
96      console.info("testHilogDebug004 start");
97      try {
98        hilog.debug(0x3200, "HILOGTEST", "%{public}s", "hilog info");
99        expect(true).assertTrue();
100      } catch (error) {
101        console.log(`testHilogDebug004 got an error: ${JSON.stringify(error)}`);
102        expect().assertFail();
103      }
104      console.info("testHilogDebug004 end");
105    });
106
107    /**
108     * @tc.number: TEST_HILOG_DEBUG_005
109     * @tc.name  : testHilogDebug005
110     * @tc.desc  : hilog begin interface test.
111     * @tc.size  : MediumTest
112     * @tc.type  : Method
113     * @tc.level : Level 2
114     */
115    it("testHilogDebug005", 2, () => {
116      console.info("testHilogDebug005 start");
117      try {
118        hilog.debug(0x3200, "HILOGTEST", "%{public}d", 2147483647);
119        expect(true).assertTrue();
120      } catch (error) {
121        console.log(`testHilogDebug005 got an error: ${JSON.stringify(error)}`);
122        expect().assertFail();
123      }
124      console.info("testHilogDebug005 end");
125    });
126
127    /**
128     * @tc.number: TEST_HILOG_DEBUG_006
129     * @tc.name  : testHilogDebug006
130     * @tc.desc  : hilog begin interface test.
131     * @tc.size  : MediumTest
132     * @tc.type  : Method
133     * @tc.level : Level 2
134     */
135    it("testHilogDebug006", 2, () => {
136      console.info("testHilogDebug006 start");
137      try {
138        hilog.debug(0x3200, "HILOGTEST", "%{public}s", "100%s%d%x%f");
139        expect(true).assertTrue();
140      } catch (error) {
141        console.log(`testHilogDebug006 got an error: ${JSON.stringify(error)}`);
142        expect().assertFail();
143      }
144      console.info("testHilogDebug006 end");
145    });
146
147    /**
148     * @tc.number: TEST_HILOG_DEBUG_007
149     * @tc.name  : testHilogDebug007
150     * @tc.desc  : hilog begin interface test.
151     * @tc.size  : MediumTest
152     * @tc.type  : Method
153     * @tc.level : Level 2
154     */
155    it("testHilogDebug007", 2, () => {
156      console.info("testHilogDebug007 start");
157      try {
158        hilog.debug(0x3200, "HILOGTEST", "%{public}s", "65536");
159        expect(true).assertTrue();
160      } catch (error) {
161        console.log(`testHilogDebug007 got an error: ${JSON.stringify(error)}`);
162        expect().assertFail();
163      }
164      console.info("testHilogDebug007 end");
165    });
166
167    /**
168     * @tc.number: TEST_HILOG_DEBUG_008
169     * @tc.name  : testHilogDebug008
170     * @tc.desc  : hilog begin interface test.
171     * @tc.size  : MediumTest
172     * @tc.type  : Method
173     * @tc.level : Level 2
174     */
175    it("testHilogDebug008", 2, () => {
176      console.info("testHilogDebug008 start");
177      try {
178        hilog.debug(0x3200, "HILOGTEST", "username:%{public}s, password:%{private}s.", "username", "password");
179        expect(true).assertTrue();
180        hilog.debug(0x3200, "HILOGTEST", "username:%{public}s, password:%s.", "username123", "password");
181        expect(true).assertTrue();
182      } catch (error) {
183        console.log(`testHilogDebug008 got an error: ${JSON.stringify(error)}`);
184        expect().assertFail();
185      }
186      console.info("testHilogDebug008 end");
187    });
188
189    /**
190     * @tc.number: TEST_HILOG_DEBUG_009
191     * @tc.name  : testHilogDebug009
192     * @tc.desc  : hilog begin interface test.
193     * @tc.size  : MediumTest
194     * @tc.type  : Method
195     * @tc.level : Level 2
196     */
197    it("testHilogDebug009", 2, () => {
198      console.info("testHilogDebug009 start");
199      try {
200        hilog.debug(0x3200, "HILOGTEST", "%{public}s", "hilog public");
201        expect(true).assertTrue();
202      } catch (error) {
203        console.log(`testHilogDebug009 got an error: ${JSON.stringify(error)}`);
204        expect().assertFail();
205      }
206      console.info("testHilogDebug009 end");
207    });
208
209    /**
210     * @tc.number: TEST_HILOG_DEBUG_010
211     * @tc.name  : testHilogDebug010
212     * @tc.desc  : hilog begin interface test.
213     * @tc.size  : MediumTest
214     * @tc.type  : Method
215     * @tc.level : Level 2
216     */
217    it("testHilogDebug010", 2, () => {
218      console.info("testHilogDebug010 start");
219      try {
220        hilog.debug(0x3200, "HILOGTEST", "%{nopublic}s", "Hilogtest");
221        expect(true).assertTrue();
222      } catch (error) {
223        console.log(`testHilogDebug010 got an error: ${JSON.stringify(error)}`);
224        expect().assertFail();
225      }
226      console.info("testHilogDebug010 end");
227    });
228
229    /**
230     * @tc.number: TEST_HILOG_INFO_001
231     * @tc.name  : testHilogInfo001
232     * @tc.desc  : hilog begin interface test.
233     * @tc.size  : MediumTest
234     * @tc.type  : Method
235     * @tc.level : Level 2
236     */
237    it("testHilogInfo001", 2, () => {
238      console.info("testHilogInfo001 start");
239      try {
240        hilog.info(0x3200, "HILOGTEST", "%{public}s", "hilogJs0400");
241        expect(true).assertTrue();
242      } catch (error) {
243        console.log(`testHilogInfo001 got an error: ${JSON.stringify(error)}`);
244        expect().assertFail();
245      }
246      console.info("testHilogInfo001 end");
247    });
248
249    /**
250     * @tc.number: TEST_HILOG_INFO_002
251     * @tc.name  : testHilogInfo002
252     * @tc.desc  : hilog begin interface test.
253     * @tc.size  : MediumTest
254     * @tc.type  : Method
255     * @tc.level : Level 2
256     */
257    it("testHilogInfo002", 2, () => {
258      console.info("testHilogInfo002 start");
259      try {
260        hilog.info(0x3200, "HILOGTEST", "username:%{public}s, password:%{private}s.", "username", "password");
261        expect(true).assertTrue();
262        hilog.info(0x3200, "HILOGTEST", "username:%{public}s, password:%s.", "username123", "password");
263        expect(true).assertTrue();
264      } catch (error) {
265        console.log(`testHilogInfo002 got an error: ${JSON.stringify(error)}`);
266        expect().assertFail();
267      }
268      console.info("testHilogInfo002 end");
269    });
270
271    /**
272     * @tc.number: TEST_HILOG_INFO_003
273     * @tc.name  : testHilogInfo003
274     * @tc.desc  : hilog begin interface test.
275     * @tc.size  : MediumTest
276     * @tc.type  : Method
277     * @tc.level : Level 2
278     */
279    it("testHilogInfo003", 2, () => {
280      console.info("testHilogInfo003 start");
281      try {
282        hilog.info(0xffff, "HILOGTEST", "username:%{public}s, password:%{public}s.", "username", "password");
283        expect(true).assertTrue();
284      } catch (error) {
285        console.log(`testHilogInfo003 got an error: ${JSON.stringify(error)}`);
286        expect().assertFail();
287      }
288      console.info("testHilogInfo003 end");
289    });
290
291    /**
292     * @tc.number: TEST_HILOG_INFO_004
293     * @tc.name  : testHilogInfo004
294     * @tc.desc  : hilog begin interface test.
295     * @tc.size  : MediumTest
296     * @tc.type  : Method
297     * @tc.level : Level 2
298     */
299    it("testHilogInfo004", 2, () => {
300      console.info("testHilogInfo004 start");
301      try {
302        hilog.info(0xfffe, "HILOGTEST", "username:%{public}s, password:%{public}s.", "username", "password");
303        expect(true).assertTrue();
304      } catch (error) {
305        console.log(`testHilogInfo004 got an error: ${JSON.stringify(error)}`);
306        expect().assertFail();
307      }
308      console.info("testHilogInfo004 end");
309    });
310
311    /**
312     * @tc.number: TEST_HILOG_INFO_005
313     * @tc.name  : testHilogInfo005
314     * @tc.desc  : hilog begin interface test.
315     * @tc.size  : MediumTest
316     * @tc.type  : Method
317     * @tc.level : Level 2
318     */
319    it("testHilogInfo005", 2, () => {
320      console.info("testHilogInfo005 start");
321      try {
322        hilog.info(0xfffff, "HILOGTEST", "username:%{public}s, password:%{public}s.", "username", "password");
323        expect(true).assertTrue();
324      } catch (error) {
325        console.log(`testHilogInfo005 got an error: ${JSON.stringify(error)}`);
326        expect().assertFail();
327      }
328      console.info("testHilogInfo005 end");
329    });
330
331    /**
332     * @tc.number: TEST_HILOG_INFO_006
333     * @tc.name  : testHilogInfo006
334     * @tc.desc  : hilog begin interface test.
335     * @tc.size  : MediumTest
336     * @tc.type  : Method
337     * @tc.level : Level 2
338     */
339    it("testHilogInfo006", 2, () => {
340      console.info("testHilogInfo006 start");
341      try {
342        hilog.info(0xffffe, "HILOGTEST", "username:%{public}s, password:%{public}s.", "username", "password");
343        expect(true).assertTrue();
344      } catch (error) {
345        console.log(`testHilogInfo006 got an error: ${JSON.stringify(error)}`);
346        expect().assertFail();
347      }
348      console.info("testHilogInfo006 end");
349    });
350
351    /**
352     * @tc.number: TEST_HILOG_INFO_007
353     * @tc.name  : testHilogInfo007
354     * @tc.desc  : hilog begin interface test.
355     * @tc.size  : MediumTest
356     * @tc.type  : Method
357     * @tc.level : Level 2
358     */
359    it("testHilogInfo007", 2, () => {
360      console.info("testHilogInfo007 start");
361      try {
362        hilog.info(100, "HILOGTEST", "username:%{public}s, password:%{public}s.", "username", "password");
363        expect(true).assertTrue();
364      } catch (error) {
365        console.log(`testHilogInfo007 got an error: ${JSON.stringify(error)}`);
366        expect().assertFail();
367      }
368      console.info("testHilogInfo007 end");
369    });
370
371    /**
372     * @tc.number: TEST_HILOG_INFO_009
373     * @tc.name  : testHilogInfo009
374     * @tc.desc  : hilog begin interface test.
375     * @tc.size  : MediumTest
376     * @tc.type  : Method
377     * @tc.level : Level 2
378     */
379    it("testHilogInfo008", 2, () => {
380      console.info("testHilogInfo008 start");
381      try {
382        hilog.info(0x3200, "HILOGTEST", "username:%{public}s.", null);
383        expect(true).assertTrue();
384      } catch (error) {
385        console.log(`testHilogInfo008 got an error: ${JSON.stringify(error)}`);
386        expect().assertFail();
387      }
388      console.info("testHilogInfo008 end");
389    });
390
391    /**
392     * @tc.number: TEST_HILOG_INFO_009
393     * @tc.name  : testHilogInfo009
394     * @tc.desc  : hilog begin interface test.
395     * @tc.size  : MediumTest
396     * @tc.type  : Method
397     * @tc.level : Level 2
398     */
399    it("testHilogInfo009", 2, () => {
400      console.info("testHilogInfo009 start");
401      try {
402        hilog.info(0x3200, "HILOGTEST", "username:%{public}s.", undefined);
403        expect(true).assertTrue();
404      } catch (error) {
405        console.log(`testHilogInfo009 got an error: ${JSON.stringify(error)}`);
406        expect().assertFail();
407      }
408      console.info("testHilogInfo009 end");
409    });
410
411    /**
412     * @tc.number: TEST_HILOG_INFO_010
413     * @tc.name  : testHilogInfo010
414     * @tc.desc  : hilog begin interface test.
415     * @tc.size  : MediumTest
416     * @tc.type  : Method
417     * @tc.level : Level 2
418     */
419    it("testHilogInfo010", 2, () => {
420      console.info("testHilogInfo010 start");
421      try {
422        hilog.info(0x3200, "HILOGTEST", "MAX Number:%{public}d, MIN Number:%{public}d", Number.MAX_VALUE, Number.MIN_VALUE);
423        expect(true).assertTrue();
424      } catch (error) {
425        console.log(`testHilogInfo010 got an error: ${JSON.stringify(error)}`);
426        expect().assertFail();
427      }
428      console.info("testHilogInfo010 end");
429    });
430
431    /**
432     * @tc.number: TEST_HILOG_INFO_011
433     * @tc.name  : testHilogInfo011
434     * @tc.desc  : hilog begin interface test.
435     * @tc.size  : MediumTest
436     * @tc.type  : Method
437     * @tc.level : Level 2
438     */
439    it("testHilogInfo011", 2, () => {
440      console.info("testHilogInfo011 start");
441      try {
442        hilog.info(0x3200, "HILOGTEST", "���IJ���:%{public}s, ��ϴ�ӡ:%{public}s", "���Ĵ�ӡ����", "for����test,.;:*_-=^(%)?#$/|\\");
443        expect(true).assertTrue();
444      } catch (error) {
445        console.log(`testHilogInfo011 got an error: ${JSON.stringify(error)}`);
446        expect().assertFail();
447      }
448      console.info("testHilogInfo011 end");
449    });
450
451    /**
452     * @tc.number: TEST_HILOG_INFO_012
453     * @tc.name  : testHilogInfo012
454     * @tc.desc  : hilog begin interface test.
455     * @tc.size  : MediumTest
456     * @tc.type  : Method
457     * @tc.level : Level 2
458     */
459    it("testHilogInfo012", 2, () => {
460      console.info("testHilogInfo012 start");
461      try {
462        hilog.info(0x3200, "HILOGTEST", "boolean1:%{public}s, boolean2:%{public}s", true, false);
463        expect(true).assertTrue();
464      } catch (error) {
465        console.log(`testHilogInfo012 got an error: ${JSON.stringify(error)}`);
466        expect().assertFail();
467      }
468      console.info("testHilogInfo012 end");
469    });
470
471    /**
472     * @tc.number: TEST_HILOG_WARN_001
473     * @tc.name  : testHilogWarn001
474     * @tc.desc  : hilog begin interface test.
475     * @tc.size  : MediumTest
476     * @tc.type  : Method
477     * @tc.level : Level 2
478     */
479    it("testHilogWarn001", 2, () => {
480      console.info("testHilogWarn001 start");
481      try {
482        hilog.warn(0x3200, "HILOGTEST", "%{public}s", "hilogJs0500");
483        expect(true).assertTrue();
484      } catch (error) {
485        console.log(`testHilogWarn001 got an error: ${JSON.stringify(error)}`);
486        expect().assertFail();
487      }
488      console.info("testHilogWarn001 end");
489    });
490
491    /**
492     * @tc.number: TEST_HILOG_ERROR_001
493     * @tc.name  : testHilogError001
494     * @tc.desc  : hilog begin interface test.
495     * @tc.size  : MediumTest
496     * @tc.type  : Method
497     * @tc.level : Level 2
498     */
499    it("testHilogError001", 2, () => {
500      console.info("testHilogError001 start");
501      try {
502        hilog.error(0x3200, "HILOGTEST", "%{public}s", "hilogJs0200");
503        expect(true).assertTrue();
504      } catch (error) {
505        console.log(`testHilogError001 got an error: ${JSON.stringify(error)}`);
506        expect().assertFail();
507      }
508      console.info("testHilogError001 end");
509    });
510
511    /**
512     * @tc.number: TEST_HILOG_ERROR_002
513     * @tc.name  : testHilogError002
514     * @tc.desc  :The log tool can read valid app log types when domain on.
515     * @tc.size  : MediumTest
516     * @tc.type  : Method
517     * @tc.level : Level 2
518     */
519    it("testHilogError002", 2, () => {
520      console.info("testHilogError002 start");
521      try {
522        hilog.error(0xffff, "HILOGTEST", "%{public}s", ["hilogJs0100"]);
523        expect(true).assertTrue();
524      } catch (error) {
525        console.log(`testHilogError002 got an error: ${JSON.stringify(error)}`);
526        expect().assertFail();
527      }
528      console.info("testHilogError002 end");
529    });
530
531    /**
532     * @tc.number: TEST_HILOG_ERROR_003
533     * @tc.name  : testHilogError003
534     * @tc.desc  : The log tool can't read white app log types when domain on.
535     * @tc.size  : MediumTest
536     * @tc.type  : Method
537     * @tc.level : Level 2
538     */
539    it("testHilogError003", 2, () => {
540      console.info("testHilogError003 start");
541      try {
542        hilog.error(0xd003200, "HILOGTEST", "%{public}s", ["hilogJs0200"]);
543        expect(true).assertTrue();
544      } catch (error) {
545        console.log(`testHilogError003 got an error: ${JSON.stringify(error)}`);
546        expect().assertFail();
547      }
548      console.info("testHilogError003 end");
549    });
550
551    /**
552     * @tc.number: TEST_HILOG_ERROR_004
553     * @tc.name  : testHilogError004
554     * @tc.desc  : The log tool can read valid app log types when domain off.
555     * @tc.size  : MediumTest
556     * @tc.type  : Method
557     * @tc.level : Level 2
558     */
559    it("testHilogError004", 2, () => {
560      console.info("testHilogError004 start");
561      try {
562        hilog.error(0xffff, "HILOGTEST", "%{public}s", ["hilogJs0100"]);
563        expect(true).assertTrue();
564      } catch (error) {
565        console.log(`testHilogError004 got an error: ${JSON.stringify(error)}`);
566        expect().assertFail();
567      }
568      console.info("testHilogError004 end");
569    });
570
571    /**
572     * @tc.number: TEST_HILOG_ERROR_005
573     * @tc.name  : testHilogError005
574     * @tc.desc  : The log tool can read white app log types when domain off.
575     * @tc.size  : MediumTest
576     * @tc.type  : Method
577     * @tc.level : Level 2
578     */
579    it("testHilogError005", 2, () => {
580      console.info("testHilogError005 start");
581      try {
582        hilog.error(0xd003200, "HILOGTEST", "%{public}s", ["hilogJs0200"]);
583        expect(true).assertTrue();
584      } catch (error) {
585        console.log(`testHilogError005 got an error: ${JSON.stringify(error)}`);
586        expect().assertFail();
587      }
588      console.info("testHilogError005 end");
589    });
590
591    /**
592     * @tc.number: TEST_HILOG_FATAL_001
593     * @tc.name  : testHilogFatal001
594     * @tc.desc  : Print FATAL level logs
595     * @tc.size  : MediumTest
596     * @tc.type  : Method
597     * @tc.level : Level 2
598     */
599    it("testHilogFatal001", 2, () => {
600      console.info("testHilogFatal001 start");
601      try {
602        hilog.fatal(0x3200, "HILOGTEST", "%{public}s", "hilogJs0300");
603        expect(true).assertTrue();
604      } catch (error) {
605        console.log(`testHilogFatal001 got an error: ${JSON.stringify(error)}`);
606        expect().assertFail();
607      }
608      console.info("testHilogFatal001 end");
609    });
610
611    /**
612     * @tc.number: TEST_HILOG_IS_LOGGABLE_001
613     * @tc.name  : testHilogIsLoggable001
614     * @tc.desc  : hitrace begin interface test.
615     * @tc.size  : MediumTest
616     * @tc.type  : Method
617     * @tc.level : Level 2
618     */
619    it("testHilogIsLoggable001", 2, () => {
620      console.info("testHilogIsLoggable001 start");
621      const res = hilog.isLoggable(0x123456789, "HILOGTEST", 3);
622      expect(res).assertEqual(false);
623      console.info("testHilogIsLoggable001 end");
624    });
625
626    /**
627     * @tc.number: TEST_HILOG_IS_LOGGABLE_002
628     * @tc.name  : testHilogIsLoggable002
629     * @tc.desc  : hitrace begin interface test.
630     * @tc.size  : MediumTest
631     * @tc.type  : Method
632     * @tc.level : Level 2
633     */
634    it("testHilogIsLoggable002", 2, () => {
635      console.info("testHilogIsLoggable002 start");
636      const res = hilog.isLoggable(0x3200, "HILOGTEST", 6);
637      expect(res).assertEqual(true);
638      console.info("testHilogIsLoggable002 end");
639    });
640
641    /**
642     * @tc.number: TEST_HILOG_IS_LOGGABLE_003
643     * @tc.name  : testHilogIsLoggable003
644     * @tc.desc  : hitrace begin interface test.
645     * @tc.size  : MediumTest
646     * @tc.type  : Method
647     * @tc.level : Level 2
648     */
649    it("testHilogIsLoggable003", 2, () => {
650      console.info("testHilogIsLoggable003 start");
651      const res = hilog.isLoggable(0x3200, "HILOGTEST", 7);
652      expect(res).assertEqual(true);
653      console.info("testHilogIsLoggable003 end");
654    });
655
656    /**
657     * @tc.number: TEST_HILOG_IS_LOGGABLE_004
658     * @tc.name  : testHilogIsLoggable004
659     * @tc.desc  : hitrace begin interface test.
660     * @tc.size  : MediumTest
661     * @tc.type  : Method
662     * @tc.level : Level 2
663     */
664    it("testHilogIsLoggable004", 2, () => {
665      console.info("testHilogIsLoggable004 start");
666      const res = hilog.isLoggable(0x3200, "HILOGTEST", 4);
667      expect(res).assertEqual(true);
668      console.info("testHilogIsLoggable004 end");
669    });
670
671    /**
672     * @tc.number: TEST_HILOG_IS_LOGGABLE_005
673     * @tc.name  : testHilogIsLoggable005
674     * @tc.desc  : hitrace begin interface test.
675     * @tc.size  : MediumTest
676     * @tc.type  : Method
677     * @tc.level : Level 2
678     */
679    it("testHilogIsLoggable005", 2, () => {
680      console.info("testHilogIsLoggable005 start");
681      const res = hilog.isLoggable(0x3200, "HILOGTEST", 5);
682      expect(res).assertEqual(true);
683      console.info("testHilogIsLoggable005 end");
684    });
685
686    /**
687     * @tc.number: TEST_HILOG_IS_LOGGABLE_006
688     * @tc.name  : testHilogIsLoggable006
689     * @tc.desc  : hitrace begin interface test.
690     * @tc.size  : MediumTest
691     * @tc.type  : Method
692     * @tc.level : Level 2
693     */
694    it("testHilogIsLoggable006", 2, () => {
695      console.info("testHilogIsLoggable006 start");
696      const res = hilog.isLoggable(0x3200, "HILOGTEST", 100);
697      expect(res).assertEqual(false);
698      console.info("testHilogIsLoggable006 end");
699    });
700  });
701}
702