EXCEPTION

Ada Test Script Language

Purpose

The EXCEPTION instruction describes the behavior of the test script if any exceptions are raised during the execution.

Syntax

EXCEPTION <exception_name>

Description

This instruction can only appear in an ELEMENT block.

<exception_name> is the name of the exception under test.

This instruction must be unique in the block where it appears. If it is absent, the test shall not raise any exception, otherwise, an error is generated.

Only exceptions raised by the procedure under test can be tested. Exceptions raised during the initialization of the variables or during the test of the variables cannot be tested. They are nevertheless detected and written in the test report.

Note Do not use the EXCEPTION statement simultaneously with any native exception handling code, as this will create internal conflicts.

Example

In this example, the exception class is overflow.

ELEMENT

-- The test shall raise the overflow exception

EXCEPTION overflow

....

-- Using the ‘exception’ variable

VAR exception->ch1, ....

END ELEMENT