Compare component under test between harness model and main model
[CheckResult,CheckDetails] = sltest.harness.check(harnessOwner,harnessName)
computes the checksum of the component under test in the harness model
harnessName and compares it to the checksum of the component
harnessOwner in the main model, returning the overall
CheckResult and additional
CheckDetails of the
This example shows how to compare a component under test between the main model and the test harness. Comparing the component under test can help you determine if the CUT contains unsynchronized changes.
Controller subsystem in the
f14 model against the
Controller subsystem in a test harness.
1. Load the model.
2. Create a test harness for
3. Run the comparison.
[CheckResult,CheckDetails] = sltest.harness.check('f14/Controller',... 'ControllerHarness');
4. View the overall result.
CheckResult = logical 1
5. View the details of the comparison.
CheckDetails = struct with fields: overall: 1 contents: 1 reason: 'The checksum of the harnessed component and the component in the main model are same.'
harnessOwner— Model or component
Model or component handle or path, specified as a character vector or double.
harnessName— Harness name
The name of the harness, specified as a character vector.
CheckResult— Result of comparison
The result of the component comparison between the harness model and the system model, returned as true or false.
For a block diagram harness, the function returns
For a virtual subsystem harness, the function returns
CheckDetails— Details of the check operation
Details of the check operation, returned as a structure. Structure fields contain the
comparison results for the overall component, the component contents, the component interface,
and a reason for the comparison result. If
false, rebuild the test harness and retry