Main Content

getFaultSets

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

Get fault sets in test case

Since R2024a

Syntax

fs = getFaultSets(tc)
fs = getFaultSets(tc,SimulationIndex=index)

Description

fs = getFaultSets(tc) returns the fault sets in the specified test case. You must have Simulink® Fault Analyzer™ to use this method.

fs = getFaultSets(tc,SimulationIndex=index) returns the fault sets in the equivalence test that has the specified simulation number, index.

Input Arguments

expand all

Test case that you want to get the fault set from, specified as a sltest.testmanager.TestCase object.

Equivalence test case simulation number that this fault set applies to, specified as an integer, 1 or 2. You can use this argument only for fault sets in an equivalence test. See Test Two Simulations for Equivalence.

Output Arguments

expand all

Fault set, returned as a sltest.testmanager.FaultSet object array.

Examples

expand all

Suppose you have a test file named myTestFile that has a test suite, test case, and a fault set. Load the test file, get the test suite, get the test case, and then retrieve fault set.

tf = sltest.testmanager.TestFile("myTestFile.mldatx");
ts = getTestSuites(tf);
tc = getTestCases(ts);
faultSet = getFaultSets(tc);

Suppose you have a test file named myTestFile that has a test suite, an equivalence test case, and each equivalence test has a fault set. Load the test file, get the test suite, get the test case, and then retrieve the fault set from the first equivalence test.

tf = sltest.testmanager.TestFile("myTestFile.mldatx");
ts = getTestSuites(tf);
tc = getTestCases(ts);
faultSet = getFaultSets(tc,SimulationIndex=1);

Version History

Introduced in R2024a