Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Test Data Settings

104_01: Is there a way to initialize an array with a large number of elements or a structure with a large number of members without using the CSV?

Question:

I want to initialize a structure with many members or an array with many elements without using the CSV file. How can I do it?

Answer:

There are 2 ways to initialize input variables without using the CSV.

1. Using the Initial Values feature

1-1. Initialize variables for all test data

With this method you can initialize variables with specified values before giving test data to variables from the CSV file. From the Unit Test CSV Settings dialog click the "Initial Values" button, check the "Initialize for all test data" checkbox, then select and assign initial values to variables.

1-2. Initialize variables only once

Uncheck the "Initialize for all test data" checkbox to only initialize once at the start of the test.

2. Using a test driver

If you want to initialize grouped data such as structure pointer variables or arrays, create a dummy variable with initial values assigned in the test driver code and specify that pointer to a structure pointer variable or array to be tested in the CSV file. In this case, it is necessary to compile and link the created test driver code.
By specifying only the variables that need to be changed as test conditions in the CSV file it is possible to save the trouble of registering all variables in the CSV file.


Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: Array Initialization | Structure Initialization
Technical Tips Google Search


Information Links