未验证 提交 2cbf53ab 编写于 作者: O openharmony_ci 提交者: Gitee

!4513 hichecker,hidebug,faultlogger测试用例编号修改

Merge pull request !4513 from chenxuihui/master
...@@ -48,11 +48,11 @@ describe('HiCheckerTest', function () { ...@@ -48,11 +48,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest001 * @tc.name DFX_DFR_Hichecker_Interface_0100
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest001', 0, function () { it('DFX_DFR_Hichecker_Interface_0100', 0, function () {
console.info('HiCheckerTest001 start'); console.info('DFX_DFR_Hichecker_Interface_0100 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
let tmp = hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); let tmp = hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
console.log('add rule success!'); console.log('add rule success!');
...@@ -61,11 +61,11 @@ describe('HiCheckerTest', function () { ...@@ -61,11 +61,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest002 * @tc.name DFX_DFR_Hichecker_Interface_0500
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest002', 0, function () { it('DFX_DFR_Hichecker_Interface_0500', 0, function () {
console.info('HiCheckerTest002 start'); console.info('DFX_DFR_Hichecker_Interface_0500 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT);
hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG); hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!'); console.log('add rule success!');
...@@ -79,11 +79,11 @@ describe('HiCheckerTest', function () { ...@@ -79,11 +79,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest003 * @tc.name DFX_DFR_Hichecker_Interface_0200
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest003', 0, function () { it('DFX_DFR_Hichecker_Interface_0200', 0, function () {
console.info('HiCheckerTest003 start'); console.info('DFX_DFR_Hichecker_Interface_0200 start');
hichecker.addRule(-1); hichecker.addRule(-1);
console.log('add wrong rule!'); console.log('add wrong rule!');
expect(hichecker.contains(-1)).assertEqual(false); expect(hichecker.contains(-1)).assertEqual(false);
...@@ -97,11 +97,11 @@ describe('HiCheckerTest', function () { ...@@ -97,11 +97,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest004 * @tc.name DFX_DFR_Hichecker_Interface_1200
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest004', 0, function () { it('DFX_DFR_Hichecker_Interface_1200', 0, function () {
console.info('HiCheckerTest004 start'); console.info('DFX_DFR_Hichecker_Interface_1200 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
expect(hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS)).assertTrue(); expect(hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS)).assertTrue();
console.log('add rule success!'); console.log('add rule success!');
...@@ -111,11 +111,11 @@ describe('HiCheckerTest', function () { ...@@ -111,11 +111,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest005 * @tc.name DFX_DFR_Hichecker_Interface_0800
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest005', 0, function () { it('DFX_DFR_Hichecker_Interface_0800', 0, function () {
console.info('HiCheckerTest005 start'); console.info('DFX_DFR_Hichecker_Interface_0800 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT);
hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG); hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!'); console.log('add rule success!');
...@@ -128,11 +128,11 @@ describe('HiCheckerTest', function () { ...@@ -128,11 +128,11 @@ describe('HiCheckerTest', function () {
/** /**
* @tc.number * @tc.number
* @tc.name HiCheckerTest006 * @tc.name DFX_DFR_Hichecker_Interface_1300
* @tc.desc * @tc.desc
*/ */
it('HiCheckerTest006', 0, function () { it('DFX_DFR_Hichecker_Interface_1300', 0, function () {
console.info('HiCheckerTest006 start'); console.info('DFX_DFR_Hichecker_Interface_1300 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS | hichecker.RULE_CHECK_SLOW_EVENT);
hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG); hichecker.addRule(hichecker.RULE_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!'); console.log('add rule success!');
......
...@@ -20,60 +20,60 @@ export default function HidebugJsTest() { ...@@ -20,60 +20,60 @@ export default function HidebugJsTest() {
describe('HidebugJsTest', function () { describe('HidebugJsTest', function () {
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0001 * @tc.number : DFX_DFR_Hiprofiler_Interface_0600
* @tc.name : getNativeHeapSize * @tc.name : getNativeHeapSize
* @tc.desc : Get total native heap memory size * @tc.desc : Get total native heap memory size
*/ */
it('DFX_DFR_Hiprofiler_Interface_0001', 0, function() { it('DFX_DFR_Hiprofiler_Interface_0600', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0001 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0600 Test start*************');
try { try {
let heapSize = hidebug.getNativeHeapSize(); let heapSize = hidebug.getNativeHeapSize();
expect(heapSize>=BigInt(0)).assertTrue(); expect(heapSize>=BigInt(0)).assertTrue();
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0001 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0600 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0002 * @tc.number : DFX_DFR_Hiprofiler_Interface_0400
* @tc.name : getNativeHeapAllocatedSize * @tc.name : getNativeHeapAllocatedSize
* @tc.desc : Get Native heap memory allocation size. * @tc.desc : Get Native heap memory allocation size.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0002', 0, function() { it('DFX_DFR_Hiprofiler_Interface_0400', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0002 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0400 Test start*************');
try { try {
let heapAllocatedSize = hidebug.getNativeHeapAllocatedSize(); let heapAllocatedSize = hidebug.getNativeHeapAllocatedSize();
expect(heapAllocatedSize>=BigInt(0)).assertTrue(); expect(heapAllocatedSize>=BigInt(0)).assertTrue();
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0002 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0400 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0003 * @tc.number : DFX_DFR_Hiprofiler_Interface_0500
* @tc.name : getNativeHeapFreeSize * @tc.name : getNativeHeapFreeSize
* @tc.desc : Get Native heap memory free size * @tc.desc : Get Native heap memory free size
*/ */
it('DFX_DFR_Hiprofiler_Interface_0003', 0, function() { it('DFX_DFR_Hiprofiler_Interface_0500', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0003 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0500 Test start*************');
try { try {
let heapFreeSize = hidebug.getNativeHeapFreeSize(); let heapFreeSize = hidebug.getNativeHeapFreeSize();
expect(heapFreeSize>=BigInt(0)).assertTrue(); expect(heapFreeSize>=BigInt(0)).assertTrue();
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0003 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0500 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0004 * @tc.number : DFX_DFR_Hiprofiler_Interface_0800
* @tc.name : getPss * @tc.name : getPss
* @tc.desc : Get application process proportional set size memory information * @tc.desc : Get application process proportional set size memory information
*/ */
it('DFX_DFR_Hiprofiler_Interface_0004', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_0800', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0004 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test start*************');
try { try {
const times = 3; const times = 3;
let pssValue = BigInt(0); let pssValue = BigInt(0);
...@@ -87,17 +87,16 @@ describe('HidebugJsTest', function () { ...@@ -87,17 +87,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0004 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0005 * @tc.number : DFX_DFR_Hiprofiler_Interface_1200
* @tc.name : getSharedDirty * @tc.name : getSharedDirty
* @tc.desc : Obtains the size of the shared dirty memory of a process. * @tc.desc : Obtains the size of the shared dirty memory of a process.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0005', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_1200', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0005 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test start*************');
try { try {
let dirty = hidebug.getSharedDirty(); let dirty = hidebug.getSharedDirty();
let temp = hidebug.getSharedDirty(); let temp = hidebug.getSharedDirty();
...@@ -105,17 +104,16 @@ describe('HidebugJsTest', function () { ...@@ -105,17 +104,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0005 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0006 * @tc.number : DFX_DFR_Hiprofiler_Interface_1600
* @tc.name : startProfiling with normal parameter * @tc.name : startProfiling with normal parameter
* @tc.desc : Start CPU Profiling. * @tc.desc : Start CPU Profiling.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0006', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_1600', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0006 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test start*************');
try { try {
let timestamp = Date.now(); let timestamp = Date.now();
let filename = 'cpuprofiler-' + timestamp.toString(); let filename = 'cpuprofiler-' + timestamp.toString();
...@@ -129,17 +127,16 @@ describe('HidebugJsTest', function () { ...@@ -129,17 +127,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0006 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0007 * @tc.number : DFX_DFR_Hiprofiler_Interface_1500
* @tc.name : startProfiling repeatedly * @tc.name : startProfiling repeatedly
* @tc.desc : Start CPU Profiling. * @tc.desc : Start CPU Profiling.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0007', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_1500', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0007 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test start*************');
try { try {
let path1 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-111.json' let path1 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-111.json'
let path2 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-222.json' let path2 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-222.json'
...@@ -157,17 +154,16 @@ describe('HidebugJsTest', function () { ...@@ -157,17 +154,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0007 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0008 * @tc.number : DFX_DFR_Hiprofiler_Interface_1400
* @tc.name : startProfiling with empty parameter * @tc.name : startProfiling with empty parameter
* @tc.desc : Start CPU Profiling. * @tc.desc : Start CPU Profiling.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0008', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_1400', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0008 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json' let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
try { try {
fileio.accessSync(path, 0); fileio.accessSync(path, 0);
...@@ -185,17 +181,16 @@ describe('HidebugJsTest', function () { ...@@ -185,17 +181,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0008 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0009 * @tc.number : DFX_DFR_Hiprofiler_Interface_1300
* @tc.name : startProfiling with overlong parameter * @tc.name : startProfiling with overlong parameter
* @tc.desc : Start CPU Profiling. * @tc.desc : Start CPU Profiling.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0009', 0, async function (done) { it('cDFX_DFR_Hiprofiler_Interface_1300', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0009 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json' let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
try { try {
fileio.accessSync(path, 0); fileio.accessSync(path, 0);
...@@ -217,17 +212,16 @@ describe('HidebugJsTest', function () { ...@@ -217,17 +212,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0009 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0010 * @tc.number : DFX_DFR_Hiprofiler_Interface_0300
* @tc.name : dumpHeapData with normal parameter * @tc.name : dumpHeapData with normal parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot. * @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0010', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_0300', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0010 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test start*************');
try { try {
let timestamp = Date.now(); let timestamp = Date.now();
let filename = 'heap-' + timestamp.toString(); let filename = 'heap-' + timestamp.toString();
...@@ -239,17 +233,16 @@ describe('HidebugJsTest', function () { ...@@ -239,17 +233,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0010 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0011 * @tc.number : DFX_DFR_Hiprofiler_Interface_0200
* @tc.name : dumpHeapData with empty parameter * @tc.name : dumpHeapData with empty parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot. * @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0011', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_0200', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0011 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot' let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
try { try {
fileio.accessSync(path, 0); fileio.accessSync(path, 0);
...@@ -265,17 +258,16 @@ describe('HidebugJsTest', function () { ...@@ -265,17 +258,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0011 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0012 * @tc.number : DFX_DFR_Hiprofiler_Interface_0100
* @tc.name : dumpHeapData with overlog parameter * @tc.name : dumpHeapData with overlog parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot. * @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/ */
it('DFX_DFR_Hiprofiler_Interface_0012', 0, async function (done) { it('DFX_DFR_Hiprofiler_Interface_0100', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0012 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot' let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
try { try {
fileio.accessSync(path, 0); fileio.accessSync(path, 0);
...@@ -295,33 +287,32 @@ describe('HidebugJsTest', function () { ...@@ -295,33 +287,32 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0012 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test end*************');
done();
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0013 * @tc.number : DFX_DFR_Hiprofiler_Interface_0700
* @tc.name : getPrivateDirty * @tc.name : getPrivateDirty
* @tc.desc : Get the size of the private dirty memory * @tc.desc : Get the size of the private dirty memory
*/ */
it('DFX_DFR_Hiprofiler_Interface_0013', 0, function() { it('DFX_DFR_Hiprofiler_Interface_0700', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0013 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0700 Test start*************');
try { try {
let temp = hidebug.getPrivateDirty(); let temp = hidebug.getPrivateDirty();
expect(temp>=BigInt(0)).assertTrue(); expect(temp>=BigInt(0)).assertTrue();
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0013 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0700 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0014 * @tc.number : DFX_DFR_Hiprofiler_Interface_1700
* @tc.name : getCpuUsage * @tc.name : getCpuUsage
* @tc.desc : Get the cpu usage of a process * @tc.desc : Get the cpu usage of a process
*/ */
it('DFX_DFR_Hiprofiler_Interface_0014', 0, function() { it('DFX_DFR_Hiprofiler_Interface_1700', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0014 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1700 Test start*************');
try { try {
let temp = -1; let temp = -1;
for(let i=0;i<=101;i++){ for(let i=0;i<=101;i++){
...@@ -336,16 +327,16 @@ describe('HidebugJsTest', function () { ...@@ -336,16 +327,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0014 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1700 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0015 * @tc.number : DFX_DFR_Hiprofiler_Interface_1100
* @tc.name : getServiceDump with normal parameter * @tc.name : getServiceDump with normal parameter
* @tc.desc : getServiceDump * @tc.desc : getServiceDump
*/ */
it('DFX_DFR_Hiprofiler_Interface_0015', 0, function() { it('DFX_DFR_Hiprofiler_Interface_1100', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0015 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1100 Test start*************');
try { try {
let temp = hidebug.getServiceDump(10); let temp = hidebug.getServiceDump(10);
console.info("ServiceDump is " + temp); console.info("ServiceDump is " + temp);
...@@ -353,16 +344,16 @@ describe('HidebugJsTest', function () { ...@@ -353,16 +344,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0015 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1100 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0016 * @tc.number : DFX_DFR_Hiprofiler_Interface_0900
* @tc.name : getServiceDump with abnormal parameter * @tc.name : getServiceDump with abnormal parameter
* @tc.desc : getServiceDump * @tc.desc : getServiceDump
*/ */
it('DFX_DFR_Hiprofiler_Interface_0016', 0, function() { it('DFX_DFR_Hiprofiler_Interface_0900', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0016 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0900 Test start*************');
try { try {
let temp = hidebug.getServiceDump(-1); let temp = hidebug.getServiceDump(-1);
console.info("ServiceDump is " + temp); console.info("ServiceDump is " + temp);
...@@ -370,16 +361,16 @@ describe('HidebugJsTest', function () { ...@@ -370,16 +361,16 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0016 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_0900 Test end*************');
}); });
/* /*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0017 * @tc.number : DFX_DFR_Hiprofiler_Interface_1000
* @tc.name : getServiceDump with overlog parameter * @tc.name : getServiceDump with overlog parameter
* @tc.desc : getServiceDump * @tc.desc : getServiceDump
*/ */
it('DFX_DFR_Hiprofiler_Interface_0017', 0, function() { it('DFX_DFR_Hiprofiler_Interface_1000', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0017 Test start*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1000 Test start*************');
try { try {
let temp = hidebug.getServiceDump(9007199254740993); let temp = hidebug.getServiceDump(9007199254740993);
console.info("ServiceDump is " + temp); console.info("ServiceDump is " + temp);
...@@ -387,7 +378,7 @@ describe('HidebugJsTest', function () { ...@@ -387,7 +378,7 @@ describe('HidebugJsTest', function () {
} catch (error) { } catch (error) {
expect().assertFail(); expect().assertFail();
} }
console.log('************* DFX_DFR_Hiprofiler_Interface_0017 Test end*************'); console.log('************* DFX_DFR_Hiprofiler_Interface_1000 Test end*************');
}); });
}) })
......
...@@ -44,24 +44,24 @@ describe("FaultlogJsTest", function () { ...@@ -44,24 +44,24 @@ describe("FaultlogJsTest", function () {
/** /**
* test * test
* *
* @tc.name: FaultlogJsException_001 * @tc.name: DFX_DFR_Faultlogger_Interface_0200
* @tc.desc: 检验函数参数输入错误时程序是否会崩溃 * @tc.desc: 检验函数参数输入错误时程序是否会崩溃
* @tc.require: AR000GICT2 * @tc.require: AR000GICT2
* @tc.author: * @tc.author:
*/ */
it('FaultlogJsException_001', 0, async function (done) { it('DFX_DFR_Faultlogger_Interface_0200', 0, async function (done) {
console.info("---------------------------FaultlogJsException_001----------------------------------"); console.info("---------------------------DFX_DFR_Faultlogger_Interface_0200----------------------------------");
try { try {
let ret1 = faultlogger.querySelfFaultLog("faultloggertestsummary01"); let ret1 = faultlogger.querySelfFaultLog("faultloggertestsummary01");
console.info("FaultlogJsException_001 ret1 == " + ret1); console.info("DFX_DFR_Faultlogger_Interface_0200 ret1 == " + ret1);
expect(ret1).assertEqual(undefined); expect(ret1).assertEqual(undefined);
let ret2 = faultlogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH, "faultloggertestsummary01"); let ret2 = faultlogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH, "faultloggertestsummary01");
console.info("FaultlogJsException_001 ret2 == " + ret2); console.info("DFX_DFR_Faultlogger_Interface_0200 ret2 == " + ret2);
expect(ret2).assertEqual(undefined); expect(ret2).assertEqual(undefined);
let ret3 = faultlogger.querySelfFaultLog(); let ret3 = faultlogger.querySelfFaultLog();
console.info("FaultlogJsException_001 ret3 == " + ret3); console.info("DFX_DFR_Faultlogger_Interface_0200 ret3 == " + ret3);
expect(ret3).assertEqual(undefined); expect(ret3).assertEqual(undefined);
done(); done();
return; return;
...@@ -76,34 +76,34 @@ describe("FaultlogJsTest", function () { ...@@ -76,34 +76,34 @@ describe("FaultlogJsTest", function () {
/** /**
* test * test
* *
* @tc.name: FaultlogJsTest_002 * @tc.name: DFX_DFR_Faultlogger_Interface_0400
* @tc.desc: 检验promise同步方式获取faultlog CPP_CRASH日志 * @tc.desc: 检验promise同步方式获取faultlog CPP_CRASH日志
* @tc.require: AR000GICT2 * @tc.require: AR000GICT2
* @tc.author: * @tc.author:
*/ */
it('FaultlogJsTest_002', 0, async function (done) { it('DFX_DFR_Faultlogger_Interface_0400', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_002----------------------------------"); console.info("---------------------------DFX_DFR_Faultlogger_Interface_0400----------------------------------");
try { try {
let now = Date.now(); let now = Date.now();
console.info("FaultlogJsTest_002 2 + " + now); console.info("DFX_DFR_Faultlogger_Interface_0400 2 + " + now);
let module = "ohos.faultloggerjs.test"; let module = "ohos.faultloggerjs.test";
const loopTimes = 10; const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_002 3 + " + i + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0400 3 + " + i + "----------");
faultlogger.addFaultLog(i - 400, faultlogger.addFaultLog(i - 400,
faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary02 " + i); faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary02 " + i);
await msleep(300); await msleep(300);
} }
await msleep(1000); await msleep(1000);
console.info("--------FaultlogJsTest_002 4" + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0400 4" + "----------");
let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.CPP_CRASH); let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.CPP_CRASH);
console.info("FaultlogJsTest_002 ret == " + ret.length); console.info("DFX_DFR_Faultlogger_Interface_0400 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes); expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary02 " + i + " fullLog.length " + ret[i].fullLog.length); console.info("faultloggertestsummary02 " + i + " fullLog.length " + ret[i].fullLog.length);
if (ret[i].fullLog.indexOf("faultloggertestsummary02 " + (loopTimes - 1 - i)) != -1) { if (ret[i].fullLog.indexOf("faultloggertestsummary02 " + (loopTimes - 1 - i)) != -1) {
console.info("FaultlogJsTest_002 " + ret[i].fullLog.length); console.info("DFX_DFR_Faultlogger_Interface_0400 " + ret[i].fullLog.length);
expect(typeof(ret[i].pid) == "number").assertTrue(); expect(typeof(ret[i].pid) == "number").assertTrue();
expect(typeof(ret[i].uid) == "number").assertTrue(); expect(typeof(ret[i].uid) == "number").assertTrue();
expect(typeof(ret[i].type) == "number").assertTrue(); expect(typeof(ret[i].type) == "number").assertTrue();
...@@ -118,16 +118,16 @@ describe("FaultlogJsTest", function () { ...@@ -118,16 +118,16 @@ describe("FaultlogJsTest", function () {
} }
} }
console.info("--------FaultlogJsTest_002 5" + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0400 5" + "----------");
ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.NO_SPECIFIC); ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.NO_SPECIFIC);
console.info("FaultlogJsTest_002 ret == " + ret.length); console.info("DFX_DFR_Faultlogger_Interface_0400 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes); expect(ret.length).assertEqual(loopTimes);
done(); done();
return; return;
} catch (err) { } catch (err) {
console.info("catch (err) == " + err); console.info("catch (err) == " + err);
} }
console.info("FaultlogJsTest_002 error"); console.info("DFX_DFR_Faultlogger_Interface_0400 error");
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) })
...@@ -135,16 +135,16 @@ describe("FaultlogJsTest", function () { ...@@ -135,16 +135,16 @@ describe("FaultlogJsTest", function () {
/** /**
* test * test
* *
* @tc.name: FaultlogJsTest_003 * @tc.name: DFX_DFR_Faultlogger_Interface_0500
* @tc.desc: 检验promise同步方式获取faultlog JS_CRASH日志 * @tc.desc: 检验promise同步方式获取faultlog JS_CRASH日志
* @tc.require: AR000GICT2 * @tc.require: AR000GICT2
* @tc.author: * @tc.author:
*/ */
it('FaultlogJsTest_003', 0, async function (done) { it('DFX_DFR_Faultlogger_Interface_0500', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_003----------------------------------"); console.info("---------------------------DFX_DFR_Faultlogger_Interface_0500----------------------------------");
try { try {
let now = Date.now(); let now = Date.now();
console.info("FaultlogJsTest_003 2 + " + now); console.info("DFX_DFR_Faultlogger_Interface_0500 2 + " + now);
const loopTimes = 2; const loopTimes = 2;
let i = 0; let i = 0;
let pro = new Promise( let pro = new Promise(
...@@ -156,7 +156,7 @@ describe("FaultlogJsTest", function () { ...@@ -156,7 +156,7 @@ describe("FaultlogJsTest", function () {
r("done!") r("done!")
return return
} }
console.info("--------FaultlogJsTest_003 3 + " + i + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0500 3 + " + i + "----------");
++i; ++i;
let dataStr = ["1", "2"] let dataStr = ["1", "2"]
console.info(dataStr[2].test); console.info(dataStr[2].test);
...@@ -166,9 +166,9 @@ describe("FaultlogJsTest", function () { ...@@ -166,9 +166,9 @@ describe("FaultlogJsTest", function () {
await pro; await pro;
await msleep(1000); await msleep(1000);
console.info("--------FaultlogJsTest_003 4" + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0500 4" + "----------");
let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH); let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH);
console.info("FaultlogJsTest_003 ret == " + ret.length); console.info("DFX_DFR_Faultlogger_Interface_0500 ret == " + ret.length);
if (ret.length > 0) { if (ret.length > 0) {
expect(true).assertTrue(); expect(true).assertTrue();
} else { } else {
...@@ -182,7 +182,7 @@ describe("FaultlogJsTest", function () { ...@@ -182,7 +182,7 @@ describe("FaultlogJsTest", function () {
} catch (err) { } catch (err) {
console.info("catch (err) == " + err); console.info("catch (err) == " + err);
} }
console.info("FaultlogJsTest_003 error"); console.info("DFX_DFR_Faultlogger_Interface_0500 error");
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) })
...@@ -190,34 +190,34 @@ describe("FaultlogJsTest", function () { ...@@ -190,34 +190,34 @@ describe("FaultlogJsTest", function () {
/** /**
* test * test
* *
* @tc.name: FaultlogJsTest_004 * @tc.name: DFX_DFR_Faultlogger_Interface_0300
* @tc.desc: 检验promise同步方式获取faultlog APP_FREEZE日志 * @tc.desc: 检验promise同步方式获取faultlog APP_FREEZE日志
* @tc.require: AR000GICT2 * @tc.require: AR000GICT2
* @tc.author: * @tc.author:
*/ */
it('FaultlogJsTest_004', 0, async function (done) { it('DFX_DFR_Faultlogger_Interface_0300', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_004----------------------------------"); console.info("---------------------------DFX_DFR_Faultlogger_Interface_0300----------------------------------");
try { try {
let now = Date.now(); let now = Date.now();
console.info("FaultlogJsTest_004 2 + " + now); console.info("DFX_DFR_Faultlogger_Interface_0300 2 + " + now);
let module = "ohos.faultloggerjs.test"; let module = "ohos.faultloggerjs.test";
const loopTimes = 10; const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_004 3 + " + i + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0300 3 + " + i + "----------");
faultlogger.addFaultLog(i - 200, faultlogger.addFaultLog(i - 200,
faultlogger.FaultType.APP_FREEZE, module, "faultloggertestsummary04 " + i); faultlogger.FaultType.APP_FREEZE, module, "faultloggertestsummary04 " + i);
await msleep(300); await msleep(300);
} }
await msleep(1000); await msleep(1000);
console.info("--------FaultlogJsTest_004 4" + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0300 4" + "----------");
let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.APP_FREEZE); let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.APP_FREEZE);
console.info("FaultlogJsTest_004 ret == " + ret.length); console.info("DFX_DFR_Faultlogger_Interface_0300 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes); expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary04 " + i + " fullLog.length " + ret[i].fullLog.length); console.info("faultloggertestsummary04 " + i + " fullLog.length " + ret[i].fullLog.length);
if (ret[i].fullLog.indexOf("faultloggertestsummary04 " + (loopTimes - 1 - i)) != -1) { if (ret[i].fullLog.indexOf("faultloggertestsummary04 " + (loopTimes - 1 - i)) != -1) {
console.info("FaultlogJsTest_004 " + ret[i].fullLog.length); console.info("DFX_DFR_Faultlogger_Interface_0300 " + ret[i].fullLog.length);
expect(true).assertTrue(); expect(true).assertTrue();
} else { } else {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -228,7 +228,7 @@ describe("FaultlogJsTest", function () { ...@@ -228,7 +228,7 @@ describe("FaultlogJsTest", function () {
} catch (err) { } catch (err) {
console.info("catch (err) == " + err); console.info("catch (err) == " + err);
} }
console.info("FaultlogJsTest_004 error"); console.info("DFX_DFR_Faultlogger_Interface_0300 error");
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) })
...@@ -236,37 +236,37 @@ describe("FaultlogJsTest", function () { ...@@ -236,37 +236,37 @@ describe("FaultlogJsTest", function () {
/** /**
* test * test
* *
* @tc.name: FaultlogJsTest_005 * @tc.name: DFX_DFR_Faultlogger_Interface_0100
* @tc.desc: 检验通过回调方式获取faultlog日志 * @tc.desc: 检验通过回调方式获取faultlog日志
* @tc.require: AR000GICT2 * @tc.require: AR000GICT2
* @tc.author: * @tc.author:
*/ */
it('FaultlogJsTest_005', 0, async function (done) { it('DFX_DFR_Faultlogger_Interface_0100', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_005----------------------------------"); console.info("---------------------------DFX_DFR_Faultlogger_Interface_0100----------------------------------");
try { try {
let now = Date.now(); let now = Date.now();
console.info("FaultlogJsTest_005 start + " + now); console.info("DFX_DFR_Faultlogger_Interface_0100 start + " + now);
let module = "ohos.faultloggerjs.test"; let module = "ohos.faultloggerjs.test";
const loopTimes = 10; const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_005 + " + i + "----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0100 + " + i + "----------");
faultlogger.addFaultLog(i - 100, faultlogger.addFaultLog(i - 100,
faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary05 " + i); faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary05 " + i);
await msleep(300); await msleep(300);
} }
await msleep(1000); await msleep(1000);
console.info("--------FaultlogJsTest_005 4----------"); console.info("--------DFX_DFR_Faultlogger_Interface_0100 4----------");
function queryFaultLogCallback(error, ret) { function queryFaultLogCallback(error, ret) {
if (error) { if (error) {
console.info('FaultlogJsTest_005 once error is ' + error); console.info('DFX_DFR_Faultlogger_Interface_0100 once error is ' + error);
} else { } else {
console.info("FaultlogJsTest_005 ret == " + ret.length); console.info("DFX_DFR_Faultlogger_Interface_0100 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes); expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) { for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary05 " + i + " fullLog.length " + ret[i].fullLog.length); console.info("faultloggertestsummary05 " + i + " fullLog.length " + ret[i].fullLog.length);
if (ret[i].fullLog.indexOf("faultloggertestsummary05 " + (loopTimes - 1 - i)) != -1) { if (ret[i].fullLog.indexOf("faultloggertestsummary05 " + (loopTimes - 1 - i)) != -1) {
console.info("FaultlogJsTest_005 " + ret[i].fullLog.length); console.info("DFX_DFR_Faultlogger_Interface_0100 " + ret[i].fullLog.length);
expect(true).assertTrue(); expect(true).assertTrue();
} else { } else {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -280,7 +280,7 @@ describe("FaultlogJsTest", function () { ...@@ -280,7 +280,7 @@ describe("FaultlogJsTest", function () {
} catch (err) { } catch (err) {
console.info(err); console.info(err);
} }
console.info("FaultlogJsTest_005 error"); console.info("DFX_DFR_Faultlogger_Interface_0100 error");
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册