ELEMENT ... END ELEMENT

C 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 instructions is irrelevant, with respect to the test procedure call since the Test Script Compiler separates these instructions into two parts:

  1. The test initializer (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

VAR status, init ==, ev = 0

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

END ELEMENT

END TEST

Related Topics

VAR | ARRAY | STR | STUB | NEXT_TEST | Initialization Expressions for C | Expected Value Expression for C