Reactive Systems logo
Reactis for C API V2021

Reactis for C API:
Reactis Harness Library (General)

rcRshOpenOpen an existing .rsh file or create a new .rsh file.
rcRshCloseClose an .rsh file.
rcRshSaveSave changes to an .rsh file.
rcRshGetParameterValueGet the value of a library-specific setting.
rcRshSetParameterValueSet the value of a project-specific setting.
rcRshGetCoverageEnabledGet enabled/disabled status of a coverage metric.
rcRshSetCoverageEnabledSet enabled/disabled status of a coverage metric.
rcRshGetEntryFunCandidatesFind functions which could potentially be used as an entry function in a test harness.
rcRshGetInitFunCandidatesFind functions which could potentially be used as an initialization function in a test harness.


rcRshOpen

Open an existing .rsh file or create a new .rsh file.

Syntax

rshId = rcRshOpen(rsmFileName,rshFileName)

Description

rshId = rcRshOpen(rsmFileName,rshFileName) If file rshFileName exists, rcRshOpen opens the existing file. rsmFileName must refer to an .rsm file which is compatible with the .rsh file.

If file rshFileName does not exist, this function creates the file on disk and pre- populates the list of input ports as specified in rsmFileName.

rshId is a scalar integer-valued double that identifies the .rsh file when calling other rcRsh* API functions.

Examples

rsh = rcRshOpen('cruise.rsm','cruise.rsh');

See Also

rcRshClose, rcRshSave


rcRshClose

Close an .rsh file.

Syntax

rcRshClose(rshId)

Description

rcRshClose(rshId) closes the file identified by rshId. Any changes since the last call to rcRshSave will be discarded.

See Also

rcRshOpen, rcRshSave


rcRshSave

Save changes to an .rsh file.

Syntax

rcRshSave(rshId)
rcRshSave(rshId, fileName)

Description

rcRshSave(rshId) writes any changes made to the .rsh file to disk, using the same file name as used in the rcRshOpen call that opened the file.

rcRshSave(rshId, fileName) writes any changes made to the .rsh file to disk, using file name fileName.

See Also

rcRshOpen, rcRshClose


rcRshGetParameterValue

Get the value of a library-specific setting.

Syntax

value = rcRshGetParameterValue(rsh,paramName)

Description

value = rcRshGetParameterValue(rsh,paramName) returns the value of library-specific setting paramName from .rsh file rshId.

Parameters of any data type may be queried by rcRshGetParameterValue. The return value is always a string.

Valid parameters names are listed in the |4:Reactis Parameters|] section of the API chapter in the Reactis for C User's Guide.

Examples

v = rcRshGetParameterValue(rsh,'OnIntegerOverflow');

See Also

rcRshOpen, rcRshSetParameterValue


rcRshSetParameterValue

Set the value of a project-specific setting.

Syntax

rcRshSetParameterValue(rshId, paramName, Value)

Description

rcRshSetParameterValue(rshId, paramName, Value) sets project-specific setting paramName to Value in .rsh file rshId.

Parameters of any data type may be set by rcRshSetParameterValue but the paramValue argument must be given as a string.

Currently supported parameters are:

Parameter Name Allowed Values Description
CreateTesterParameterFiles Boolean When creating a test suite, also create a parameters file (extension '.rtp').
CoverageCStatement Boolean Enable/disable the C Statement coverage metric.
CoverageCFunction Boolean Enable/disable the C Function coverage metric.
CoverageCFunctionCall Boolean Enable/disable the C Function Call coverage metric.
CoverageDecision Boolean Enable/disable the Decision coverage metric.
CoverageCondition Boolean Enable/disable the Condition coverage metric.
CoverageMCDC Boolean Enable/disable the MC/DC coverage metric.
CoverageMCC Boolean Enable/disable the MCC coverage metric.
CoverageMCCMaxNumConditions Non-negative integer The maximum number of conditions per decision for which MCC coverage will be tracked.
CoverageBoundary Boolean Enable/disable the Boundary coverage metric.
CoverageUserTarget Boolean Enable/disable the User Defined Target coverage metric.
CoverageAssertion Boolean Enable/disable the Assertion coverage metric.
DoCCaching Boolean Create and use cache files (files with extension '.rso', '.rsls', '.rsld', or '.rsx').
CDecisionMetric possible values: ifwhilefor, branching, nonstatic, all Specifies the criteria for determining which expressions are decisions.
ifwhilefor expressions which control if/while/for statements.
branching expressions which control if/while/for statements or the ? operator.
nonstatic All non-trivial Boolean expressions except static initializers.
all Same as 'nonstatic' (may change in future).
CLoopDetectionTimeout double in range 0.0 to 1e300 Maximum time for Reactis to compute a simulation step. If the computation of a simulation step takes longer, Reactis assumes there is an infinite loop; the simulation is then terminated and an error message printed.
OnCUndefinedFunctionCall possible values: none, error The action taken when an undefined function is called. When set to 'none', Reactis stubs each undefined function that is called with a function that returns zero.
OnCUndefinedExternVar possible values: none, error The action taken when an undefined function is accessed. When set to 'none', Reactis stubs each undefined variable by creating an instance which is initialized to zero.
CPromoteFloatToDouble Boolean Enable/disable the implicit promotion of float values to double before performing calculations. Setting this to true provides greater accuracy and compatibility with many compilers. For strict C99 compliance, this should be set to false.
OnShiftOutOfRange possible values: none, warning, error, inherit The action to take when a value is shifted by an amount which is either (a) greater than or equal to the width of the value, or (b) negative.
DeltaExceedsTypeRange possible values: none, warning, error The action to take when the delta setting for an input type is larger than the range of the input type.
Tolerance real The default relative tolerance to use when comparing actual output values to expected output values.
OnCIntegerOverflow possible values: none, warning, error The action to take when a signed integer overflow occurs.
OnCUnsignedIntegerOverflow possible values: none, warning, error The action to take when an unsigned integer overflow occurs.
OnCIntegerConversionOverflow possible values: none, warning, error, inherit The action to take when an overflow occurs while converting an unsigned integer value to a signed integer value.
OnCFloatToUIntConversionOverflow possible values: none, warning, error, inherit The action to take when an overflow occurs while converting an unsigned integer value to a signed integer value.
OnCDetectInfNan possible values: none, warning, error, inherit The action to take when the evaluation of an expression produces an infinite (inf) or not-a-number (nan) value, and none of the input values to the expression were inf or nan.
OnCInvalidPointer possible values: none, warning, error The action to take when an invalid pointer is created. This can be useful in limited circumstances, but note that it is quite common for C programs to create invalid pointers which are never dereferenced.
OnCEmptyStruct possible values: none, warning, error The action to take when a struct is declared with no members. For strict C99 compliance, this should be set to 'error'.

Examples

rcRshSetParameterValue(rsh,'OnIntegerOverflow','warning');

See Also

rcRshOpen, rcRshGetParameterValue


rcRshGetCoverageEnabled

Get enabled/disabled status of a coverage metric.

Syntax

B = rcRshGetCoverageEnabled(rshId, metricName)

Description

B = rcRshGetCoverageEnabled(rshId, metricName) returns 1 if coverage metric metricName is enabled and 0 otherwise. rshId is an .rsh file identifier returned by rcRshOpen. metricName is a string which may be any of the following: CStatement, Decision, Condition, MCDC, MCC, Boundary, UserTarget, Assertion, CFunction, CFunctionCall.

See Also

rcRshOpen, rcRshSetCoverageEnabled


rcRshSetCoverageEnabled

Set enabled/disabled status of a coverage metric.

Syntax

rcRshSetCoverageEnabled(rshId, metricName, 1)
rcRshSetCoverageEnabled(rshId, metricName, 0)

Description

rcRshSetCoverageEnabled(rshId, metricName, 1) enables coverage tracking for metric metricName.

rcRshSetCoverageEnabled(rshId, metricName, 0) disables coverage tracking for metric metricName.

rshId is an .rsh file identifier returned by rcRshOpen. metricName is a string which may be any of the following: CStatement, Decision, Condition, MCDC, MCC, Boundary, UserTarget, Assertion, CFunction, CFunctionCall.

Note that coverage can also be enabled or disabled by using rcRshSetParameterValue to change the corresponding coverage parameter. For example, rcRshSetCoverageEnabled(rshId, 'Decision', 1) has the same effect as rcRshSetParameterValue(rshId, 'CoverageDecision', '1').

See Also

rcRshOpen, rcRshGetCoverageEnabled


rcRshGetEntryFunCandidates

Find functions which could potentially be used as an entry function in a test harness.

Syntax

entries = rcRshGetEntryFunCandidates(rshId)

Description

entries = rcRshGetEntryFunCandidates(rshId) returns a cell array of structs containing the name and full name of every entry function candidate.

See Also

rcRshOpen, rcRshHarnessCreate, rcRshHarnessCopy


rcRshGetInitFunCandidates

Find functions which could potentially be used as an initialization function in a test harness.

Syntax

inits = rcRshGetInitFunCandidates(rshId)

Description

inits = rcRshGetInitFunCandidates(rshId) returns a cell array of structs containing the name and full name of every initialization function candidate.

See Also

rcRshOpen, rcRshHarnessCreate, rcRshHarnessCopy