vector.com|Contact
Search tips

apple banana
Find rows that contain at least one of the two words.

+apple +juice
Find rows that contain both words.

+apple macintosh
Find rows that contain the word 'apple', but rank rows higher if they also contain 'macintosh'.

+apple -macintosh
Find rows that contain the word 'apple' but not 'macintosh'.

+apple ~macintosh
Find rows that contain the word 'apple', but if the row also contains the word 'macintosh', rate it lower than if row does not. This is "softer" than a search for '+apple -macintosh', for which the presence of 'macintosh' causes the row not to be returned at all.

+apple +(>turnover >strudel)
Find rows that contain the words 'apple' and 'turnover', or 'apple' and 'strudel' (in any order), but rank 'apple turnover' higher than 'apple strudel'.

apple*
Find rows that contain words such as 'apple', 'apples', 'applesauce', or 'applet'.

"some words"
Find rows that contain the exact phrase 'some words' (for example, rows that contain 'some words of wisdom' but not "some noise words").

By continuing to use this site you agree to the use of cookies. For more information and to find out how to change this click here. Accept Cookies
Please enable cookies in your browser for this website.
Search:
Advanced search

Compound Test Cases: Initialization Code and Complex Preconditions

Last updated: 2019-10-29
Question:
How do I call initialization code or set up complex preconditions for a compound test case?
Answer:
Compound test cases are often used to test scenarios that require non-trivial initialization. For example, a test that exercises a state machine may require one or more function calls to initialize the state machine and any associated data. VectorCAST provides several mechanisms for initializing data at the beginning of a compound test. 


The most straightforward way to add an initialization stage to a compound test is by creating an Initialization (INIT) Test and adding this as the first slot in your compound test. An initialization test does not call any testable function, but can access any global data within the test harness. You can also add user code to the initialization test to insert custom C or C++ code into the test harness. Because a compound test case runs in one execution of the test harness, any setup done in the initialization test case will be seen by test cases in subsequent slots. 
 
Within the initialization test you may set up data that will be used by the rest of the compound test by: 
 
  1. Just as with regular test cases, you can use the test case parameter tree to set up any global data, class instances, etc. that are visible to the test harness. (Note: If you cannot see a particular global member ensure that your environment has the "whitebox" setting turned on.)


     
  2. To add arbitrary C or C++ initialization code to the test harness, open the initialization test case and select the Testcase User Code tab at the bottom of the test case screen. Enable Input or Expected user code and add your code. Make sure to hit the test compile button to ensure that the user code compiles.  


The second method is particularly useful if you already have code in your application that does the proper initialization. In many cases you can simply copy and paste the correct code.
 
 
Article Options
2019-10-29
Views: 8