MATCHING

System Testing Test Script Language.

Syntax

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

Description

MATCHING is a function that returns a Boolean value. It returns true if the last message 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.

<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.

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

Associated Rules

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

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

Examples

...

CHANNEL ux_socket: ch

SCENARIO Main

DEF_MESSAGE msg_1, EV={100,10}

DEF_MESSAGE msg_2, EV={200,20}

...

WAITTIL(MATCHING(msg_1) || MATCHING(msg_2,ch),WTIME==10)

...

IF (MATCHING(msg_1,ch)) THEN   

...

Related Topics

CHANNEL | DEF MESSAGE | WAITTIL | MATCHED( )