MATCHED

System Testing Test Script Language.

Syntax

MATCHED( <ref_msg> {[, <channel> )]} )

Description

<ref_msg> is a reference message variable declared with the MESSAGE instruction and initialized with the DEF_MESSAGE instruction.

<channel> is a communication channel declared with the CHANNEL instruction and initialized by the ADD_ID instruction.

MATCHED is a function that returns a Boolean value. It returns true if one of the messages received during a WAITTIL matches the reference message <ref_msg>. If you specify a channel, it returns true only if the matching message was received on this channel.

It returns true if at least one received message has the same values as those defined for the reference message.

MATCHED is only meaningful when used in a WAITTIL instruction or in control statements following a WAITTIL, such as IF, WHILE, or CASE.

The MATCHED return value changes when you reuse it in a WAITTIL statement.

Examples

...

CHANNEL ux_socket: ch

SCENARIO Main   

DEF_MESSAGE msg_1, EV={100,10}   

DEF_MESSAGE msg_2, EV={200,20}   

...   

WAITTIL(MATCHED(msg_1) && MATCHED(msg_2,ch),WTIME==10)   

...   

IF (MATCHED(msg_1,ch)) THEN   

...

Related Topics

CHANNEL | DEF_MESSAGE | WAITTIL | MATCHING( )