Reactis API V2020
API - Reactis: C Bindings - Coverage Tracking
rsCoverageMetricFromString
Convert string to RsCoverageMetric value.
Converts a string to an individual RsCoverageMetric value.
Syntax
RsCoverageMetric rsCoverageMetricFromString (const char *str);
Parameters
- str
- String holding the name of an RsCoverageMetric value. Recognized names are
listed in Coverage Metric Names.
Return Value
Returns an individual RsCoverageMetric value whose name matches
str (using case-insensitive comparison). The RsCoverageMetric
values are listed in RsCoverageMetric.
Returns RsCvgNone if there is no match, in which case rsGetLastError
should NOT be called.
rsCoverageMetricToString
Convert RsCoverageMetric value to string.
Converts an individual RsCoverageMetric value to a string.
Syntax
const char *rsCoverageMetricToString (RsCoverageMetric cvg);
Parameters
- cvg
- One of the individual RsCoverageMetric values listed in
RsCoverageMetric.
Return Value
Returns a constant string representing the value of cvg if
cvg is one of the individual coverage metric values. See
Coverage Metric Names for the list of coverage metric names.
Returns NULL if cvg is not one of the individual
RsCoverageMetric values, in which case rsGetLastError should NOT be
called.
rsGetCoverageCriteriaCount
Number of coverage metrics being tracked.
Returns the number of coverage criteria corresponding to most recent
call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaCount (RsHandle *h);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
Return Value
Number of coverage criteria being tracked. When calling any of the
rsGetCoverageCriteria functions, the ’index’ parameter must be less
than the value returned by rsGetCoverageCriteriaCount.
The return value is 0 if rsTester or rsSimRunSuite was not
called before or an error occurred during the last call.
rsGetCoverageCriteriaName
Map an index to a coverage metric name.
Returns the name of a coverage criterion corresponding to the most
recent call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaName (
RsHandle *h,
int index,
char *buffer,
int bufferSize
);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to
0 and less than the return value of rsGetCoverageCriteriaCount.
- buffer
- The buffer that receives the name of the coverage criterion. The buffer’s
size must correspond to the value of the bufferSize
parameter. If this parameter is NULL, then the value returned by
rsGetCoverageCriteriaName will be the buffer size required to store
the criterion’s name.
- bufferSize
- The size of the buffer passed in as the third argument. If the
actual name of the criterion is longer than this value, it will be
truncated to the length of the buffer. In that case, the return value of
rsGetCoverageCriteriaName will be the buffer size that would be
required to receive the whole name.
Return Value
Returns -1 if an error occurred (either the index parameter is
outside the valid range or neither rsTester or rsSimRunSuite
have been called before).
Returns 0 on success.
Returns a value greater than 0 if either the buffer parameter is NULL or
the bufferSize parameter was not sufficient to receive the
complete name. In that case, the value returned specifies the buffer size
required to store the complete name.
rsGetCoverageCriteriaNumCovered
Number of covered targets in a metric.
Returns the number of targets in the given metric covered during the most
recent call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaNumCovered (RsHandle *h, int index);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to 0 and less than the return value of rsGetCoverageCriteriaCount.
Return Value
Returns -1 if an error occurred (either the index parameter is
outside the valid range or neither rsTester or rsSimRunSuite
have been called before).
Returns the number of covered targets for the coverage criterion specified
by the index parameter.
rsGetCoverageCriteriaNumTargets
Number of targets in a metric.
Returns the number of targets in the given metric for the most
recent call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaNumTargets (RsHandle *h, int index);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to
0 and less than the return value of rsGetCoverageCriteriaCount.
Return Value
Returns -1 if an error occurred (either the index parameter is outside the
valid range or neither rsTester or rsSimRunSuite have been
called before).
Returns the total number of targets for the coverage criterion specified by
the index parameter.
rsGetCoverageCriteriaNumUncovered
Number of uncovered targets in a metric.
Returns the number of uncovered targets in a given metric during the most
recent call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaNumUncovered (RsHandle *h, int index);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to 0 and less than the return value of rsGetCoverageCriteriaCount.
Return Value
Returns -1 if an error occurred (either the index parameter is
outside the valid range or neither rsTester or rsSimRunSuite
have been called before).
Returns the number of uncovered targets for the coverage criterion
specified by the index parameter.
rsGetCoverageCriteriaNumUnreachable
Number of unreachable targets in a metric.
Returns the number of unreachable targets in the given metric during
the most recent call to rsTester or rsSimRunSuite.
Syntax
int rsGetCoverageCriteriaNumUnreachable (RsHandle *h, int index);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to
0 and less than the return value of rsGetCoverageCriteriaCount.
Return Value
Returns -1 if an error occurred (either the index parameter is outside the
valid range or neither rsTester or rsSimRunSuite have been
called before).
Returns the number of unreachable targets for the coverage criterion
specified by the index parameter.
rsGetCoverageCriteriaPercentCovered
Percentage of reachable targets in a metric that are covered.
Returns the name of a coverage criterion corresponding to the most
recent call to rsTester or rsSimRunSuite.
Syntax
double rsGetCoverageCriteriaPercentCovered (RsHandle *h, int index);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- index
- The index of the coverage criterion. This value must be greater or equal to 0 and less than the return value of rsGetCoverageCriteriaCount.
Return Value
Returns -1 if an error occurred (either the index parameter is
outside the valid range or neither rsTester or rsSimRunSuite
have been called before).
Returns the percentage of covered targets for the coverage criterion
specified by the index parameter. The value ranges from 0.0
(nothing was covered) to 100.0 (all reachable targets were covered).