assert (assert)

Syntax:

assert( booleanExpression : 'message' );

Description:

Checks the specified Boolean expression for true. The assertion fails if the expression evaluates to false. When the assertion fails, the value of 'message' is added to the test report.

Return value:

void

Example 1:

assert( 1=2 : 'Obviously wrong' );          

// Never reached!        

Example 2:

assert( rc=0 : 'Unexpected return code. Expected: 0' );          

// Never reached!        

Cobol Syntax:

Call "assert" Using
   By Content bResult
   [By Content "message".