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

Displaying Actual Values in Execution Report with User Code

Last updated: 2019-10-29
Question:
Is there a setting that will show the actual values with user code?
Answer:

VectorCAST contains an un-documented feature to allow expected user code to be displayed in the execution report with an arbitrary label and with the actual value displayed. To use this feature, your user code will need to make an explicit call to a new harness function called vCAST_UC_WRITE_EXPECTED. This harness function will record the result of evaluating an arbitrary test condition, along with the label and actual value you specify.
 

For example, you might replace user code that used to look like this:

{ <<uut.func.return>> == 1 }

with this instead:

char actual[20];
double return_value = <<uut.func.return>>;
snprintf( actual, 20, "%lg", return_value );
vCAST_UC_WRITE_EXPECTED( "uut.func.return",
"Verify <<uut.func.return>> is 1.2+/-.1",
((1.1 <= return_value) && (return_value <= 1.3)),
actual );

The prototype for vCAST_UC_WRITE_EXPECTED is:

void vCAST_UC_WRITE_EXPECTED (const char *param, const char *name, int match, const char *actual);

The parameters are:

  • const char *param - This corresponds to the user code tag (sans angle brackets) for the parameter or global being checked. This is used by VectorCAST to determine what cell to color in the parameter tree. An empty string can be used if you do not care about the coloring of the parameter tree. If a non-empty string is used, it *must* correspond to a valid harness variable.
  • const char *name - This is the text which will be used as a label for the user code when it is shown in the execution report.
  • int match - If this is non-zero, the user code condition is considered matched. If it is 0, the user code is considered not matched (failed).
  • const char *actual - If this is non-NULL, it should point to a printable string representing the actual value of the variable being tested.
     
 
Article Options
2019-10-29
Views: 8