IDE & Navigation
Properties & Tools
Assert tag asserts that the condition defined in the attributes is true and forces failure when the condition does not evaluate to true.
The syntax of assert tag is:
<assert value1="expression1" op="comparator" value2="expression2" else="L1: exception message" tags="requirement tags" passed="message or expression"/>
value1 and value2 are MScript expressions. MScript expression can be:
Comparison Operator can be one of the following:
Use true to compare to a boolean data value.
You may use mscript logic operation methods $not(), $compare(), $or() etc. to construct a more complex logic expression, see details of these methods in mScript method.
The exception level in the else attribute can be L1, L2, … L5.
You may signal to have execution aborted when the assert is failed by specifying abort as the exception level. For example:
<assert .... else = "abort: fatal error, can not continue."/>
The expression message can be a static message or an expression containing mScript method.
You may also use the following tokens in the “else” and “passed” message:
passed attribute is optional. When the assert evaluates to true, this expression is executed and the results are written to mScript log. (rel 3.0.10)
tags attribute is also optional. This is equivalent to $addTagCheck() call. You may embed a priority in the tags, e.g. H:1.2.3 to indicate High priority for the requirement 1.2.3. (rel 3.1.6)
assert tag can be used in Guard Trigger. Starting with release build 4.4.10, you should use guard tag in Guard Trigger.