Main Content

getSpecifiedFaults

Class: sltest.testmanager.FaultSet
Namespace: sltest.testmanager

Get faults in fault set

Since R2024a

Syntax

specifiedFaults = getSpecifiedFaults(fs)

Description

specifiedFaults = getSpecifiedFaults(fs) returns the faults in the specified fault set. You must have Simulink® Fault Analyzer™ to use this method.

Input Arguments

expand all

Fault set, specified as a sltest.testmanager.FaultSet object.

Output Arguments

expand all

Faults in the fault set, returned as a sltest.testmanager.SpecifiedFault object.

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 and get the test suite, test case, and fault set. Then, retrieve the faults added to the fault set.

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

Version History

Introduced in R2024a