ELEMENT ... END ELEMENT

Ada Test Script Language

Purpose

The ELEMENT and END ELEMENT instructions delimit a test phase or ELEMENT block.

Syntax

ELEMENT

END ELEMENT

Description

The ELEMENT instruction is mandatory and can only be located within a TEST block. If absent, a warning message is generated and the ELEMENT block is implicitly declared before the first occurrence of a VAR, ARRAY, STR, or STUB instruction.

The block must end with the instruction END ELEMENT. If absent, a warning message is generated and it is implicitly declared before the next ELEMENT instruction, or the END TEST instruction.

The ELEMENT block contains a call to the service under test as well as instructions describing the initializations and checks on test variables.

Positioning of VAR, ARRAY, STR or STUB related to the actual test procedure is irrelevant as the Test Script Compiler separates these instructions into two parts:

  1. The test initialization (described by INIT) is generated with the ELEMENT instruction

    The test of the expected value (described by EV) is generated with the END ELEMENT instruction

Example

 TEST 1

   FAMILY nominal

   ELEMENT

     VAR x1,       init = 0,            ev = init

     VAR x2,       init = SIZE_IMAGE-1, ev = init

     VAR y1,       init = 0,            ev = init

     VAR y2,       init = SIZE_IMAGE-1, ev = init

     ARRAY image,  init = 0,            ev = init

     VAR histo(0), init = 0,  ev = SIZE_IMAGE*SIZE_IMAGE

     ARRAY histo(1..SIZE_HISTO-1), init = 0, ev = 0

     #compute_histo(x1,y1,x2,y2,histo);

   END ELEMENT

 END TEST

 

Related Topics

VAR | ARRAY | STR | STUB | NEXT_TESTInitialization Expressions for AdaExpected Value Expression for Ada