Package: matlab.unittest.constraints
Superclasses: matlab.unittest.constraints.Constraint
Constraint specifying function that issues expected warning profile
The IssuesWarnings
class creates a constraint
that issues an expected warning profile. The constraint is satisfied
only if the actual value is a function handle that issues a specific
set of warnings. You specify warnings using warning identifiers.
By default, the constraint only confirms that when the testing framework invokes the function handle, MATLAB® issues the specified set of warnings. It ignores the number of times the warnings are issued, in what order they are issued, and whether or not any unspecified warnings are issued. However, you can set parameters to respect the order, the count, and the warning set. Alternatively, you can specify the exact warning profile for comparison.
outConstObj = IssuesWarnings(
creates
a constraint, warnArr
)outConstObj
, specifying a function
that issues expected warnings, warnArr
.
outConstObj = IssuesWarnings(
creates
a constraint with additional options specified by one or more expVal
,Name,Value
)Name,Value
pair
arguments. Name
must
appear inside single quotes (''
). You can specify
several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN
.
|
Warning identifiers expected when the testing framework invokes
the function handle, specified as a cell array of warning identifiers.
If |
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
|
Indicator if the value is a function handle that must issue
a warning profile that is an exact match, specified as Default: |
|
Indicator whether to respect element counts, specified as Default: |
|
Indicator whether to respect the order of elements, specified
as The order of a given set of warnings is determined by trimming
the warning profiles to a profile with no repeated adjacent warnings.
For example, the warning profile When this constraint respects order, the order of the warnings
that are issued and expected must match the order of the expected
warning profile. Warnings issued that are not listed in Default: |
|
Indicator whether to respect set elements, specified as Default: |
|
Number of outputs the constraint should request when invoking the function handle, specified as a non-negative, real, scalar integer. Default: |
|
Indicator of whether the constraint performs exact comparisons.
Set this property through the constructor via the name-value pair
argument, |
|
Expected warning identifiers. Set this read-only property through
the constructor via the |
|
Output arguments produced at invocation of the supplied function
handle, specified as a cell array. This property provides access to
output arguments. It is read only and the testing framework sets it
when it invokes the function handle. The number of outputs is determined
by the |
|
Number of output arguments the instance uses when it executes
functions. Set this property through the constructor via the name-value
pair argument, |
|
Indicator if the constraint respects the element counts, specified
through the constructor via the name-value pair argument, |
|
Indicator if the constraint respects the order of elements,
specified through the constructor via the name-value pair argument, |
|
Indicator if the constraint respects set elements, specified
through the constructor via the name-value pair argument, |
Handle. To learn how handle classes affect copy operations, see Copying Objects.