【零基础学习CAPL语法】——testStep:测试结果输出函数
文章目录
- 1.函数介绍
- 2.在报告中体现
1.函数介绍
testStep——测试结果输出函数
2.在报告中体现
//testStep()
void PrintTxMsg()
{testStep("Tx","[%x] [%.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x]",Diag_Req.id,Diag_Req.byte(0),Diag_Req.byte(1),Diag_Req.byte(2),Diag_Req.byte(3),Diag_Req.byte(4),Diag_Req.byte(5),Diag_Req.byte(6),Diag_Req.byte(7));
}
void PrintRxMsg()
{testStep("Rx","[%x] [%.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x]",Diag_Resp.id,Diag_Resp.byte(0),Diag_Resp.byte(1),Diag_Resp.byte(2),Diag_Resp.byte(3),Diag_Resp.byte(4),Diag_Resp.byte(5),Diag_Resp.byte(6),Diag_Resp.byte(7));
}
具体在报告中:
//testStepFail()、testStepPass()
void JudgeResponse(byte response,byte server)
{if(testWaitForMessage(Diag_Resp_1,50))//50ms内收到响应则为true{if(response == server + 0x40)//肯定响应{testStepPass("pass","Response OK");}else{testStepFail("fail","Response NOK");}}else{testStepFail("Fail","TimeOut");}
}