PROC ... END PROC

System Testing Test Script Language.

Syntax

PROC <arg> {[, <arg> ]}

END PROC

Description

The PROC instruction lets you define a local procedure inside a scenario. A procedure can take parameters defined as data types.

Any previously defined global variables declared in the test script are visible in the PROC block. Variables declared locally to a procedure block are only visible within that procedure.

Procedure parameters take basic data: int, char, and float as well as any data types defined by the a typedef statement.

Procedures must be located at the beginning of the test script file, before the highest-level scenarios.

Procedures can be called from any scenario.

Procedures do not return any parameters.

Example

#int hp,ds;

PROC init (int sock_type)

...

CALL gethostbyname (serv_name)@@hp

CALL socket (sock_type, SOCK_DGRAM, 0)@@ds

...

END PROC

SCENARIO Main

...

CALL init( AF_UNIX )

...

END SCENARIO

Related Topics

CALL