필터 지우기
필터 지우기

Tolerance use in verifyEqual for unit tests

조회 수: 30 (최근 30일)
Mohamed AKI Ahmed
Mohamed AKI Ahmed 2022년 3월 8일
댓글: Mohamed AKI Ahmed 2022년 3월 8일
Hello, I am having a problem when defining a tolerance to be checked while using the verifyEqual function for a unit test. My code has a line that's similar to the following:
verifyEqual(testCase, 0.3589, 0.3588, "AbsTol", 0.0001)
The condition doesn't seem to go throguh, in fact, the code stops there with an error message. Can anyone help with this?

채택된 답변

Steven Lord
Steven Lord 2022년 3월 8일
testCase = matlab.unittest.TestCase.forInteractiveUse;
verifyEqual(testCase, 0.3589, 0.3588, "AbsTol", 0.0001)
Verification passed.
Can you show us the full and exact text of the error and/or failure message you're seeing? Can you also tell us which release of MATLAB you're using?
  댓글 수: 1
Mohamed AKI Ahmed
Mohamed AKI Ahmed 2022년 3월 8일
I found a mistake with the syntax but now it is solved. Thank you for your quick reply

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Results, Reporting, and Test File Management에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by