background image
<< Read_image and extern_image | Passing Parameters >>
<< Read_image and extern_image | Passing Parameters >>

Function Prototypes

Test RealTime - User Guide
=> 0, test4 => 0,
& test5 => 0, test6 => 0} },
ev = init
VAR Tableau[1], init = {B => { champ1 => 0, champ2 => 0,
champ3 => 0} }, ev = init
VAR Tableau[2], init = {B => { champ1 => 0, champ2 => 0,
champ3 => 0}} , ev = init
VAR Tableau[3], init = {B => { champ1 => 0, champ2 => 0,
champ3 => 0}} , ev = init
#ret_fct;
END ELEMENT
END TEST -- TEST 1
Stub Simulation
Stub simulation is based on the idea certain functions are to be simulated and are
therefore replaced with other functions which are generated in the test driver. These
generated functions, or stubs, have the same interface as the simulated functions, but
the body of the functions is replaced.
These stubs have the following roles:
·
Store input values to simulated functions
·
Assign output values from simulated functions
To be able to generate these stubs, the Test Script Compiler needs to know:
·
The prototypes of the functions that are to be simulated
·
the method of passing each parameter (input, output, or input/output).
When using the Component Testing Wizard, you specify the functions that you want
to stub. This automatically adds the corresponding code to the .ptu test script. On
execution of the test, Component Testing for C generates the stub in the test driver,
which includes:
·
a variable array for the input values of the stub
·
a variable array for the output values of the stub
·
a body declaration for the stub function
Function Prototypes
When generating a stub for a function, Test RealTime considers the first prototype of
the function that is encountered, which can be:
· The declaration of the function in an included header file.
· The declaration DEFINE STUB statement in the .ptu test script.
This means that the declaration of the function contained in the DEFINE STUB
statement is ignored if the function was previously declared in a header file.
142