Main Content

Verify Multiple Conditions at a Time

To verify multiple conditions in a single time step, include verify statements inside if statements, and include multiple if statements in a single test step.

For example, suppose you have a simple two-button utility function that operates as exclusive-or logic. More than one of the following conditions can be valid at the same time step.

ConditionExpected Output
RedButtonIN == false && GreenButtonIN == falseRedButtonOUT == false && GreenButtonOUT == false
GreenButtonIN == falseGreenButtonOUT ~= true
RedButtonIN == falseRedButtonOUT ~= true
RedButtonIN == true && GreenButtonIN == trueRedButtonOUT == false && GreenButtonOUT == false
RedButtonIN == true && GreenButtonIN == falseRedButtonOUT == true && GreenButtonOUT == false
RedButtonIN == false && GreenButtonIN == trueRedButtonOUT == false && GreenButtonOUT == true

To assess these conditions, this Test Assessment block includes six verify statements in the first test step, contained in if statements. The test step is active during simulation, and the if statements are evaluated at each time step.

Test Assessment block verify statements

See Also