未验证 提交 34d1c7f2 编写于 作者: O openharmony_ci 提交者: Gitee

!4942 bytrace xts自动化测试用例修复

Merge pull request !4942 from chenxuihui/master
...@@ -47,6 +47,7 @@ describe("BytraceTest", function () { ...@@ -47,6 +47,7 @@ describe("BytraceTest", function () {
it("DFX_DFR_Bytrace_0200", 0, async function (done) { it("DFX_DFR_Bytrace_0200", 0, async function (done) {
console.info("------DFX_DFR_Bytrace_0200 start------"); console.info("------DFX_DFR_Bytrace_0200 start------");
// Normal condition // Normal condition
let flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0200 1 start"); console.info("DFX_DFR_Bytrace_0200 1 start");
bytrace.startTrace("test2", 222); bytrace.startTrace("test2", 222);
...@@ -61,31 +62,36 @@ describe("BytraceTest", function () { ...@@ -61,31 +62,36 @@ describe("BytraceTest", function () {
try { try {
console.info("DFX_DFR_Bytrace_0200 2 start"); console.info("DFX_DFR_Bytrace_0200 2 start");
bytrace.startTrace("test2"); bytrace.startTrace("test2");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0200 2 fail!"); console.info("DFX_DFR_Bytrace_0200 2 fail!");
console.info("DFX_DFR_Bytrace_0200 2 err = " + err); console.info("DFX_DFR_Bytrace_0200 2 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Pass multiple parameters // Abnormal condition, Pass multiple parameters
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0200 3 start"); console.info("DFX_DFR_Bytrace_0200 3 start");
bytrace.startTrace("test2", 222, 2000, 2); bytrace.startTrace("test2", 222, 2000, 2);
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0200 3 fail!"); console.info("DFX_DFR_Bytrace_0200 3 fail!");
console.info("DFX_DFR_Bytrace_0200 3 err = " + err); console.info("DFX_DFR_Bytrace_0200 3 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Parameter format mismatch // Abnormal condition, Parameter format mismatch
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0200 4 start"); console.info("DFX_DFR_Bytrace_0200 4 start");
bytrace.startTrace(2, "222", "2000"); bytrace.startTrace(2, "222", "2000");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0200 4 fail!"); console.info("DFX_DFR_Bytrace_0200 4 fail!");
console.info("DFX_DFR_Bytrace_0200 4 err = " + err); console.info("DFX_DFR_Bytrace_0200 4 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
console.info("------DFX_DFR_Bytrace_0200 end------"); console.info("------DFX_DFR_Bytrace_0200 end------");
done(); done();
...@@ -94,6 +100,7 @@ describe("BytraceTest", function () { ...@@ -94,6 +100,7 @@ describe("BytraceTest", function () {
it("DFX_DFR_Bytrace_0300", 0, async function (done) { it("DFX_DFR_Bytrace_0300", 0, async function (done) {
console.info("------DFX_DFR_Bytrace_0300 start------"); console.info("------DFX_DFR_Bytrace_0300 start------");
// Normal condition // Normal condition
let flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0300 1 start") console.info("DFX_DFR_Bytrace_0300 1 start")
bytrace.finishTrace("test3", 111); bytrace.finishTrace("test3", 111);
...@@ -108,31 +115,36 @@ describe("BytraceTest", function () { ...@@ -108,31 +115,36 @@ describe("BytraceTest", function () {
try { try {
console.info("DFX_DFR_Bytrace_0300 2 start") console.info("DFX_DFR_Bytrace_0300 2 start")
bytrace.finishTrace("test3"); bytrace.finishTrace("test3");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0300 2 fail!"); console.info("DFX_DFR_Bytrace_0300 2 fail!");
console.info("DFX_DFR_Bytrace_0300 2 err = " + err); console.info("DFX_DFR_Bytrace_0300 2 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Pass multiple parameters // Abnormal condition, Pass multiple parameters
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0300 3 start") console.info("DFX_DFR_Bytrace_0300 3 start")
bytrace.finishTrace("test3", 1, 1); bytrace.finishTrace("test3", 1, 1);
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0300 3 fail!"); console.info("DFX_DFR_Bytrace_0300 3 fail!");
console.info("DFX_DFR_Bytrace_0300 3 err = " + err); console.info("DFX_DFR_Bytrace_0300 3 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Parameter format mismatch // Abnormal condition, Parameter format mismatch
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0300 4 start") console.info("DFX_DFR_Bytrace_0300 4 start")
bytrace.finishTrace(1, "123"); bytrace.finishTrace(1, "123");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0300 4 fail!"); console.info("DFX_DFR_Bytrace_0300 4 fail!");
console.info("DFX_DFR_Bytrace_0300 4 err = " + err); console.info("DFX_DFR_Bytrace_0300 4 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
console.info("------DFX_DFR_Bytrace_0300 end------"); console.info("------DFX_DFR_Bytrace_0300 end------");
done(); done();
...@@ -152,6 +164,7 @@ describe("BytraceTest", function () { ...@@ -152,6 +164,7 @@ describe("BytraceTest", function () {
it("DFX_DFR_Bytrace_0500", 0, async function (done) { it("DFX_DFR_Bytrace_0500", 0, async function (done) {
console.info("-------DFX_DFR_Bytrace_0500 start--------"); console.info("-------DFX_DFR_Bytrace_0500 start--------");
// Normal condition // Normal condition
let flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0500 1 start") console.info("DFX_DFR_Bytrace_0500 1 start")
bytrace.traceByValue("test5", 5); bytrace.traceByValue("test5", 5);
...@@ -166,31 +179,36 @@ describe("BytraceTest", function () { ...@@ -166,31 +179,36 @@ describe("BytraceTest", function () {
try { try {
console.info("DFX_DFR_Bytrace_0500 2 start") console.info("DFX_DFR_Bytrace_0500 2 start")
bytrace.traceByValue("test5"); bytrace.traceByValue("test5");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0500 2 fail!"); console.info("DFX_DFR_Bytrace_0500 2 fail!");
console.info("DFX_DFR_Bytrace_0500 2 err = " + err); console.info("DFX_DFR_Bytrace_0500 2 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Pass multiple parameters // Abnormal condition, Pass multiple parameters
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0500 3 start") console.info("DFX_DFR_Bytrace_0500 3 start")
bytrace.traceByValue("test5", 3, 1); bytrace.traceByValue("test5", 3, 1);
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0500 3 fail!"); console.info("DFX_DFR_Bytrace_0500 3 fail!");
console.info("DFX_DFR_Bytrace_0500 3 err = " + err); console.info("DFX_DFR_Bytrace_0500 3 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
// Abnormal condition, Parameter format mismatch // Abnormal condition, Parameter format mismatch
flag = false;
try { try {
console.info("DFX_DFR_Bytrace_0500 4 start") console.info("DFX_DFR_Bytrace_0500 4 start")
bytrace.traceByValue(1, "123"); bytrace.traceByValue(1, "123");
expect(false).assertTrue(); expect(flag).assertFalse();
} catch (err) { } catch (err) {
flag = true;
console.info("DFX_DFR_Bytrace_0500 4 fail!"); console.info("DFX_DFR_Bytrace_0500 4 fail!");
console.info("DFX_DFR_Bytrace_0500 4 err = " + err); console.info("DFX_DFR_Bytrace_0500 4 err = " + err);
expect(true).assertTrue(); expect(flag).assertTrue();
} }
console.info("------DFX_DFR_Bytrace_0500 end------"); console.info("------DFX_DFR_Bytrace_0500 end------");
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册