Main Content

getEquivalenceCriteria

Class: sltest.testmanager.TestCase
Namespace: sltest.testmanager

Get equivalence criteria from test case

Syntax

eq = getEquivalenceCriteria(tc)

Description

eq = getEquivalenceCriteria(tc) gets the equivalence criteria set from the test case. The function returns an equivalence criteria object, sltest.testmanager.EquivalenceCriteria. This function can be used only if the test type is an equivalence test case.

Input Arguments

expand all

Test case to get equivalence criteria from, specified as an sltest.testmanager.TestCase object.

Output Arguments

expand all

Equivalence criteria in the test case, returned as an sltest.testmanager.EquivalenceCriteria object.

Examples

expand all

% Open the model for this example
openExample('sldemo_absbrake');

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'equivalence','Equivalence Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');
remove(tsDel);

% Assign the system under test to the test case
% for Simulation 1 and Simulation 2
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',1);
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',2);

% Capture equivalence criteria
eq = captureEquivalenceCriteria(tc);

% Set the equivalence criteria tolerance for one signal
sc = getSignalCriteria(eq);
sc(1).AbsTol = 2.2;

% Get and check the equivalence criteria
eq = getEquivalenceCriteria(tc);

Version History

Introduced in R2015b