Editing stubs
The stub editor enables you to visually describe the stub behavior and to define input and output parameters for the stub.
About this task
The test case editor is made of three panes:
- The Stub Behaviors list displays one or several behaviors for the stub function. You can add new behaviors or duplicate existing behaviors.
- The Calling Function pane displays the names of components that call the stubbed function.
- The Details pane contains the input and output values for the selected behavior.
- The User source code pane contains the user code added to compute a return value for the stub.
Tip: You can find where the edited file is located
by clicking on the title of editor or on the header and selecting . The explorer selects the current
stub and expands automatically all parent nodes.
The main objective of editing a test case is to define the checks for each stub's call in the tested code.
Procedure
- In the project explorer, open a stub.
- In the Stub Behaviors list, select the default behavior or create new one.
- In the Details section, select a check
block.The Checked Variables table displays the variables and structures contained in the function under test.
- For each variable or structure, specify an expected value
and a return code.These values can be simple values, multiple values (ranges, series) or C structures.
- When you have finished editing the test case, click Save and close the stub editor.