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

Testing Global Variables

Last updated: 2019-04-18
Question:

When are global variables tested?

Answer:

There are differences between expected results on function parameters/returns and globals, when applied to a list of expected results:

  • For a function stub. It is when the stub function is called.
  • For a global  the test harness does not know when the global is written to. VectorCAST needs to be told by the operator when to test the global value.

An example source unit.

void stub1(int); void stub2(int);
static int g = 0;

void fut(int a)
{
  g = g + 1;
  stub1(a);
  g = g + 1;
  stub2(a);
  g = g + 1;
}

  1. Options are display global data after each test case. The expected value for g would be 3. It is tested at the end of the test case.
  2. Options are display global data after each slot iteration. Here the test case is used in a compound with the slot iterated three times. The expected values for g would be 3, 6, 9. One per iteration.
  3. Options are display global data after each range iteration. The parameter ‘a’ is set as a list 1, 2, 3, 4. The expected values for g would be 3, 6, 9, 12. One per range test.
  4. Options are display global data after each event. The expected values for g would be 1, 2, 3. 1 and 2 are at the stub1 and stub2 events and 3 is at the end of the test case.

For input values, lists and ranges. The list/range position is advanced every time VectorCAST writes to the global. For expected results for lists the list position is advanced every time after an expected result test is made. Beware for expected results for a range, that tests the value lies within the range.

The list position will reset once a new test starts, for example the next slot in a compound, but does not reset over slot iterations.

 
Article Options
2019-04-18
Views: 177
Rate this article:  
Error(s) occurred processing form.
Please complete all required fields. Fields marked with * are required.