This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getDiagnosticFor

Class: matlab.unittest.constraints.Constraint
Package: matlab.unittest.constraints

Produce diagnostic for compared value

Syntax

diag = getDiagnosticFor(constObj,actVal)

Description

diag = getDiagnosticFor(constObj,actVal) produces a diagnostic, diag, for a compared value, actVal. When creating a custom constraint, the class author must implement the getDiagnosticFor method so that it analyzes the value, actVal, against the constraint, constObj, and instantiates and returns a matlab.unittest.diagnostics.Diagnostic object.

Typically, the testing framework calls this method when it encounters a qualification failure. Therefore, the constraint author can afford to undertake a more detailed analysis in the getDiagnosticFor method than the satisfiedBy method.

Input Arguments

actVal

Value for comparison

constObj

Constraint instance

Output Arguments

diag

Diagnostic instance