Azzera filtri
Azzera filtri

Tolerance use in verifyEqual for unit tests

30 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Steven Lord
Steven Lord il 8 Mar 2022
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 Commento
Mohamed AKI Ahmed
Mohamed AKI Ahmed il 8 Mar 2022
I found a mistake with the syntax but now it is solved. Thank you for your quick reply

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Results, Reporting, and Test File Management in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by