CHECK

C++ Test Script Language

Purpose

The CHECK instruction evaluates the Boolean value of a native expression.

Syntax

CHECK [ <comment> ] ( <native expression> );

Arguments

<comment> is an optional string that appears in the test results.

<native expression> is a valid C++ expression, which may be converted into a Boolean.

Location

TEST CASE, PROC, STUB, CHECK STUB

Description

The CHECK instruction evaluates the native expression. If the result of the check is TRUE, the result of the corresponding test is Passed. Otherwise, an error is generated. The result of the error handling is specified with the ON ERROR keyword.

Example

TEST CLASS TestA {

       TEST CASE tc1 {

              CHECK (s.empty ());

       }

       RUN { tc1; }

}