background image
<< Testing Character Arrays | Function Prototypes >>
<< Testing Character Arrays | Function Prototypes >>

Read_image and extern_image

Automated Testing
TEST 4
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 = extern_image, ev = init
ARRAY histo, init = 0, ev ==
VAR status, init ==, ev = 0
#read_image(extern_image,"image.bmp");
#status = compute_histo(x1, y1, x2, y2, histo);
END ELEMENT
END TEST
Read_image and extern_image are two arrays that have been declared in the same
way. Every element from the extern_image array is assigned to the corresponding
read_image array element.
You can use this form of initialization and testing with one or more array dimensions.
Testing an Array Whose Elements are Unions
When testing an array of unions, detail your tests for each member of the array, using
VAR lines in the ELEMENT block.
Example
Considering the following variables:
#typedef struct {
# int test1;
# int test2;
# int test3;
# int test4;
# int test5;
# int test6;
# } Test;
#typedef struct {
# int champ1;
# int champ2;
# int champ3;
# } Champ;
#typedef struct {
# int toto1;
# int toto2;
# } Toto;
#typedef union {
# Test A;
# Champ B;
# Toto C;
# } T_union;
#extern T_union Tableau[4];
The test must be written element per element:
TEST 1
FAMILY nominal
ELEMENT
VAR Tableau[0], init = {A => { test1 => 0, test2 => 0, test3
141