Main Content

getParameterSets

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

Get test case parameter sets

Syntax

psets = getParameterSets(tc)
psets = getParameterSets(tc,simulationIndex)

Description

psets = getParameterSets(tc) gets the parameter sets in a test case and returns them as an array of parameter set objects, sltest.testmanager.ParameterSet.

psets = getParameterSets(tc,simulationIndex) gets the parameter sets in a test case and returns them as an array of parameter set objects, sltest.testmanager.ParameterSet. If the test case is an equivalence test case, then specify the simulation index.

Input Arguments

expand all

Test case to get test inputs from, specified as an sltest.testmanager.TestCase object.

Simulation number that the parameter sets apply to, specified as an integer, 1 or 2. This setting applies to the simulation test case where there are two simulations. For baseline and simulation test cases, the default simulation index is 1.

Output Arguments

expand all

Parameter sets that belong to the test case, returned as an array of sltest.testmanager.ParameterSet objects.

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,'baseline','Baseline API Test Case');

% Assign the system under test to the test case
setProperty(tc,'Model','sldemo_absbrake');

% Test a new model parameter by overriding it in the test case
% parameter set
ps = addParameterSet(tc,'Name','API Parameter Set');
po = addParameterOverride(ps,'m',55);

% Get and check the parameter set
psets = getParameterSets(tc);

Version History

Introduced in R2015b