PRINT

C++ Test Script Language

Syntax

PRINT (<expression> [ ( , <expression> ) ] );

Location

C++ Test Driver Script, TEST CASE, PROC, STUB, CHECK STUB, PROLOGUE, EPILOGUE, ON ERROR, CHECK EXCEPTION

Description

The PRINT instruction outputs dynamic comments to the traces file. These comments are displayed in the UML sequence diagrams and test reports produced by Component Testing for C++.

<expression> is a valid C++ expression whose type must be handled by the Target Deployment Port (handled types are scalar types, floating types, strings and pointers). <expression> is evaluated on execution.

A PRINT instruction may generate an error when the evaluation of one of the arguments raises an unexpected exception. Use the CHECK EXCEPTION statement to specify exceptions.

Example

Execution of the following test displays the string: "Adding element 12 at position 3". This string is displayed as a note in the sequence diagram and in a tab in the test report.

TEST CASE tc1 {

# pos = s.push(I);

PRINT ("Adding element ", I, " at position ", pos);

CHECK (!s.full ());

}