提交 fbe46ef1 编写于 作者: C chenxuihui

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

Signed-off-by: Nchenxuihui <chenxuhui2@huawei.com>
上级 e499b96b
......@@ -48,11 +48,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest001
* @tc.name DFX_DFR_Hichecker_Interface_0100
* @tc.desc
*/
it('HiCheckerTest001', 0, function () {
console.info('HiCheckerTest001 start');
it('DFX_DFR_Hichecker_Interface_0100', 0, function () {
console.info('DFX_DFR_Hichecker_Interface_0100 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
let tmp = hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
console.log('add rule success!');
......@@ -61,11 +61,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest002
* @tc.name DFX_DFR_Hichecker_Interface_0500
* @tc.desc
*/
it('HiCheckerTest002', 0, function () {
console.info('HiCheckerTest002 start');
it('DFX_DFR_Hichecker_Interface_0500', 0, function () {
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_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!');
......@@ -79,11 +79,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest003
* @tc.name DFX_DFR_Hichecker_Interface_0200
* @tc.desc
*/
it('HiCheckerTest003', 0, function () {
console.info('HiCheckerTest003 start');
it('DFX_DFR_Hichecker_Interface_0200', 0, function () {
console.info('DFX_DFR_Hichecker_Interface_0200 start');
hichecker.addRule(-1);
console.log('add wrong rule!');
expect(hichecker.contains(-1)).assertEqual(false);
......@@ -97,11 +97,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest004
* @tc.name DFX_DFR_Hichecker_Interface_1200
* @tc.desc
*/
it('HiCheckerTest004', 0, function () {
console.info('HiCheckerTest004 start');
it('DFX_DFR_Hichecker_Interface_1200', 0, function () {
console.info('DFX_DFR_Hichecker_Interface_1200 start');
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
expect(hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS)).assertTrue();
console.log('add rule success!');
......@@ -111,11 +111,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest005
* @tc.name DFX_DFR_Hichecker_Interface_0800
* @tc.desc
*/
it('HiCheckerTest005', 0, function () {
console.info('HiCheckerTest005 start');
it('DFX_DFR_Hichecker_Interface_0800', 0, function () {
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_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!');
......@@ -128,11 +128,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name HiCheckerTest006
* @tc.name DFX_DFR_Hichecker_Interface_1300
* @tc.desc
*/
it('HiCheckerTest006', 0, function () {
console.info('HiCheckerTest006 start');
it('DFX_DFR_Hichecker_Interface_1300', 0, function () {
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_CHECK_ABILITY_CONNECTION_LEAK | hichecker.RULE_CAUTION_PRINT_LOG);
console.log('add rule success!');
......
......@@ -72,7 +72,7 @@ describe('HidebugJsTest', function () {
* @tc.name : getPss
* @tc.desc : Get application process proportional set size memory information
*/
it('DFX_DFR_Hiprofiler_Interface_0800', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_0800', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test start*************');
try {
const times = 3;
......@@ -88,7 +88,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test end*************');
done();
});
/*
......@@ -96,7 +95,7 @@ describe('HidebugJsTest', function () {
* @tc.name : getSharedDirty
* @tc.desc : Obtains the size of the shared dirty memory of a process.
*/
it('DFX_DFR_Hiprofiler_Interface_1200', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_1200', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test start*************');
try {
let dirty = hidebug.getSharedDirty();
......@@ -106,7 +105,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test end*************');
done();
});
/*
......@@ -114,7 +112,7 @@ describe('HidebugJsTest', function () {
* @tc.name : startProfiling with normal parameter
* @tc.desc : Start CPU Profiling.
*/
it('DFX_DFR_Hiprofiler_Interface_1600', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_1600', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test start*************');
try {
let timestamp = Date.now();
......@@ -130,7 +128,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test end*************');
done();
});
/*
......@@ -138,7 +135,7 @@ describe('HidebugJsTest', function () {
* @tc.name : startProfiling repeatedly
* @tc.desc : Start CPU Profiling.
*/
it('DFX_DFR_Hiprofiler_Interface_1500', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_1500', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test start*************');
try {
let path1 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-111.json'
......@@ -158,7 +155,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test end*************');
done();
});
/*
......@@ -166,7 +162,7 @@ describe('HidebugJsTest', function () {
* @tc.name : startProfiling with empty parameter
* @tc.desc : Start CPU Profiling.
*/
it('DFX_DFR_Hiprofiler_Interface_1400', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_1400', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
try {
......@@ -186,7 +182,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test end*************');
done();
});
/*
......@@ -194,7 +189,7 @@ describe('HidebugJsTest', function () {
* @tc.name : startProfiling with overlong parameter
* @tc.desc : Start CPU Profiling.
*/
it('cDFX_DFR_Hiprofiler_Interface_1300', 0, async function (done) {
it('cDFX_DFR_Hiprofiler_Interface_1300', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
try {
......@@ -218,7 +213,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test end*************');
done();
});
/*
......@@ -226,7 +220,7 @@ describe('HidebugJsTest', function () {
* @tc.name : dumpHeapData with normal parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it('DFX_DFR_Hiprofiler_Interface_0300', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_0300', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test start*************');
try {
let timestamp = Date.now();
......@@ -240,7 +234,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test end*************');
done();
});
/*
......@@ -248,7 +241,7 @@ describe('HidebugJsTest', function () {
* @tc.name : dumpHeapData with empty parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it('DFX_DFR_Hiprofiler_Interface_0200', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_0200', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
try {
......@@ -266,7 +259,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test end*************');
done();
});
/*
......@@ -274,7 +266,7 @@ describe('HidebugJsTest', function () {
* @tc.name : dumpHeapData with overlog parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it('DFX_DFR_Hiprofiler_Interface_0100', 0, async function (done) {
it('DFX_DFR_Hiprofiler_Interface_0100', 0, function() {
console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test start*************');
let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
try {
......@@ -296,7 +288,6 @@ describe('HidebugJsTest', function () {
expect().assertFail();
}
console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test end*************');
done();
});
/*
......
......@@ -44,24 +44,24 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name: FaultlogJsException_001
* @tc.name: DFX_DFR_Faultlogger_Interface_0200
* @tc.desc: 检验函数参数输入错误时程序是否会崩溃
* @tc.require: AR000GICT2
* @tc.author:
*/
it('FaultlogJsException_001', 0, async function (done) {
console.info("---------------------------FaultlogJsException_001----------------------------------");
it('DFX_DFR_Faultlogger_Interface_0200', 0, async function (done) {
console.info("---------------------------DFX_DFR_Faultlogger_Interface_0200----------------------------------");
try {
let ret1 = faultlogger.querySelfFaultLog("faultloggertestsummary01");
console.info("FaultlogJsException_001 ret1 == " + ret1);
console.info("DFX_DFR_Faultlogger_Interface_0200 ret1 == " + ret1);
expect(ret1).assertEqual(undefined);
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);
let ret3 = faultlogger.querySelfFaultLog();
console.info("FaultlogJsException_001 ret3 == " + ret3);
console.info("DFX_DFR_Faultlogger_Interface_0200 ret3 == " + ret3);
expect(ret3).assertEqual(undefined);
done();
return;
......@@ -76,34 +76,34 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name: FaultlogJsTest_002
* @tc.name: DFX_DFR_Faultlogger_Interface_0400
* @tc.desc: 检验promise同步方式获取faultlog CPP_CRASH日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it('FaultlogJsTest_002', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_002----------------------------------");
it('DFX_DFR_Faultlogger_Interface_0400', 0, async function (done) {
console.info("---------------------------DFX_DFR_Faultlogger_Interface_0400----------------------------------");
try {
let now = Date.now();
console.info("FaultlogJsTest_002 2 + " + now);
console.info("DFX_DFR_Faultlogger_Interface_0400 2 + " + now);
let module = "ohos.faultloggerjs.test";
const loopTimes = 10;
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.FaultType.CPP_CRASH, module, "faultloggertestsummary02 " + i);
await msleep(300);
}
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);
console.info("FaultlogJsTest_002 ret == " + ret.length);
console.info("DFX_DFR_Faultlogger_Interface_0400 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary02 " + i + " fullLog.length " + ret[i].fullLog.length);
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].uid) == "number").assertTrue();
expect(typeof(ret[i].type) == "number").assertTrue();
......@@ -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);
console.info("FaultlogJsTest_002 ret == " + ret.length);
console.info("DFX_DFR_Faultlogger_Interface_0400 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes);
done();
return;
} catch (err) {
console.info("catch (err) == " + err);
}
console.info("FaultlogJsTest_002 error");
console.info("DFX_DFR_Faultlogger_Interface_0400 error");
expect(false).assertTrue();
done();
})
......@@ -135,16 +135,16 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name: FaultlogJsTest_003
* @tc.name: DFX_DFR_Faultlogger_Interface_0500
* @tc.desc: 检验promise同步方式获取faultlog JS_CRASH日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it('FaultlogJsTest_003', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_003----------------------------------");
it('DFX_DFR_Faultlogger_Interface_0500', 0, async function (done) {
console.info("---------------------------DFX_DFR_Faultlogger_Interface_0500----------------------------------");
try {
let now = Date.now();
console.info("FaultlogJsTest_003 2 + " + now);
console.info("DFX_DFR_Faultlogger_Interface_0500 2 + " + now);
const loopTimes = 2;
let i = 0;
let pro = new Promise(
......@@ -156,7 +156,7 @@ describe("FaultlogJsTest", function () {
r("done!")
return
}
console.info("--------FaultlogJsTest_003 3 + " + i + "----------");
console.info("--------DFX_DFR_Faultlogger_Interface_0500 3 + " + i + "----------");
++i;
let dataStr = ["1", "2"]
console.info(dataStr[2].test);
......@@ -166,9 +166,9 @@ describe("FaultlogJsTest", function () {
await pro;
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);
console.info("FaultlogJsTest_003 ret == " + ret.length);
console.info("DFX_DFR_Faultlogger_Interface_0500 ret == " + ret.length);
if (ret.length > 0) {
expect(true).assertTrue();
} else {
......@@ -182,7 +182,7 @@ describe("FaultlogJsTest", function () {
} catch (err) {
console.info("catch (err) == " + err);
}
console.info("FaultlogJsTest_003 error");
console.info("DFX_DFR_Faultlogger_Interface_0500 error");
expect(false).assertTrue();
done();
})
......@@ -190,34 +190,34 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name: FaultlogJsTest_004
* @tc.name: DFX_DFR_Faultlogger_Interface_0300
* @tc.desc: 检验promise同步方式获取faultlog APP_FREEZE日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it('FaultlogJsTest_004', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_004----------------------------------");
it('DFX_DFR_Faultlogger_Interface_0300', 0, async function (done) {
console.info("---------------------------DFX_DFR_Faultlogger_Interface_0300----------------------------------");
try {
let now = Date.now();
console.info("FaultlogJsTest_004 2 + " + now);
console.info("DFX_DFR_Faultlogger_Interface_0300 2 + " + now);
let module = "ohos.faultloggerjs.test";
const loopTimes = 10;
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.FaultType.APP_FREEZE, module, "faultloggertestsummary04 " + i);
await msleep(300);
}
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);
console.info("FaultlogJsTest_004 ret == " + ret.length);
console.info("DFX_DFR_Faultlogger_Interface_0300 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary04 " + i + " fullLog.length " + ret[i].fullLog.length);
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();
} else {
expect(false).assertTrue();
......@@ -228,7 +228,7 @@ describe("FaultlogJsTest", function () {
} catch (err) {
console.info("catch (err) == " + err);
}
console.info("FaultlogJsTest_004 error");
console.info("DFX_DFR_Faultlogger_Interface_0300 error");
expect(false).assertTrue();
done();
})
......@@ -236,37 +236,37 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name: FaultlogJsTest_005
* @tc.name: DFX_DFR_Faultlogger_Interface_0100
* @tc.desc: 检验通过回调方式获取faultlog日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it('FaultlogJsTest_005', 0, async function (done) {
console.info("---------------------------FaultlogJsTest_005----------------------------------");
it('DFX_DFR_Faultlogger_Interface_0100', 0, async function (done) {
console.info("---------------------------DFX_DFR_Faultlogger_Interface_0100----------------------------------");
try {
let now = Date.now();
console.info("FaultlogJsTest_005 start + " + now);
console.info("DFX_DFR_Faultlogger_Interface_0100 start + " + now);
let module = "ohos.faultloggerjs.test";
const loopTimes = 10;
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.FaultType.CPP_CRASH, module, "faultloggertestsummary05 " + i);
await msleep(300);
}
await msleep(1000);
console.info("--------FaultlogJsTest_005 4----------");
console.info("--------DFX_DFR_Faultlogger_Interface_0100 4----------");
function queryFaultLogCallback(error, ret) {
if (error) {
console.info('FaultlogJsTest_005 once error is ' + error);
console.info('DFX_DFR_Faultlogger_Interface_0100 once error is ' + error);
} else {
console.info("FaultlogJsTest_005 ret == " + ret.length);
console.info("DFX_DFR_Faultlogger_Interface_0100 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary05 " + i + " fullLog.length " + ret[i].fullLog.length);
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();
} else {
expect(false).assertTrue();
......@@ -280,7 +280,7 @@ describe("FaultlogJsTest", function () {
} catch (err) {
console.info(err);
}
console.info("FaultlogJsTest_005 error");
console.info("DFX_DFR_Faultlogger_Interface_0100 error");
expect(false).assertTrue();
done();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册