A Discrete-Event Network Simulator
API
ns3::TestCase Class Referenceabstract

encapsulates test code More...

#include "test.h"

Inherited by AbstractAnimationInterfaceTestCase, AcousticModemEnergyDepletionTestCase, AcousticModemEnergyTestCase, AddressAllocator6TestCase, AddressAllocatorHelperTestCase, AddressAllocatorTestCase, AddressCollision6TestCase, AddressCollisionTestCase, AmpduAggregationTest, AnnexC_TestCase, AredQueueDiscTestCase, AttributeContainerSerializationTestCase, AttributeContainerSetGetTestCase, AttributeContainerTestCase, AttributeTestCase< T >, BasicCallbackTestCase, BasicEnergyHarvesterTestCase, BasicTracedCallbackTestCase, BitDeserializerTest, BitSerializerTest, BlockAckAggregationDisabledTest, BlockAckRecipientBufferTest, BoxLineIntersectionTestCase, BridgeTest, BriteTopologyFunctionTestCase, BriteTopologyStructureTestCase, BufferTest, Bug2222TestCase, Bug2470TestCase, Bug2831TestCase, Bug2843TestCase, Bug730TestCase, Bug772ChainTest, BuildingsChannelConditionModelTestCase, BuildingsHelperOneTestCase, BuildingsPathlossTestCase, BuildingsShadowingTestCase, BulkSendBasicTestCase, BulkSendSeqTsSizeTestCase, BurstErrorModelSimple, CallbackValueTestCase, CarrierAggregationConfigTestCase, CarrierAggregationTestCase, CartesianToGeoTestCase, ChainRegressionTest, ChannelAccessManagerTest< TxopType >, ChannelAccessTestCase, ChannelCoordinationTestCase, ChannelRoutingTestCase, ClassicRecoveryTest, CoDelQueueDiscBasicDrop, CoDelQueueDiscBasicEnqueueDequeue, CoDelQueueDiscBasicMark, CoDelQueueDiscBasicOverflow, CoDelQueueDiscControlLawTest, CoDelQueueDiscNewtonStepTest, CobaltQueueDiscBasicEnqueueDequeue, CobaltQueueDiscCeThresholdTest, CobaltQueueDiscDropTest, CobaltQueueDiscEnhancedBlueTest, CobaltQueueDiscMarkTest, CollisionTestCase, CosineAntennaModelTestCase, CsmaBridgeTestCase, CsmaBroadcastTestCase, CsmaMulticastTestCase, CsmaOneSubnetTestCase, CsmaPacketSocketTestCase, CsmaPingTestCase, CsmaRawIpSocketTestCase, CsmaStarTestCase, CtrlBAckResponseHeaderTest, DataRateTestCase, DcfImmediateAccessBroadcastTestCase, DegreesToRadiansTestCase, DeprecatedAttributeTestCase, DhcpTestCase, DiffTestCase, DropTailQueueTestCase, DsaRequestTestCase, DsdvHeaderTestCase, DsdvTableTestCase, DsrAckHeaderTest, DsrAckReqHeaderTest, DsrCacheEntryTest, DsrFsHeaderTest, DsrRerrHeaderTest, DsrRrepHeaderTest, DsrRreqHeaderTest, DsrRreqTableTest, DsrSRHeaderTest, DsrSendBuffTest, DualStackTestCase, EpcS1uDlTestCase, EpcS1uUlTestCase, EpcTftClassifierTestCase, EpsGtpuHeaderTestCase, ErrorModelSimple, ExampleAddress6GeneratorTestCase, ExampleAddressGeneratorTestCase, FifoQueueDiscTestCase, FileHeaderTestCase, FiveDoublesAverageTestCase, FiveDoublesTestCase, FiveIntegersAverageTestCase, FiveIntegersTestCase, FlameHeaderTest, FlameRegressionTest, FlameRtableTest, FqCoDelQueueDiscDeficit, FqCoDelQueueDiscECNMarking, FqCoDelQueueDiscIPFlowsSeparationAndPacketLimit, FqCoDelQueueDiscL4sMode, FqCoDelQueueDiscNoSuitableFilter, FqCoDelQueueDiscSetLinearProbing, FqCoDelQueueDiscTCPFlowsSeparation, FqCoDelQueueDiscUDPFlowsSeparation, FqCobaltQueueDiscDeficit, FqCobaltQueueDiscEcnMarking, FqCobaltQueueDiscIPFlowsSeparationAndPacketLimit, FqCobaltQueueDiscL4sMode, FqCobaltQueueDiscNoSuitableFilter, FqCobaltQueueDiscSetLinearProbing, FqCobaltQueueDiscTCPFlowsSeparation, FqCobaltQueueDiscUDPFlowsSeparation, FqPieQueueDiscDeficit, FqPieQueueDiscIPFlowsSeparationAndPacketLimit, FqPieQueueDiscL4sMode, FqPieQueueDiscNoSuitableFilter, FqPieQueueDiscSetLinearProbing, FqPieQueueDiscTCPFlowsSeparation, FqPieQueueDiscUDPFlowsSeparation, FriisPropagationLossModelTestCase, GeoToCartesianTestCase, GlobalRouteManagerImplTestCase, HeAggregationTest, HeRuMcsDataRateTestCase, HeSigBDurationTest, HistogramTestCase, HwmpDoRfRegressionTest, HwmpProactiveRegressionTest, HwmpReactiveRegressionTest, HwmpRtableTest, HwmpSimplestRegressionTest, IcmpEchoReplyTestCase, IcmpTimeExceedTestCase, IcmpV6EchoReplyTestCase, IcmpV6TimeExceedTestCase, IdealRateManagerChannelWidthTest, IdealRateManagerMimoTest, IntegerTraceSourceAttributeTestCase, IntegerTraceSourceTestCase, InterferenceHelperSequenceTest, IpAddressHelperTestCasev4, IpAddressHelperTestCasev6, Ipv4DeduplicationPerformanceTest, Ipv4DeduplicationTest, Ipv4DynamicGlobalRoutingTestCase, Ipv4ForwardingTest, Ipv4FragmentationTest, Ipv4GlobalRoutingSlash32TestCase, Ipv4HeaderTest, Ipv4L3ProtocolTestCase, Ipv4ListRoutingNegativeTestCase, Ipv4ListRoutingPositiveTestCase, Ipv4PacketInfoTagTest, Ipv4RawSocketImplTest, Ipv4RipCountToInfinityTest, Ipv4RipSplitHorizonStrategyTest, Ipv4RipTest, Ipv4StaticRoutingSlash32TestCase, Ipv6AddressTestCase, Ipv6DadTest, Ipv6ForwardingTest, Ipv6FragmentationTest, Ipv6L3ProtocolTestCase, Ipv6ListRoutingNegativeTestCase, Ipv6ListRoutingPositiveTestCase, Ipv6PacketInfoTagTest, Ipv6RawSocketImplTest, Ipv6RipngCountToInfinityTest, Ipv6RipngSplitHorizonStrategyTest, Ipv6RipngTest, IsotropicAntennaModelTestCase, Issue169TestCase, Issue211Test, Issue40TestCase, ItuR1411LosPropagationLossModelTestCase, ItuR1411NlosOverRooftopPropagationLossModelTestCase, Kun2600MhzPropagationLossModelTestCase, LanTest, LenaCqaFfMacSchedulerTestCase1, LenaCqaFfMacSchedulerTestCase2, LenaDataPhyErrorModelTestCase, LenaDlCtrlPhyErrorModelTestCase, LenaFdBetFfMacSchedulerTestCase1, LenaFdBetFfMacSchedulerTestCase2, LenaFdMtFfMacSchedulerTestCase, LenaFdTbfqFfMacSchedulerTestCase1, LenaFdTbfqFfMacSchedulerTestCase2, LenaHarqTestCase, LenaMimoTestCase, LenaPfFfMacSchedulerTestCase1, LenaPfFfMacSchedulerTestCase2, LenaPssFfMacSchedulerTestCase1, LenaPssFfMacSchedulerTestCase2, LenaRrFfMacSchedulerTestCase, LenaTdBetFfMacSchedulerTestCase1, LenaTdBetFfMacSchedulerTestCase2, LenaTdMtFfMacSchedulerTestCase, LenaTdTbfqFfMacSchedulerTestCase1, LenaTdTbfqFfMacSchedulerTestCase2, LenaTtaFfMacSchedulerTestCase, LengthTestCase, LengthValueTestCase, LiIonEnergyTestCase, LinkTest, LogDistancePropagationLossModelTestCase, LollipopCounterTest, LookupTimeTestCase, LrWpanAckTestCase, LrWpanCcaTestCase, LrWpanCollisionTestCase, LrWpanDataIfsTestCase, LrWpanEdTestCase, LrWpanErrorDistanceTestCase, LrWpanErrorModelTestCase, LrWpanPacketTestCase, LrWpanPlmeAndPdInterfaceTestCase, LrWpanSlottedCsmacaTestCase, LrWpanSpectrumValueHelperTestCase, LteAggregationThroughputScaleTestCase, LteCellSelectionTestCase, LteCqiGenerationDlPowerControlTestCase, LteCqiGenerationTestCase, LteDownlinkCtrlSinrTestCase, LteDownlinkDataSinrTestCase, LteDownlinkPowerControlRrcConnectionReconfigurationTestCase, LteDownlinkPowerControlSpectrumValueTestCase, LteDownlinkPowerControlTestCase, LteEarfcnTestCase, LteEnbAntennaTestCase, LteEpcE2eDataTestCase, LteFrAreaTestCase, LteFrTestCase, LteHandoverDelayTestCase, LteHandoverTargetTestCase, LteInterferenceHardFrTestCase, LteInterferenceStrictFrTestCase, LteInterferenceTestCase, LteIpv6RoutingTestCase, LteLinkAdaptationTestCase, LteNoisePsdTestCase, LtePathlossModelSystemTestCase, LtePrimaryCellChangeTestCase, LteRadioLinkFailureTestCase, LteRlcAmE2eTestCase, LteRlcAmTransmitterTestCase, LteRlcUmE2eTestCase, LteRlcUmTransmitterTestCase, LteRrcConnectionEstablishmentTestCase, LteSecondaryCellHandoverTestCase, LteSecondaryCellSelectionTestCase, LteSpectrumModelTestCase, LteTxPsdTestCase, LteUeMeasurementsHandoverTestCase, LteUeMeasurementsPiecewiseTestCase1, LteUeMeasurementsPiecewiseTestCase2, LteUeMeasurementsPiecewiseTestCase3, LteUeMeasurementsTestCase, LteUplinkDataSinrTestCase, LteUplinkPowerControlTestCase, LteUplinkSrsSinrTestCase, LteX2HandoverMeasuresTestCase, LteX2HandoverTestCase, MakeBoundCallbackTestCase, MakeCallbackTemplatesTestCase, MakeCallbackTestCase, MatrixPropagationLossModelTestCase, MeshHeaderTest, MeshInformationElementVectorBist, MobilityTraceTestCase, MultiStaCtrlBAckResponseHeaderTest, NetworkAllocatorHelperTestCase, NetworkAndAddress6TestCase, NetworkAndAddressTestCase, NetworkNumber6AllocatorTestCase, NetworkNumberAllocatorTestCase, NixVectorRoutingTest, Ns2MobilityHelperTest, Ns3TcpLossTestCase, Ns3TcpNoDelayTestCase, Ns3TcpSocketTestCaseCsma, Ns3TcpSocketTestCaseP2P, Ns3TcpStateTestCase, Ns3WimaxCsParamTlvTestCase, Ns3WimaxFragmentationTestCase, Ns3WimaxManagementConnectionsTestCase, Ns3WimaxNetworkEntryTestCase, Ns3WimaxSFTypeTestCase, Ns3WimaxSNRtoBLERTestCase, Ns3WimaxSchedulingTestCase, Ns3WimaxSfCreationTestCase, Ns3WimaxSfTlvTestCase, Ns3WimaxSimpleOFDMTestCase, NullifyCallbackTestCase, ObjectMapAttributeTestCase, ObjectVectorAttributeTestCase, OcbWifiMacTestCase, OfdmaAckSequenceTest, OkumuraHataPropagationLossModelTestCase, OlsrEmfTestCase, OlsrHelloTestCase, OlsrHnaTestCase, OlsrMidTestCase, OlsrMprTestCase, OlsrTcTestCase, OneIntegerAverageTestCase, OneIntegerTestCase, OneVectorConstructorTestCase, OriginatorBlockAckWindowTest, OutdoorRandomWalkTestCase, PacketBufferingCaseA, PacketBufferingCaseB, PacketLossCounterTestCase, PacketMetadataTest, PacketSocketAppsTest, PacketTagListTest, PacketTest, PairValueSettingsTestCase, PairValueTestCase, ParabolicAntennaModelTestCase, PbbTestCase, PeerLinkFrameStartTest, PeerManagementProtocolRegressionTest, PfifoFastQueueDiscDscpPrioritization, PfifoFastQueueDiscNoPriority, PfifoFastQueueDiscOverflow, PfifoFastQueueDiscTosPrioritization, PhyHeaderSectionsTest, PieQueueDiscTestCase, PointToPointTest, PointerAttributeTestCase, PowerRateAdaptationTest, PreservePacketsInAmpdus, PrioQueueDiscTestCase, ProbeTestCase1, PrrRecoveryTest, QkdTestCase1, QosFragmentationTestCase, QosUtilsIsOldPacketTest, QueueDiscTracesTestCase, RadiansToDegreesTestCase, RadvdTestCase, RandCartAroundGeoTestCase, RandomRoomPositionAllocatorTestCase, RandomVariableStreamAttributeTestCase, RangePropagationLossModelTestCase, ReadFileTestCase, ReadModeCreateTestCase, RecordHeaderTestCase, RedQueueDiscTestCase, ResetAllocatorHelperTestCase, RngExponentialTestCase, RngNormalTestCase, RngParetoTestCase, RngUniformTestCase, RocketfuelTopologyReaderTest, RrcHeaderTestCase, RttEstimatorTestCase, SameRoomPositionAllocatorTestCase, SequenceNumberTestCase, SetChannelFrequencyTest, SimulatorEventsTestCase, SimulatorTemplateTestCase, SixlowpanFragmentationTest, SixlowpanHc1ImplTest, SixlowpanIphcImplTest, SixlowpanIphcStatefulImplTest, SpectrumIdealPhyTestCase, SpectrumInterferenceTestCase, SpectrumValueTestCase, SpectrumWifiPhyBasicTest, SpectrumWifiPhyFilterTest, StaWifiMacScanningTestCase, SteadyStateRandomWaypointTest, SwitchFlowTableTestCase, TableBasedErrorRateTestCase, TbfQueueDiscTestCase, TcFlowControlTestCase, TcpBicDecrementTest, TcpBicIncrementTest, TcpDctcpToLinuxReno, TcpEndPointBug2211Test, TcpHeaderFlagsToString, TcpHeaderGetSetTestCase, TcpHeaderWithRFC793OptionTestCase, TcpHighSpeedDecrementTest, TcpHighSpeedIncrementTest, TcpHtcpIncrementTest, TcpHyblaIncrementTest, TcpIllinoisTest, TcpLedbatDecrementTest, TcpLedbatIncrementTest, TcpLedbatToNewReno, TcpOptionTSTestCase, TcpOptionWSTestCase, TcpRateLinuxBasicTest, TcpRateLinuxWithBufferTest, TcpRxBufferTestCase, TcpScalableDecrementTest, TcpScalableIncrementTest, TcpSynConnectionFailedTest, TcpTestCase, TcpTxBufferTestCase, TcpVegasTest, TcpVenoTest, TcpYeahDecrementTest, TcpYeahIncrementTest, TestAmpduReception, TestDlOfdmaPhyTransmission, TestEmptyOptionField, TestFulfilledAlignment, TestInterBssConstantObssPdAlgo, TestMultipleHeTbPreambles, TestOptionWithAlignment, TestOptionWithoutAlignment, TestPhyHeadersReception, TestPhyPaddingExclusion, TestSimpleFrameCaptureModel, TestThresholdPreambleDetectionWithFrameCapture, TestThresholdPreambleDetectionWithoutFrameCapture, TestUlOfdmaPhyTransmission, TestUlOfdmaPowerControl, TestUlOfdmaPpduUid, TestUnsupportedModulationReception, ThreadedSimulatorEventsTestCase, ThreeGppChannelConditionModelTestCase, ThreeGppChannelMatrixComputationTest, ThreeGppChannelMatrixUpdateTest, ThreeGppHttpObjectTestCase, ThreeGppIndoorOfficePropagationLossModelTestCase, ThreeGppRmaPropagationLossModelTestCase, ThreeGppShadowingTestCase, ThreeGppSpectrumPropagationLossModelTest, ThreeGppUmaPropagationLossModelTestCase, ThreeGppUmiPropagationLossModelTestCase, ThreeGppV2vBuildingsChCondModelTestCase, ThreeGppV2vHighwayLosNlosvChCondModelTestCase, ThreeGppV2vHighwayPropagationLossModelTestCase, ThreeGppV2vUrbanLosNlosvChCondModelTestCase, ThreeGppV2vUrbanPropagationLossModelTestCase, TimeInputOutputTestCase, TimeSimpleTestCase, TimeWithSignTestCase, TimerStateTestCase, TimerTemplateTestCase, TimestampValueTestCase, TracedCallbackTestCase, TracedCallbackTypedefTestCase, TracedValueCallbackTestCase, TupleValueTestCase, TvHelperDistributionTestCase, TvSpectrumTransmitterTestCase, TwoBridgeTest, TwoLanTest, TwoLevelAggregationTest, TwoLinkTest, TwoRayGroundPropagationLossModelTestCase, TwoVectorsConstructorTestCase, TxDurationTest, UanTest, Udp6SocketImplTest, Udp6SocketLoopbackTest, UdpClientServerTestCase, UdpEchoClientSetFillTestCase, UdpSocketImplTest, UdpSocketLoopbackTest, UdpTraceClientServerTestCase, UniformPlanarArrayTestCase, UniqueTypeIdTestCase, V2vHighwayProbChCondModelTestCase, V2vUrbanProbChCondModelTestCase, WaveformGeneratorTestCase, WaypointInitialPositionIsWaypoint, WaypointLazyNotifyFalse, WaypointLazyNotifyTrue, WaypointMobilityModelAddWaypointTest, WaypointMobilityModelNotifyTest, WaypointMobilityModelViaHelper, WifiAcMappingTest, WifiChannelSwitchingTest, WifiErrorRateModelsTestCaseDsss, WifiErrorRateModelsTestCaseMimo, WifiErrorRateModelsTestCaseNist, WifiMacQueueDropOldestTest, WifiMsduAggregatorThroughputTest, WifiOfdmMaskSlopesTestCase, WifiPhyThresholdsTest, WifiPrimaryChannelsTest, WifiTest, WifiTxopTest, WriteModeCreateTestCase, ns3::ExampleAsTestCase, ns3::LenaDeactivateBearerTestCase, ns3::RlcAmStatusPduTestCase, ns3::TcpBbrCheckGainValuesTest, ns3::TcpBbrPacingEnableTest, ns3::TcpGeneralTest, ns3::TcpLpInferenceTest1, ns3::TcpLpInferenceTest2, ns3::TcpLpToNewReno, ns3::TestSuite, ns3::aodv::AodvRqueueTest, ns3::aodv::AodvRtableEntryTest, ns3::aodv::AodvRtableTest, ns3::aodv::IdCacheTest, ns3::aodv::LoopbackTestCase, ns3::aodv::NeighborTest, ns3::aodv::QueueEntryTest, ns3::aodv::RerrHeaderTest, ns3::aodv::RrepAckHeaderTest, ns3::aodv::RrepHeaderTest, ns3::aodv::RreqHeaderTest, ns3::aodv::TypeHeaderTest, ns3::int64x64::test::Int64x64ArithmeticTestCase, ns3::int64x64::test::Int64x64Bug1786TestCase, ns3::int64x64::test::Int64x64Bug455TestCase, ns3::int64x64::test::Int64x64Bug863TestCase, ns3::int64x64::test::Int64x64CompareTestCase, ns3::int64x64::test::Int64x64DoubleTestCase, ns3::int64x64::test::Int64x64HiLoTestCase, ns3::int64x64::test::Int64x64ImplTestCase, ns3::int64x64::test::Int64x64InputOutputTestCase, ns3::int64x64::test::Int64x64InputTestCase, ns3::int64x64::test::Int64x64IntRoundTestCase, ns3::int64x64::test::Int64x64InvertTestCase, ns3::olsr::Bug780Test, ns3::olsr::HelloRegressionTest, ns3::olsr::TcRegressionTest, ns3::test::RandomVariable::TestCaseBase, ns3::tests::AggregateObjectTestCase, ns3::tests::AlternateFindTestCase, ns3::tests::BasicAddTestCase, ns3::tests::BasicFindTestCase, ns3::tests::BasicRenameTestCase, ns3::tests::BuildProfileTestCase, ns3::tests::CommandLineTestCaseBase, ns3::tests::CreateObjectTestCase, ns3::tests::EventGarbageCollectorTestCase, ns3::tests::FindPathTestCase, ns3::tests::FullyQualifiedAddTestCase, ns3::tests::FullyQualifiedFindTestCase, ns3::tests::FullyQualifiedRenameTestCase, ns3::tests::GlobalValueTestCase, ns3::tests::HashTestCase, ns3::tests::ManyUniformRandomVariablesOneGetValueCallTestCase, ns3::tests::ObjectFactoryTestCase, ns3::tests::ObjectVectorConfigTestCase, ns3::tests::ObjectVectorTraceConfigTestCase, ns3::tests::OneUniformRandomVariableManyGetValueCallsTestCase, ns3::tests::PtrTestCase, ns3::tests::RelativeAddTestCase, ns3::tests::RelativeFindTestCase, ns3::tests::RelativeRenameTestCase, ns3::tests::RootNamespaceConfigTestCase, ns3::tests::SampleTestCase1, ns3::tests::SearchAttributesOfParentObjectsTestCase, ns3::tests::StringContextAddTestCase, ns3::tests::StringContextFindTestCase, ns3::tests::StringContextRenameTestCase, ns3::tests::TrickleTimerTestCase, ns3::tests::TypeTraitsTestCase, ns3::tests::UnderRootNamespaceConfigTestCase, and ns3::tests::WatchdogTestCase.

+ Collaboration diagram for ns3::TestCase:

Classes

struct  Result
 Container for results from a TestCase. More...
 

Public Types

enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Public Member Functions

 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
Internal Interface

These methods are the interface used by test macros and should not be used directly by normal test code.

void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase. More...
 
bool MustAssertOnFailure (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Private Member Functions

virtual void DoRun (void)=0
 Implementation to actually run this TestCase. More...
 
virtual void DoSetup (void)
 Implementation to do any local setup required for this TestCase. More...
 
virtual void DoTeardown (void)
 Implementation to do any local setup required for this TestCase. More...
 
bool IsFailed (void) const
 Check if any tests failed. More...
 
void Run (TestRunnerImpl *runner)
 Actually run this TestCase. More...
 

Private Attributes

std::vector< TestCase * > m_children
 Vector of my children. More...
 
std::string m_dataDir
 My data directory. More...
 
enum TestDuration m_duration
 TestCase duration. More...
 
std::string m_name
 TestCase name. More...
 
TestCasem_parent
 Pointer to my parent TestCase. More...
 
struct Resultm_result
 Results data. More...
 
TestRunnerImplm_runner
 Pointer to the TestRunner. More...
 

Friends

class TestRunnerImpl
 Needs access to the TestCase data members. More...
 

Detailed Description

encapsulates test code

To allow a new test to be run within the ns-3 test framework, users need to create subclasses of this base class, override the DoRun method, and use the NS_TEST_* macros within DoRun.

See also
sample-test-suite.cc

Definition at line 993 of file test.h.

Member Enumeration Documentation

◆ TestDuration

How long the test takes to execute.

Enumerator
QUICK 

Fast test.

EXTENSIVE 

Medium length test.

TAKES_FOREVER 

Very long running test.

Definition at line 997 of file test.h.

Constructor & Destructor Documentation

◆ ~TestCase()

ns3::TestCase::~TestCase ( )
virtual

Destructor.

Definition at line 285 of file test.cc.

References m_children, m_parent, m_result, m_runner, NS_ASSERT, and NS_LOG_FUNCTION.

◆ TestCase() [1/2]

ns3::TestCase::TestCase ( const TestCase )
delete

◆ TestCase() [2/2]

ns3::TestCase::TestCase ( std::string  name)
protected

Constructor.

Parameters
[in]nameThe name of the new TestCase created

Definition at line 274 of file test.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddTestCase()

void ns3::TestCase::AddTestCase ( TestCase testCase,
enum TestCase::TestDuration  duration = QUICK 
)
protected

Add an individual child TestCase to this test suite.

Parameters
[in]testCasePointer to the TestCase object to be added.
[in]durationAmount of time this test takes to execute (defaults to QUICK).

Definition at line 299 of file test.cc.

References m_children, m_duration, m_name, m_parent, NS_LOG_FUNCTION, and NS_LOG_UNCOND.

Referenced by AnglesTestSuite::AnglesTestSuite(), AnimationInterfaceTestSuite::AnimationInterfaceTestSuite(), ns3::aodv::AodvLoopbackTestSuite::AodvLoopbackTestSuite(), ns3::aodv::AodvTestSuite::AodvTestSuite(), AredQueueDiscTestSuite::AredQueueDiscTestSuite(), Asn1EncodingSuite::Asn1EncodingSuite(), AttributeContainerTestSuite::AttributeContainerTestSuite(), AttributesTestSuite::AttributesTestSuite(), AverageTestSuite::AverageTestSuite(), BasicDataCalculatorsTestSuite::BasicDataCalculatorsTestSuite(), BasicEnergyHarvesterTestSuite::BasicEnergyHarvesterTestSuite(), BitSerializerTestSuite::BitSerializerTestSuite(), BlockAckTestSuite::BlockAckTestSuite(), BoxLineIntersectionTestSuite::BoxLineIntersectionTestSuite(), BriteTestSuite::BriteTestSuite(), BufferTestSuite::BufferTestSuite(), BuildingPositionAllocatorTestSuite::BuildingPositionAllocatorTestSuite(), BuildingsChannelConditionModelsTestSuite::BuildingsChannelConditionModelsTestSuite(), BuildingsHelperTestSuite::BuildingsHelperTestSuite(), BuildingsPathlossTestSuite::BuildingsPathlossTestSuite(), BuildingsShadowingTestSuite::BuildingsShadowingTestSuite(), ns3::tests::BuildProfileTestSuite::BuildProfileTestSuite(), BulkSendTestSuite::BulkSendTestSuite(), CallbackTestSuite::CallbackTestSuite(), CarrierAggregationConfigTestSuite::CarrierAggregationConfigTestSuite(), ChannelConditionModelsTestSuite::ChannelConditionModelsTestSuite(), ClassicRecoveryTestSuite::ClassicRecoveryTestSuite(), CobaltQueueDiscTestSuite::CobaltQueueDiscTestSuite(), CoDelQueueDiscTestSuite::CoDelQueueDiscTestSuite(), ns3::tests::CommandLineTestSuite::CommandLineTestSuite(), ns3::tests::ConfigTestSuite::ConfigTestSuite(), CosineAntennaModelTestSuite::CosineAntennaModelTestSuite(), CsmaSystemTestSuite::CsmaSystemTestSuite(), DataRateTestSuite::DataRateTestSuite(), DegreesRadiansTestSuite::DegreesRadiansTestSuite(), DhcpTestSuite::DhcpTestSuite(), Dot11sTestSuite::Dot11sTestSuite(), DropTailQueueTestSuite::DropTailQueueTestSuite(), DsdvTestSuite::DsdvTestSuite(), DsrTestSuite::DsrTestSuite(), EpcS1uDlTestSuite::EpcS1uDlTestSuite(), EpcS1uUlTestSuite::EpcS1uUlTestSuite(), EpcTftClassifierTestSuite::EpcTftClassifierTestSuite(), EpsGtpuTestSuite::EpsGtpuTestSuite(), ErrorModelTestSuite::ErrorModelTestSuite(), ns3::tests::EventGarbageCollectorTestSuite::EventGarbageCollectorTestSuite(), ns3::tests::ExamplesAsTestsTestSuite::ExamplesAsTestsTestSuite(), FifoQueueDiscTestSuite::FifoQueueDiscTestSuite(), FlameTestSuite::FlameTestSuite(), FqCobaltQueueDiscTestSuite::FqCobaltQueueDiscTestSuite(), FqCoDelQueueDiscTestSuite::FqCoDelQueueDiscTestSuite(), FqPieQueueDiscTestSuite::FqPieQueueDiscTestSuite(), GeoToCartesianTestSuite::GeoToCartesianTestSuite(), GlobalRouteManagerImplTestSuite::GlobalRouteManagerImplTestSuite(), ns3::tests::GlobalValueTestSuite::GlobalValueTestSuite(), ns3::tests::HashTestSuite::HashTestSuite(), HistogramTestSuite::HistogramTestSuite(), IcmpTestSuite::IcmpTestSuite(), ns3::aodv::IdCacheTestSuite::IdCacheTestSuite(), ns3::int64x64::test::Int64x64TestSuite::Int64x64TestSuite(), InterBssTestSuite::InterBssTestSuite(), Ipv4AddressGeneratorTestSuite::Ipv4AddressGeneratorTestSuite(), Ipv4AddressHelperTestSuite::Ipv4AddressHelperTestSuite(), Ipv4DeduplicationPerformanceTestSuite::Ipv4DeduplicationPerformanceTestSuite(), Ipv4DeduplicationTestSuite::Ipv4DeduplicationTestSuite(), Ipv4ForwardingTestSuite::Ipv4ForwardingTestSuite(), Ipv4FragmentationTestSuite::Ipv4FragmentationTestSuite(), Ipv4GlobalRoutingTestSuite::Ipv4GlobalRoutingTestSuite(), Ipv4HeaderTestSuite::Ipv4HeaderTestSuite(), IPv4L3ProtocolTestSuite::IPv4L3ProtocolTestSuite(), Ipv4ListRoutingTestSuite::Ipv4ListRoutingTestSuite(), Ipv4PacketInfoTagTestSuite::Ipv4PacketInfoTagTestSuite(), Ipv4RawTestSuite::Ipv4RawTestSuite(), Ipv4RipTestSuite::Ipv4RipTestSuite(), Ipv4StaticRoutingTestSuite::Ipv4StaticRoutingTestSuite(), Ipv6AddressGeneratorTestSuite::Ipv6AddressGeneratorTestSuite(), Ipv6AddressHelperTestSuite::Ipv6AddressHelperTestSuite(), Ipv6AddressTestSuite::Ipv6AddressTestSuite(), Ipv6DadTestSuite::Ipv6DadTestSuite(), Ipv6DualStackTestSuite::Ipv6DualStackTestSuite(), Ipv6ForwardingTestSuite::Ipv6ForwardingTestSuite(), Ipv6FragmentationTestSuite::Ipv6FragmentationTestSuite(), IPv6L3ProtocolTestSuite::IPv6L3ProtocolTestSuite(), Ipv6ListRoutingTestSuite::Ipv6ListRoutingTestSuite(), Ipv6PacketInfoTagTestSuite::Ipv6PacketInfoTagTestSuite(), Ipv6RawTestSuite::Ipv6RawTestSuite(), Ipv6RipngTestSuite::Ipv6RipngTestSuite(), IsotropicAntennaModelTestSuite::IsotropicAntennaModelTestSuite(), Issue211TestSuite::Issue211TestSuite(), ItuR1411LosPropagationLossModelTestSuite::ItuR1411LosPropagationLossModelTestSuite(), ItuR1411NlosOverRooftopPropagationLossModelTestSuite::ItuR1411NlosOverRooftopPropagationLossModelTestSuite(), Kun2600MhzPropagationLossModelTestSuite::Kun2600MhzPropagationLossModelTestSuite(), ns3::LenaTestBearerDeactivateSuite::LenaTestBearerDeactivateSuite(), LenaTestCqaFfMacSchedulerSuite::LenaTestCqaFfMacSchedulerSuite(), LenaTestFdBetFfMacSchedulerSuite::LenaTestFdBetFfMacSchedulerSuite(), LenaTestFdMtFfMacSchedulerSuite::LenaTestFdMtFfMacSchedulerSuite(), LenaTestFdTbfqFfMacSchedulerSuite::LenaTestFdTbfqFfMacSchedulerSuite(), LenaTestHarqSuite::LenaTestHarqSuite(), LenaTestMimoSuite::LenaTestMimoSuite(), LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite(), LenaTestPhyErrorModelSuite::LenaTestPhyErrorModelSuite(), LenaTestPssFfMacSchedulerSuite::LenaTestPssFfMacSchedulerSuite(), LenaTestRrFfMacSchedulerSuite::LenaTestRrFfMacSchedulerSuite(), LenaTestTdBetFfMacSchedulerSuite::LenaTestTdBetFfMacSchedulerSuite(), LenaTestTdMtFfMacSchedulerSuite::LenaTestTdMtFfMacSchedulerSuite(), LenaTestTdTbfqFfMacSchedulerSuite::LenaTestTdTbfqFfMacSchedulerSuite(), LenaTestTtaFfMacSchedulerSuite::LenaTestTtaFfMacSchedulerSuite(), LengthTestSuite::LengthTestSuite(), LiIonEnergySourceTestSuite::LiIonEnergySourceTestSuite(), LolipopCounterTestSuite::LolipopCounterTestSuite(), LrWpanAckTestSuite::LrWpanAckTestSuite(), LrWpanCcaTestSuite::LrWpanCcaTestSuite(), LrWpanCollisionTestSuite::LrWpanCollisionTestSuite(), LrWpanEdTestSuite::LrWpanEdTestSuite(), LrWpanErrorModelTestSuite::LrWpanErrorModelTestSuite(), LrWpanIfsTestSuite::LrWpanIfsTestSuite(), LrWpanPacketTestSuite::LrWpanPacketTestSuite(), LrWpanPlmeAndPdInterfaceTestSuite::LrWpanPlmeAndPdInterfaceTestSuite(), LrWpanSlottedCsmacaTestSuite::LrWpanSlottedCsmacaTestSuite(), LrWpanSpectrumValueHelperTestSuite::LrWpanSpectrumValueHelperTestSuite(), LteAggregationThroughputScaleTestSuite::LteAggregationThroughputScaleTestSuite(), LteAntennaTestSuite::LteAntennaTestSuite(), LteCellSelectionTestSuite::LteCellSelectionTestSuite(), LteCqiGenerationTestSuite::LteCqiGenerationTestSuite(), LteDownlinkPowerControlTestSuite::LteDownlinkPowerControlTestSuite(), LteDownlinkSinrTestSuite::LteDownlinkSinrTestSuite(), LteEarfcnTestSuite::LteEarfcnTestSuite(), LteEpcE2eDataTestSuite::LteEpcE2eDataTestSuite(), LteFrequencyReuseTestSuite::LteFrequencyReuseTestSuite(), LteHandoverTargetTestSuite::LteHandoverTargetTestSuite(), LteInterferenceFrTestSuite::LteInterferenceFrTestSuite(), LteInterferenceTestSuite::LteInterferenceTestSuite(), LteIpv6RoutingTestSuite::LteIpv6RoutingTestSuite(), LteLinkAdaptationTestSuite::LteLinkAdaptationTestSuite(), LtePathlossModelTestSuite::LtePathlossModelTestSuite(), LtePrimaryCellChangeTestSuite::LtePrimaryCellChangeTestSuite(), LteRadioLinkFailureTestSuite::LteRadioLinkFailureTestSuite(), LteRlcAmE2eTestSuite::LteRlcAmE2eTestSuite(), LteRlcAmTransmitterTestSuite::LteRlcAmTransmitterTestSuite(), ns3::LteRlcHeaderTestSuite::LteRlcHeaderTestSuite(), LteRlcUmE2eTestSuite::LteRlcUmE2eTestSuite(), LteRlcUmTransmitterTestSuite::LteRlcUmTransmitterTestSuite(), LteRrcTestSuite::LteRrcTestSuite(), LteSecondaryCellHandoverTestSuite::LteSecondaryCellHandoverTestSuite(), LteSecondaryCellSelectionTestSuite::LteSecondaryCellSelectionTestSuite(), LteSpectrumValueHelperTestSuite::LteSpectrumValueHelperTestSuite(), LteUeMeasurementsHandoverTestSuite::LteUeMeasurementsHandoverTestSuite(), LteUeMeasurementsPiecewiseTestSuite1::LteUeMeasurementsPiecewiseTestSuite1(), LteUeMeasurementsPiecewiseTestSuite2::LteUeMeasurementsPiecewiseTestSuite2(), LteUeMeasurementsPiecewiseTestSuite3::LteUeMeasurementsPiecewiseTestSuite3(), LteUeMeasurementsTestSuite::LteUeMeasurementsTestSuite(), LteUplinkPowerControlTestSuite::LteUplinkPowerControlTestSuite(), LteUplinkSinrTestSuite::LteUplinkSinrTestSuite(), LteX2HandoverMeasuresTestSuite::LteX2HandoverMeasuresTestSuite(), LteX2HandoverTestSuite::LteX2HandoverTestSuite(), ns3::tests::ManyUniformRandomVariablesOneGetValueCallTestSuite::ManyUniformRandomVariablesOneGetValueCallTestSuite(), MeshTestSuite::MeshTestSuite(), MobilityTestSuite::MobilityTestSuite(), MobilityTraceTestSuite::MobilityTraceTestSuite(), MpiTestSuite::MpiTestSuite(), ns3::tests::NamesTestSuite::NamesTestSuite(), NixVectorRoutingTestSuite::NixVectorRoutingTestSuite(), Ns3TcpLossTestSuite::Ns3TcpLossTestSuite(), Ns3TcpNoDelayTestSuite::Ns3TcpNoDelayTestSuite(), Ns3TcpSocketTestSuite::Ns3TcpSocketTestSuite(), Ns3TcpStateTestSuite::Ns3TcpStateTestSuite(), Ns3WimaxFragmentationTestSuite::Ns3WimaxFragmentationTestSuite(), Ns3WimaxMacMessagesTestSuite::Ns3WimaxMacMessagesTestSuite(), Ns3WimaxPhyTestSuite::Ns3WimaxPhyTestSuite(), Ns3WimaxQoSTestSuite::Ns3WimaxQoSTestSuite(), Ns3WimaxServiceFlowTestSuite::Ns3WimaxServiceFlowTestSuite(), Ns3WimaxSSMacTestSuite::Ns3WimaxSSMacTestSuite(), Ns3WimaxTlvTestSuite::Ns3WimaxTlvTestSuite(), ns3::tests::ObjectTestSuite::ObjectTestSuite(), OcbTestSuite::OcbTestSuite(), OkumuraHataPropagationLossModelTestSuite::OkumuraHataPropagationLossModelTestSuite(), OlsrProtocolTestSuite::OlsrProtocolTestSuite(), OlsrTestSuite::OlsrTestSuite(), ns3::tests::OneUniformRandomVariableManyGetValueCallsTestSuite::OneUniformRandomVariableManyGetValueCallsTestSuite(), OutdoorRandomWalkTestSuite::OutdoorRandomWalkTestSuite(), PacketMetadataTestSuite::PacketMetadataTestSuite(), PacketSocketAppsTestSuite::PacketSocketAppsTestSuite(), PacketTestSuite::PacketTestSuite(), PairValueTestSuite::PairValueTestSuite(), ParabolicAntennaModelTestSuite::ParabolicAntennaModelTestSuite(), PbbTestSuite::PbbTestSuite(), PcapFileTestSuite::PcapFileTestSuite(), PfifoFastQueueDiscTestSuite::PfifoFastQueueDiscTestSuite(), PieQueueDiscTestSuite::PieQueueDiscTestSuite(), PointToPointTestSuite::PointToPointTestSuite(), PowerRateAdaptationTestSuite::PowerRateAdaptationTestSuite(), PrioQueueDiscTestSuite::PrioQueueDiscTestSuite(), ProbabilisticV2vChCondModelsTestSuite::ProbabilisticV2vChCondModelsTestSuite(), ProbeTestSuite::ProbeTestSuite(), PropagationLossModelsTestSuite::PropagationLossModelsTestSuite(), PrrRecoveryTestSuite::PrrRecoveryTestSuite(), ns3::tests::PtrTestSuite::PtrTestSuite(), QkdTestSuite::QkdTestSuite(), QosTxopTestSuite::QosTxopTestSuite(), QueueDiscTracesTestSuite::QueueDiscTracesTestSuite(), RadvdTestSuite::RadvdTestSuite(), RandCartAroundGeoTestSuite::RandCartAroundGeoTestSuite(), ns3::test::RandomVariable::RandomVariableSuite::RandomVariableSuite(), RedQueueDiscTestSuite::RedQueueDiscTestSuite(), RngTestSuite::RngTestSuite(), RocketfuelTopologyReaderTestSuite::RocketfuelTopologyReaderTestSuite(), RttEstimatorTestSuite::RttEstimatorTestSuite(), ns3::tests::SampleTestSuite::SampleTestSuite(), SequenceNumberTestSuite::SequenceNumberTestSuite(), SimulatorTestSuite::SimulatorTestSuite(), SixlowpanFragmentationTestSuite::SixlowpanFragmentationTestSuite(), SixlowpanHc1TestSuite::SixlowpanHc1TestSuite(), SixlowpanIphcStatefulTestSuite::SixlowpanIphcStatefulTestSuite(), SixlowpanIphcTestSuite::SixlowpanIphcTestSuite(), SpectrumConverterTestSuite::SpectrumConverterTestSuite(), SpectrumIdealPhyTestSuite::SpectrumIdealPhyTestSuite(), SpectrumInterferenceTestSuite::SpectrumInterferenceTestSuite(), SpectrumValueTestSuite::SpectrumValueTestSuite(), SpectrumWifiPhyTestSuite::SpectrumWifiPhyTestSuite(), SwitchTestSuite::SwitchTestSuite(), TbfQueueDiscTestSuite::TbfQueueDiscTestSuite(), TcFlowControlTestSuite::TcFlowControlTestSuite(), TcpAdvertisedWindowTestSuite::TcpAdvertisedWindowTestSuite(), ns3::TcpBbrTestSuite::TcpBbrTestSuite(), TcpBicTestSuite::TcpBicTestSuite(), TcpBytesInFlightTestSuite::TcpBytesInFlightTestSuite(), TcpDctcpTestSuite::TcpDctcpTestSuite(), ns3::TcpEcnTestSuite::TcpEcnTestSuite(), TcpEndpointBug2211TestSuite::TcpEndpointBug2211TestSuite(), TcpFastRetrTestSuite::TcpFastRetrTestSuite(), TcpHeaderTestSuite::TcpHeaderTestSuite(), TcpHighSpeedTestSuite::TcpHighSpeedTestSuite(), TcpHtcpTestSuite::TcpHtcpTestSuite(), TcpHyblaTestSuite::TcpHyblaTestSuite(), TcpIllinoisTestSuite::TcpIllinoisTestSuite(), TcpLedbatTestSuite::TcpLedbatTestSuite(), TcpLinuxRenoTestSuite::TcpLinuxRenoTestSuite(), TcpLossTestSuite::TcpLossTestSuite(), ns3::TcpLpTestSuite::TcpLpTestSuite(), TcpOptionTestSuite::TcpOptionTestSuite(), TcpPacingTestSuite::TcpPacingTestSuite(), TcpPktsAckedTestSuite::TcpPktsAckedTestSuite(), TcpRateOpsTestSuite::TcpRateOpsTestSuite(), TcpRenoCongAvoidTestSuite::TcpRenoCongAvoidTestSuite(), TcpRtoTestSuite::TcpRtoTestSuite(), TcpRttEstimationTestSuite::TcpRttEstimationTestSuite(), TcpRxBufferTestSuite::TcpRxBufferTestSuite(), TcpSackPermittedTestSuite::TcpSackPermittedTestSuite(), TcpScalableTestSuite::TcpScalableTestSuite(), TcpSlowStartTestSuite::TcpSlowStartTestSuite(), TcpSynConnectionFailedTestSuite::TcpSynConnectionFailedTestSuite(), ns3::TcpTcpCloseTestSuite::TcpTcpCloseTestSuite(), TcpTestSuite::TcpTestSuite(), TcpTimestampTestSuite::TcpTimestampTestSuite(), TcpTxBufferTestSuite::TcpTxBufferTestSuite(), TcpVegasTestSuite::TcpVegasTestSuite(), TcpVenoTestSuite::TcpVenoTestSuite(), TcpWScalingTestSuite::TcpWScalingTestSuite(), TcpYeahTestSuite::TcpYeahTestSuite(), TcpZeroWindowTestSuite::TcpZeroWindowTestSuite(), TestCarrierAggregationSuite::TestCarrierAggregationSuite(), ThreadedSimulatorTestSuite::ThreadedSimulatorTestSuite(), ThreeGppChannelTestSuite::ThreeGppChannelTestSuite(), ThreeGppPropagationLossModelsTestSuite::ThreeGppPropagationLossModelsTestSuite(), ThreeGppV2vChCondModelsTestSuite::ThreeGppV2vChCondModelsTestSuite(), TimerTestSuite::TimerTestSuite(), TimeTestSuite::TimeTestSuite(), TracedCallbackTestSuite::TracedCallbackTestSuite(), TracedCallbackTypedefTestSuite::TracedCallbackTypedefTestSuite(), TracedValueCallbackTestSuite::TracedValueCallbackTestSuite(), ns3::tests::TrickleTimerTestSuite::TrickleTimerTestSuite(), TupleValueTestSuite::TupleValueTestSuite(), TvHelperDistributionTestSuite::TvHelperDistributionTestSuite(), TvSpectrumTransmitterTestSuite::TvSpectrumTransmitterTestSuite(), TxDurationTestSuite::TxDurationTestSuite(), TxopTestSuite::TxopTestSuite(), TypeIdPerformanceSuite::TypeIdPerformanceSuite(), TypeIdTestSuite::TypeIdTestSuite(), ns3::tests::TypeTraitsTestSuite::TypeTraitsTestSuite(), UanEnergyModelTestSuite::UanEnergyModelTestSuite(), UanTestSuite::UanTestSuite(), UdpClientServerTestSuite::UdpClientServerTestSuite(), UdpTestSuite::UdpTestSuite(), UniformPlanarArrayTestSuite::UniformPlanarArrayTestSuite(), ns3::tests::WatchdogTestSuite::WatchdogTestSuite(), WaveformGeneratorTestSuite::WaveformGeneratorTestSuite(), WaveMacTestSuite::WaveMacTestSuite(), WifiAcMappingTestSuite::WifiAcMappingTestSuite(), WifiAggregationTestSuite::WifiAggregationTestSuite(), WifiChannelSwitchingTestSuite::WifiChannelSwitchingTestSuite(), WifiErrorRateModelsTestSuite::WifiErrorRateModelsTestSuite(), WifiMacOfdmaTestSuite::WifiMacOfdmaTestSuite(), WifiMacQueueTestSuite::WifiMacQueueTestSuite(), WifiMsduAggregatorTestSuite::WifiMsduAggregatorTestSuite(), WifiPhyOfdmaTestSuite::WifiPhyOfdmaTestSuite(), WifiPhyReceptionTestSuite::WifiPhyReceptionTestSuite(), WifiPhyThresholdsTestSuite::WifiPhyThresholdsTestSuite(), WifiPrimaryChannelsTestSuite::WifiPrimaryChannelsTestSuite(), WifiTestSuite::WifiTestSuite(), WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite(), WifiTxopTestSuite::WifiTxopTestSuite(), and ThreeGppHttpClientServerTestSuite::AddHttpObjectTestCase().

◆ CreateDataDirFilename()

std::string ns3::TestCase::CreateDataDirFilename ( std::string  filename)
protected

Construct the full path to a file in the data directory.

The data directory is configured by SetDataDirectory().

Parameters
[in]filenameThe bare (no path) file name
Returns
The full path to filename in the data directory

Definition at line 412 of file test.cc.

References ns3::SystemPath::Append(), ns3::TestRunnerImpl::GetTopLevelSourceDir(), m_dataDir, m_parent, m_runner, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by CreateTempDirFilename(), MobilityTraceTestCase::DoRun(), ReadFileTestCase::DoRun(), DiffTestCase::DoRun(), Ns3TcpLossTestCase::DoSetup(), and Ns3TcpStateTestCase::DoSetup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateTempDirFilename()

std::string ns3::TestCase::CreateTempDirFilename ( std::string  filename)
protected

Construct the full path to a file in a temporary directory.

If the TestRunner is invoked with "--update-data", this will be the data directory instead.

Parameters
[in]filenameThe bare (no path) file name
Returns
The full path to filename in the temporary directory.

Definition at line 430 of file test.cc.

References ns3::SystemPath::Append(), CreateDataDirFilename(), ns3::TestRunnerImpl::GetTempDir(), ns3::SystemPath::Join(), m_name, m_parent, m_runner, ns3::SystemPath::MakeDirectories(), ns3::TestRunnerImpl::MustUpdateData(), and NS_LOG_FUNCTION.

Referenced by ChainRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), PeerManagementProtocolRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), LteRadioLinkFailureTestCase::DoRun(), LrWpanAckTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaHarqTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LenaMimoTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), MobilityTraceTestCase::DoRun(), DiffTestCase::DoRun(), WriteModeCreateTestCase::DoSetup(), ReadModeCreateTestCase::DoSetup(), FileHeaderTestCase::DoSetup(), and RecordHeaderTestCase::DoSetup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

virtual void ns3::TestCase::DoRun ( void  )
privatepure virtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implemented in DataRateTestCase, RrcHeaderTestCase, WifiTxopTest, WifiOfdmMaskSlopesTestCase, HeRuMcsDataRateTestCase, IdealRateManagerMimoTest, IdealRateManagerChannelWidthTest, Issue169TestCase, Issue40TestCase, Bug2470TestCase, StaWifiMacScanningTestCase, Bug2831TestCase, Bug2843TestCase, Bug2222TestCase, SetChannelFrequencyTest, QosFragmentationTestCase, Bug730TestCase, DcfImmediateAccessBroadcastTestCase, InterferenceHelperSequenceTest, QosUtilsIsOldPacketTest, WifiTest, WifiPrimaryChannelsTest, TestUnsupportedModulationReception, TestAmpduReception, TestPhyHeadersReception, TestSimpleFrameCaptureModel, TestThresholdPreambleDetectionWithFrameCapture, TestThresholdPreambleDetectionWithoutFrameCapture, TestUlOfdmaPowerControl, TestPhyPaddingExclusion, TestUlOfdmaPhyTransmission, TestMultipleHeTbPreambles, TestUlOfdmaPpduUid, TestDlOfdmaPhyTransmission, OfdmaAckSequenceTest, TableBasedErrorRateTestCase, WifiErrorRateModelsTestCaseMimo, WifiErrorRateModelsTestCaseNist, WifiErrorRateModelsTestCaseDsss, PreservePacketsInAmpdus, HeAggregationTest, TwoLevelAggregationTest, AmpduAggregationTest, PhyHeaderSectionsTest, HeSigBDurationTest, TxDurationTest, SpectrumWifiPhyFilterTest, SpectrumWifiPhyListenerTest, SpectrumWifiPhyBasicTest, PowerRateAdaptationTest, TestInterBssConstantObssPdAlgo, ChannelAccessManagerTest< TxopType >, BlockAckAggregationDisabledTest, BlockAckRecipientBufferTest, CtrlBAckResponseHeaderTest, OriginatorBlockAckWindowTest, PacketBufferingCaseB, PacketBufferingCaseA, Ns3WimaxSfTlvTestCase, Ns3WimaxCsParamTlvTestCase, Ns3WimaxSfCreationTestCase, Ns3WimaxFragmentationTestCase, Ns3WimaxManagementConnectionsTestCase, Ns3WimaxNetworkEntryTestCase, Ns3WimaxSFTypeTestCase, Ns3WimaxSchedulingTestCase, Ns3WimaxSNRtoBLERTestCase, Ns3WimaxSimpleOFDMTestCase, DsaRequestTestCase, WifiPhyThresholdsStrongForeignSignalTest, WifiPhyThresholdsStrongWifiSignalTest, WifiPhyThresholdsWeakForeignSignalTest, WifiPhyThresholdsWeakWifiSignalTest, WifiChannelSwitchingTest, ChannelAccessManagerTest< TxopType >, ChannelAccessManagerTest< TxopType >, MultiStaCtrlBAckResponseHeaderTest, OcbWifiMacTestCase, AnnexC_TestCase, ChannelAccessTestCase, ChannelRoutingTestCase, ChannelCoordinationTestCase, UanTest, AcousticModemEnergyDepletionTestCase, AcousticModemEnergyTestCase, TcFlowControlTestCase, TbfQueueDiscTestCase, RedQueueDiscTestCase, QueueDiscTracesTestCase, PrioQueueDiscTestCase, PieQueueDiscTestCase, FifoQueueDiscTestCase, CoDelQueueDiscBasicMark, CoDelQueueDiscBasicDrop, CoDelQueueDiscControlLawTest, CoDelQueueDiscNewtonStepTest, CoDelQueueDiscBasicOverflow, CoDelQueueDiscBasicEnqueueDequeue, CobaltQueueDiscEnhancedBlueTest, CobaltQueueDiscCeThresholdTest, CobaltQueueDiscMarkTest, CobaltQueueDiscDropTest, CobaltQueueDiscBasicEnqueueDequeue, AredQueueDiscTestCase, RocketfuelTopologyReaderTest, TracedValueCallbackTestCase, TracedCallbackTypedefTestCase, WifiMsduAggregatorThroughputTest, Issue211Test, WifiAcMappingTest, Ns3TcpStateTestCase, Ns3TcpSocketTestCaseCsma, Ns3TcpSocketTestCaseP2P, Ns3TcpNoDelayTestCase, Ns3TcpLossTestCase, PfifoFastQueueDiscNoPriority, PfifoFastQueueDiscOverflow, PfifoFastQueueDiscDscpPrioritization, PfifoFastQueueDiscTosPrioritization, FqPieQueueDiscL4sMode, FqPieQueueDiscSetLinearProbing, FqPieQueueDiscUDPFlowsSeparation, FqPieQueueDiscTCPFlowsSeparation, FqPieQueueDiscDeficit, FqPieQueueDiscIPFlowsSeparationAndPacketLimit, FqPieQueueDiscNoSuitableFilter, FqCoDelQueueDiscL4sMode, FqCoDelQueueDiscSetLinearProbing, FqCoDelQueueDiscECNMarking, FqCoDelQueueDiscUDPFlowsSeparation, FqCoDelQueueDiscTCPFlowsSeparation, FqCoDelQueueDiscDeficit, FqCoDelQueueDiscIPFlowsSeparationAndPacketLimit, FqCoDelQueueDiscNoSuitableFilter, FqCobaltQueueDiscL4sMode, FqCobaltQueueDiscSetLinearProbing, FqCobaltQueueDiscEcnMarking, FqCobaltQueueDiscUDPFlowsSeparation, FqCobaltQueueDiscTCPFlowsSeparation, FqCobaltQueueDiscDeficit, FqCobaltQueueDiscIPFlowsSeparationAndPacketLimit, FqCobaltQueueDiscNoSuitableFilter, CsmaStarTestCase, CsmaRawIpSocketTestCase, CsmaPingTestCase, CsmaPacketSocketTestCase, CsmaOneSubnetTestCase, CsmaMulticastTestCase, CsmaBroadcastTestCase, CsmaBridgeTestCase, HistogramTestCase, ProbeTestCase1, FiveDoublesTestCase, FiveIntegersTestCase, OneIntegerTestCase, FiveDoublesAverageTestCase, FiveIntegersAverageTestCase, OneIntegerAverageTestCase, TvSpectrumTransmitterTestCase, TvHelperDistributionTestCase, ThreeGppSpectrumPropagationLossModelTest, ThreeGppChannelMatrixUpdateTest, ThreeGppChannelMatrixComputationTest, WaveformGeneratorTestCase, SpectrumValueTestCase, SpectrumInterferenceTestCase, SpectrumIdealPhyTestCase, SixlowpanIphcImplTest, SixlowpanIphcStatefulImplTest, SixlowpanHc1ImplTest, SixlowpanFragmentationTest, QkdTestCase1, ThreeGppShadowingTestCase, ThreeGppV2vHighwayPropagationLossModelTestCase, ThreeGppV2vUrbanPropagationLossModelTestCase, ThreeGppIndoorOfficePropagationLossModelTestCase, ThreeGppUmiPropagationLossModelTestCase, ThreeGppUmaPropagationLossModelTestCase, ThreeGppRmaPropagationLossModelTestCase, RangePropagationLossModelTestCase, MatrixPropagationLossModelTestCase, LogDistancePropagationLossModelTestCase, TwoRayGroundPropagationLossModelTestCase, FriisPropagationLossModelTestCase, V2vHighwayProbChCondModelTestCase, V2vUrbanProbChCondModelTestCase, OkumuraHataPropagationLossModelTestCase, Kun2600MhzPropagationLossModelTestCase, ItuR1411NlosOverRooftopPropagationLossModelTestCase, ItuR1411LosPropagationLossModelTestCase, ThreeGppChannelConditionModelTestCase, PointToPointTest, SwitchFlowTableTestCase, OlsrMprTestCase, OlsrHnaTestCase, OlsrTcTestCase, OlsrHelloTestCase, OlsrMidTestCase, OlsrEmfTestCase, NixVectorRoutingTest, DataRateTestCase2, DataRateTestCase1, SequenceNumberTestCase, DiffTestCase, ReadFileTestCase, RecordHeaderTestCase, FileHeaderTestCase, ReadModeCreateTestCase, WriteModeCreateTestCase, PbbTestCase, PacketTagListTest, PacketTest, PacketSocketAppsTest, PacketMetadataTest, LollipopCounterTest, Ipv6AddressTestCase, BurstErrorModelSimple, ErrorModelSimple, DropTailQueueTestCase, BufferTest, BitDeserializerTest, BitSerializerTest, AbstractAnimationInterfaceTestCase, WaypointMobilityModelAddWaypointTest, WaypointMobilityModelNotifyTest, SteadyStateRandomWaypointTest, RandCartAroundGeoTestCase, MobilityTraceTestCase, WaypointMobilityModelViaHelper, WaypointInitialPositionIsWaypoint, WaypointLazyNotifyTrue, WaypointLazyNotifyFalse, CartesianToGeoTestCase, GeoToCartesianTestCase, BoxLineIntersectionTestCase, LteX2HandoverTestCase, LteX2HandoverMeasuresTestCase, LteRrcConnectionEstablishmentErrorTestCase, LteRrcConnectionEstablishmentTestCase, ns3::RlcAmStatusPduTestCase, LteHandoverDelayTestCase, LteEpcE2eDataTestCase, LteEnbAntennaTestCase, EpcTftClassifierTestCase, MeasurementReportTestCase, RrcConnectionRejectTestCase, RrcConnectionReestablishmentCompleteTestCase, RrcConnectionReestablishmentTestCase, RrcConnectionReestablishmentRequestTestCase, HandoverPreparationInfoTestCase, RrcConnectionReconfigurationTestCase, RrcConnectionReconfigurationCompleteTestCase, RrcConnectionSetupCompleteTestCase, RrcConnectionSetupTestCase, RrcConnectionRequestTestCase, LteUplinkSrsSinrTestCase, LteUplinkDataSinrTestCase, LteUplinkClosedLoopPowerControlAccumulatedModeTestCase, LteUplinkClosedLoopPowerControlAbsoluteModeTestCase, LteUplinkOpenLoopPowerControlTestCase, LteUplinkPowerControlTestCase, LteUeMeasurementsTestCase, LenaTtaFfMacSchedulerTestCase, LenaTdTbfqFfMacSchedulerTestCase2, LenaTdTbfqFfMacSchedulerTestCase1, LenaTdMtFfMacSchedulerTestCase, LenaTdBetFfMacSchedulerTestCase2, LenaTdBetFfMacSchedulerTestCase1, LteTxPsdTestCase, LteNoisePsdTestCase, LteSpectrumModelTestCase, LenaRrFfMacSchedulerTestCase, LteRlcUmTransmitterReportBufferStatusTestCase, LteRlcUmTransmitterConcatenationTestCase, LteRlcUmTransmitterSegmentationTestCase, LteRlcUmTransmitterOneSduTestCase, LteRlcUmTransmitterTestCase, LteRlcUmE2eTestCase, LteRlcAmTransmitterReportBufferStatusTestCase, LteRlcAmTransmitterConcatenationTestCase, LteRlcAmTransmitterSegmentationTestCase, LteRlcAmTransmitterOneSduTestCase, LteRlcAmTransmitterTestCase, LteRlcAmE2eTestCase, LenaPssFfMacSchedulerTestCase2, LenaPssFfMacSchedulerTestCase1, LenaDlCtrlPhyErrorModelTestCase, LenaDataPhyErrorModelTestCase, LenaPfFfMacSchedulerTestCase2, LenaPfFfMacSchedulerTestCase1, LtePathlossModelSystemTestCase, LenaMimoTestCase, LteLinkAdaptationTestCase, LteIpv6RoutingTestCase, LteInterferenceTestCase, LteInterferenceStrictFrTestCase, LteInterferenceHardFrTestCase, LenaHarqTestCase, LteDistributedFfrAreaTestCase, LteEnhancedFfrAreaTestCase, LteSoftFfrAreaTestCase, LteSoftFrAreaTestCase, LteStrictFrAreaTestCase, LteFrAreaTestCase, LteStrictFrTestCase, LteHardFrTestCase, LteFrTestCase, LenaFdTbfqFfMacSchedulerTestCase2, LenaFdTbfqFfMacSchedulerTestCase1, LenaFdMtFfMacSchedulerTestCase, LenaFdBetFfMacSchedulerTestCase2, LenaFdBetFfMacSchedulerTestCase1, LteEarfcnUlTestCase, LteEarfcnDlTestCase, LteEarfcnTestCase, LteDownlinkCtrlSinrTestCase, LteDownlinkDataSinrTestCase, LteDownlinkPowerControlRrcConnectionReconfigurationTestCase, LteDownlinkPowerControlTestCase, LteDownlinkPowerControlSpectrumValueTestCase, ns3::LenaDeactivateBearerTestCase, LteCqiGenerationDlPowerControlTestCase, LteCqiGenerationTestCase, LenaCqaFfMacSchedulerTestCase2, LenaCqaFfMacSchedulerTestCase1, CarrierAggregationTestCase, CarrierAggregationConfigTestCase, EpcS1uUlTestCase, EpcS1uDlTestCase, EpsGtpuHeaderTestCase, LrWpanSpectrumValueHelperTestCase, LrWpanSlottedCsmacaTestCase, LrWpanPlmeAndPdInterfaceTestCase, LrWpanPacketTestCase, LrWpanDataIfsTestCase, LrWpanErrorModelTestCase, LrWpanErrorDistanceTestCase, LrWpanEdTestCase, LrWpanCollisionTestCase, LrWpanCcaTestCase, LrWpanAckTestCase, Udp6SocketImplTest, UdpSocketImplTest, Udp6SocketLoopbackTest, UdpSocketLoopbackTest, TcpYeahDecrementTest, TcpVenoTest, TcpVegasTest, TcpTxBufferTestCase, TimestampValueTestCase, TcpTestCase, TcpScalableDecrementTest, TcpScalableIncrementTest, TcpRxBufferTestCase, TcpRateLinuxWithBufferTest, TcpRateLinuxBasicTest, PrrRecoveryTest, TcpOptionTSTestCase, TcpOptionWSTestCase, ns3::TcpLpInferenceTest2, ns3::TcpLpInferenceTest1, ns3::TcpLpToNewReno, TcpLedbatDecrementTest, TcpLedbatIncrementTest, TcpLedbatToNewReno, TcpHyblaIncrementTest, TcpHtcpIncrementTest, TcpHighSpeedDecrementTest, TcpHighSpeedIncrementTest, TcpHeaderFlagsToString, TcpHeaderWithRFC793OptionTestCase, TcpHeaderGetSetTestCase, ns3::TcpGeneralTest, TcpDctcpToLinuxReno, ClassicRecoveryTest, TcpBicDecrementTest, TcpBicIncrementTest, ns3::TcpBbrCheckGainValuesTest, ns3::TcpBbrPacingEnableTest, RttEstimatorTestCase, Ipv6RipngSplitHorizonStrategyTest, Ipv6RipngCountToInfinityTest, Ipv6RipngTest, Ipv6RawSocketImplTest, Ipv6PacketInfoTagTest, Ipv6ListRoutingPositiveTestCase, Ipv6ListRoutingNegativeTestCase, Ipv6FragmentationTest, Ipv6ForwardingTest, DualStackTestCase, IpAddressHelperTestCasev6, AddressCollision6TestCase, ExampleAddress6GeneratorTestCase, NetworkAndAddress6TestCase, AddressAllocator6TestCase, NetworkNumber6AllocatorTestCase, Ipv6DadTest, Ipv4L3ProtocolTestCase, Ipv4StaticRoutingSlash32TestCase, Ipv4RipSplitHorizonStrategyTest, Ipv4RipCountToInfinityTest, Ipv4RipTest, Ipv4RawSocketImplTest, Ipv4PacketInfoTagTest, Ipv4ListRoutingPositiveTestCase, Ipv4ListRoutingNegativeTestCase, Ipv4HeaderTest, Ipv4GlobalRoutingSlash32TestCase, Ipv4DynamicGlobalRoutingTestCase, TwoBridgeTest, BridgeTest, TwoLanTest, TwoLinkTest, LanTest, LinkTest, Ipv4FragmentationTest, Ipv4ForwardingTest, Ipv4DeduplicationPerformanceTest, Ipv4DeduplicationTest, IpAddressHelperTestCasev4, ResetAllocatorHelperTestCase, AddressAllocatorHelperTestCase, NetworkAllocatorHelperTestCase, AddressCollisionTestCase, ExampleAddressGeneratorTestCase, NetworkAndAddressTestCase, AddressAllocatorTestCase, NetworkNumberAllocatorTestCase, IcmpV6TimeExceedTestCase, IcmpV6EchoReplyTestCase, IcmpTimeExceedTestCase, IcmpEchoReplyTestCase, GlobalRouteManagerImplTestCase, RadvdTestCase, DhcpTestCase, LiIonEnergyTestCase, BasicEnergyHarvesterTestCase, DsrRreqTableTest, DsrSendBuffTest, DsrCacheEntryTest, DsrAckHeaderTest, DsrAckReqHeaderTest, DsrRerrHeaderTest, DsrSRHeaderTest, DsrRrepHeaderTest, DsrRreqHeaderTest, DsrFsHeaderTest, DsdvTableTestCase, DsdvHeaderTestCase, ns3::tests::WatchdogTestCase, ns3::tests::TypeTraitsTestCase, LookupTimeTestCase, DeprecatedAttributeTestCase, CollisionTestCase, UniqueTypeIdTestCase, ns3::tests::TrickleTimerTestCase, BasicTracedCallbackTestCase, TimerTemplateTestCase, TimerStateTestCase, TimeInputOutputTestCase, TimeWithSignTestCase, TimeSimpleTestCase, ThreadedSimulatorEventsTestCase, SimulatorTemplateTestCase, SimulatorEventsTestCase, ns3::tests::SampleTestCase1, RngParetoTestCase, RngExponentialTestCase, RngNormalTestCase, RngUniformTestCase, ns3::test::RandomVariable::NormalCachingTestCase, ns3::test::RandomVariable::EmpiricalAntitheticTestCase, ns3::test::RandomVariable::EmpiricalTestCase, ns3::test::RandomVariable::DeterministicTestCase, ns3::test::RandomVariable::ZetaAntitheticTestCase, ns3::test::RandomVariable::ZetaTestCase, ns3::test::RandomVariable::ZipfAntitheticTestCase, ns3::test::RandomVariable::ZipfTestCase, ns3::test::RandomVariable::ErlangAntitheticTestCase, ns3::test::RandomVariable::ErlangTestCase, ns3::test::RandomVariable::GammaAntitheticTestCase, ns3::test::RandomVariable::GammaTestCase, ns3::test::RandomVariable::LogNormalAntitheticTestCase, ns3::test::RandomVariable::LogNormalTestCase, ns3::test::RandomVariable::WeibullAntitheticTestCase, ns3::test::RandomVariable::WeibullTestCase, ns3::test::RandomVariable::ParetoAntitheticTestCase, ns3::test::RandomVariable::ParetoTestCase, ns3::test::RandomVariable::ExponentialAntitheticTestCase, ns3::test::RandomVariable::ExponentialTestCase, ns3::test::RandomVariable::NormalAntitheticTestCase, ns3::test::RandomVariable::NormalTestCase, ns3::test::RandomVariable::SequentialTestCase, ns3::test::RandomVariable::ConstantTestCase, ns3::test::RandomVariable::UniformAntitheticTestCase, ns3::test::RandomVariable::UniformTestCase, ns3::tests::PtrTestCase, ns3::tests::OneUniformRandomVariableManyGetValueCallsTestCase, ns3::tests::ObjectFactoryTestCase, ns3::tests::AggregateObjectTestCase, ns3::tests::CreateObjectTestCase, ns3::tests::AlternateFindTestCase, ns3::tests::RelativeFindTestCase, ns3::tests::FullyQualifiedFindTestCase, ns3::tests::StringContextFindTestCase, ns3::tests::BasicFindTestCase, ns3::tests::FindPathTestCase, ns3::tests::RelativeRenameTestCase, ns3::tests::FullyQualifiedRenameTestCase, ns3::tests::StringContextRenameTestCase, ns3::tests::BasicRenameTestCase, ns3::tests::RelativeAddTestCase, ns3::tests::FullyQualifiedAddTestCase, ns3::tests::StringContextAddTestCase, ns3::tests::BasicAddTestCase, ns3::tests::ManyUniformRandomVariablesOneGetValueCallTestCase, ns3::int64x64::test::Int64x64ImplTestCase, ns3::int64x64::test::Int64x64DoubleTestCase, ns3::int64x64::test::Int64x64InvertTestCase, ns3::int64x64::test::Int64x64CompareTestCase, ns3::int64x64::test::Int64x64Bug1786TestCase, ns3::int64x64::test::Int64x64Bug863TestCase, ns3::int64x64::test::Int64x64Bug455TestCase, ns3::int64x64::test::Int64x64ArithmeticTestCase, ns3::int64x64::test::Int64x64InputOutputTestCase, ns3::int64x64::test::Int64x64InputTestCase, ns3::int64x64::test::Int64x64IntRoundTestCase, ns3::int64x64::test::Int64x64HiLoTestCase, ns3::tests::IncrementalTestCase, ns3::tests::Hash64FunctionPtrTestCase, ns3::tests::Hash32FunctionPtrTestCase, ns3::tests::Murmur3TestCase, ns3::tests::Fnv1aTestCase, ns3::tests::DefaultHashTestCase, ns3::tests::HashTestCase, ns3::tests::GlobalValueTestCase, ns3::tests::EventGarbageCollectorTestCase, ns3::tests::SearchAttributesOfParentObjectsTestCase, ns3::tests::ObjectVectorTraceConfigTestCase, ns3::tests::ObjectVectorConfigTestCase, ns3::tests::UnderRootNamespaceConfigTestCase, ns3::tests::RootNamespaceConfigTestCase, ns3::tests::CommandLineNonOptionTestCase, ns3::tests::CommandLineInvalidTestCase, ns3::tests::CommandLineOrderTestCase, ns3::tests::CommandLineStringTestCase, ns3::tests::CommandLineUnsignedIntTestCase, ns3::tests::CommandLineIntTestCase, ns3::tests::CommandLineUint8tTestCase, ns3::tests::CommandLineBooleanTestCase, MakeCallbackTemplatesTestCase, NullifyCallbackTestCase, MakeBoundCallbackTestCase, MakeCallbackTestCase, BasicCallbackTestCase, ns3::tests::BuildProfileTestCase, CallbackValueTestCase, PointerAttributeTestCase, TracedCallbackTestCase, IntegerTraceSourceTestCase, IntegerTraceSourceAttributeTestCase, ObjectMapAttributeTestCase, ObjectVectorAttributeTestCase, RandomVariableStreamAttributeTestCase, AttributeTestCase< T >, AttributeTestCase< T >, AttributeTestCase< T >, AttributeTestCase< T >, AttributeTestCase< T >, AttributeTestCase< T >, AttributeTestCase< T >, AttributeContainerSetGetTestCase, AttributeContainerSerializationTestCase, ns3::TestSuite, ns3::ExampleAsTestCase, ThreeGppV2vHighwayLosNlosvChCondModelTestCase, ThreeGppV2vUrbanLosNlosvChCondModelTestCase, ThreeGppV2vBuildingsChCondModelTestCase, OutdoorRandomWalkTestCase, BuildingsShadowingTestCase, BuildingsPathlossTestCase, BuildingsHelperOneTestCase, BuildingsChannelConditionModelTestCase, SameRoomPositionAllocatorTestCase, RandomRoomPositionAllocatorTestCase, BriteTopologyFunctionTestCase, BriteTopologyStructureTestCase, UdpEchoClientSetFillTestCase, PacketLossCounterTestCase, UdpTraceClientServerTestCase, UdpClientServerTestCase, BulkSendSeqTsSizeTestCase, BulkSendBasicTestCase, UniformPlanarArrayTestCase, ParabolicAntennaModelTestCase, IsotropicAntennaModelTestCase, RadiansToDegreesTestCase, DegreesToRadiansTestCase, CosineAntennaModelTestCase, TwoVectorsConstructorTestCase, OneVectorConstructorTestCase, WifiMacQueueDropOldestTest, ns3::olsr::TcRegressionTest, ns3::olsr::HelloRegressionTest, ns3::olsr::Bug780Test, Ns2MobilityHelperTest, MeshInformationElementVectorBist, FlameRtableTest, FlameHeaderTest, FlameRegressionTest, PeerManagementProtocolRegressionTest, HwmpDoRfRegressionTest, HwmpSimplestRegressionTest, HwmpReactiveRegressionTest, HwmpProactiveRegressionTest, PeerLinkFrameStartTest, HwmpRtableTest, MeshHeaderTest, LteHandoverTargetTestCase, LteUeMeasurementsHandoverTestCase, LteUeMeasurementsPiecewiseTestCase3, LteUeMeasurementsPiecewiseTestCase2, LteUeMeasurementsPiecewiseTestCase1, LteSecondaryCellSelectionTestCase, LteSecondaryCellHandoverTestCase, LteRadioLinkFailureTestCase, LtePrimaryCellChangeTestCase, LteCellSelectionTestCase, LteAggregationThroughputScaleTestCase, TcpYeahIncrementTest, TcpSynConnectionFailedTest, TcpIllinoisTest, TcpEndPointBug2211Test, Ipv6L3ProtocolTestCase, TestFulfilledAlignment, TestOptionWithAlignment, TestOptionWithoutAlignment, TestEmptyOptionField, TupleValueTestCase, PairValueSettingsTestCase, PairValueTestCase, LengthValueTestCase, LengthTestCase, AttributeContainerTestCase, ThreeGppHttpObjectTestCase, ns3::aodv::LoopbackTestCase, Bug772ChainTest, ns3::aodv::AodvRtableTest, ns3::aodv::AodvRtableEntryTest, ns3::aodv::AodvRqueueTest, ns3::aodv::QueueEntryTest, ns3::aodv::RerrHeaderTest, ns3::aodv::RrepAckHeaderTest, ns3::aodv::RrepHeaderTest, ns3::aodv::RreqHeaderTest, ns3::aodv::TypeHeaderTest, ns3::aodv::NeighborTest, ChainRegressionTest, and ns3::aodv::IdCacheTest.

◆ DoSetup()

◆ DoTeardown()

void ns3::TestCase::DoTeardown ( void  )
privatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test teardown

Reimplemented in WifiPhyThresholdsTest, TestAmpduReception, TestPhyHeadersReception, TestSimpleFrameCaptureModel, TestThresholdPreambleDetectionWithFrameCapture, TestThresholdPreambleDetectionWithoutFrameCapture, TestUlOfdmaPowerControl, TestPhyPaddingExclusion, TestUlOfdmaPhyTransmission, TestMultipleHeTbPreambles, TestUlOfdmaPpduUid, TestDlOfdmaPhyTransmission, SpectrumWifiPhyFilterTest, SpectrumWifiPhyBasicTest, Ns3TcpStateTestCase, Ns3TcpLossTestCase, ReadFileTestCase, RecordHeaderTestCase, FileHeaderTestCase, ReadModeCreateTestCase, WriteModeCreateTestCase, WaypointMobilityModelAddWaypointTest, WaypointMobilityModelNotifyTest, SteadyStateRandomWaypointTest, TcpTxBufferTestCase, TimestampValueTestCase, TcpTestCase, TcpRxBufferTestCase, TcpRateLinuxWithBufferTest, TcpOptionTSTestCase, TcpOptionWSTestCase, TcpHeaderWithRFC793OptionTestCase, TcpHeaderGetSetTestCase, ns3::TcpGeneralTest, RttEstimatorTestCase, DualStackTestCase, IpAddressHelperTestCasev6, AddressCollision6TestCase, ExampleAddress6GeneratorTestCase, NetworkAndAddress6TestCase, AddressAllocator6TestCase, NetworkNumber6AllocatorTestCase, IpAddressHelperTestCasev4, ResetAllocatorHelperTestCase, AddressAllocatorHelperTestCase, NetworkAllocatorHelperTestCase, AddressCollisionTestCase, ExampleAddressGeneratorTestCase, NetworkAndAddressTestCase, AddressAllocatorTestCase, NetworkNumberAllocatorTestCase, TimerTemplateTestCase, TimeWithSignTestCase, TimeSimpleTestCase, ThreadedSimulatorEventsTestCase, ns3::tests::AlternateFindTestCase, ns3::tests::RelativeFindTestCase, ns3::tests::FullyQualifiedFindTestCase, ns3::tests::StringContextFindTestCase, ns3::tests::BasicFindTestCase, ns3::tests::FindPathTestCase, ns3::tests::RelativeRenameTestCase, ns3::tests::FullyQualifiedRenameTestCase, ns3::tests::StringContextRenameTestCase, ns3::tests::BasicRenameTestCase, ns3::tests::RelativeAddTestCase, ns3::tests::FullyQualifiedAddTestCase, ns3::tests::StringContextAddTestCase, ns3::tests::BasicAddTestCase, Ns2MobilityHelperTest, LteHandoverTargetTestCase, LteUeMeasurementsHandoverTestCase, LteUeMeasurementsPiecewiseTestCase3, LteUeMeasurementsPiecewiseTestCase2, LteUeMeasurementsPiecewiseTestCase1, LteSecondaryCellHandoverTestCase, TcpLinuxRenoCongAvoidTest, TcpLinuxRenoSSTest, and ThreeGppHttpObjectTestCase.

Definition at line 477 of file test.cc.

References NS_LOG_FUNCTION.

◆ GetName()

std::string ns3::TestCase::GetName ( void  ) const
Returns
The name of this test

Definition at line 370 of file test.cc.

References m_name, and NS_LOG_FUNCTION.

Referenced by LteAggregationThroughputScaleTestCase::LteAggregationThroughputScaleTestCase(), LteCellSelectionTestCase::LteCellSelectionTestCase(), LtePrimaryCellChangeTestCase::LtePrimaryCellChangeTestCase(), LteRadioLinkFailureTestCase::LteRadioLinkFailureTestCase(), LteRrcConnectionEstablishmentErrorTestCase::LteRrcConnectionEstablishmentErrorTestCase(), LteRrcConnectionEstablishmentTestCase::LteRrcConnectionEstablishmentTestCase(), LteSecondaryCellSelectionTestCase::LteSecondaryCellSelectionTestCase(), TcpRenoCongAvoidTestSuite::TcpRenoCongAvoidTestSuite(), TcpSlowStartTestSuite::TcpSlowStartTestSuite(), ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTestCase(), LteAggregationThroughputScaleTestCase::~LteAggregationThroughputScaleTestCase(), LteCellSelectionTestCase::~LteCellSelectionTestCase(), LtePrimaryCellChangeTestCase::~LtePrimaryCellChangeTestCase(), LteRadioLinkFailureTestCase::~LteRadioLinkFailureTestCase(), LteSecondaryCellSelectionTestCase::~LteSecondaryCellSelectionTestCase(), PacketTagListTest::AddRemoveTime(), ns3::int64x64::test::Int64x64CompareTestCase::Check(), ns3::int64x64::test::Int64x64Bug455TestCase::Check(), ns3::int64x64::test::Int64x64Bug863TestCase::Check(), ns3::int64x64::test::Int64x64HiLoTestCase::Check(), ns3::int64x64::test::Int64x64IntRoundTestCase::Check(), ns3::int64x64::test::Int64x64DoubleTestCase::Check(), TimeInputOutputTestCase::Check(), ns3::int64x64::test::Int64x64InputTestCase::Check(), ns3::int64x64::test::Int64x64InputOutputTestCase::Check(), ns3::tests::HashTestCase::Check(), ns3::int64x64::test::Int64x64Bug1786TestCase::Check(), TimeInputOutputTestCase::CheckAs(), ns3::int64x64::test::Int64x64InvertTestCase::CheckCase(), ThreeGppHttpObjectTestCase::DoRun(), LteCellSelectionTestCase::DoRun(), LtePrimaryCellChangeTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteSecondaryCellHandoverTestCase::DoRun(), LteSecondaryCellSelectionTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsPiecewiseTestCase3::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), ns3::tests::BuildProfileTestCase::DoRun(), ns3::tests::DefaultHashTestCase::DoRun(), ns3::tests::IncrementalTestCase::DoRun(), ns3::int64x64::test::Int64x64HiLoTestCase::DoRun(), ns3::int64x64::test::Int64x64IntRoundTestCase::DoRun(), ns3::int64x64::test::Int64x64InputTestCase::DoRun(), ns3::int64x64::test::Int64x64InputOutputTestCase::DoRun(), ns3::int64x64::test::Int64x64ArithmeticTestCase::DoRun(), ns3::int64x64::test::Int64x64Bug455TestCase::DoRun(), ns3::int64x64::test::Int64x64Bug863TestCase::DoRun(), ns3::int64x64::test::Int64x64Bug1786TestCase::DoRun(), ns3::int64x64::test::Int64x64CompareTestCase::DoRun(), ns3::int64x64::test::Int64x64InvertTestCase::DoRun(), ns3::int64x64::test::Int64x64DoubleTestCase::DoRun(), ns3::int64x64::test::Int64x64ImplTestCase::DoRun(), TimeInputOutputTestCase::DoRun(), UniqueTypeIdTestCase::DoRun(), CollisionTestCase::DoRun(), DeprecatedAttributeTestCase::DoRun(), LookupTimeTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LteInterferenceTestCase::DoRun(), LenaMimoTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LteUeMeasurementsTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), PacketTagListTest::DoRun(), ThreeGppHttpObjectTestCase::DoTeardown(), LteAggregationThroughputScaleTestCase::GetThroughput(), ns3::tests::CommandLineTestCaseBase::Parse(), and PacketTagListTest::RemoveTime().

◆ GetParent()

TestCase * ns3::TestCase::GetParent ( ) const
protected

Get the parent of this TestCsse.

Returns
A pointer to the parent of this test.

Definition at line 376 of file test.cc.

References m_parent.

Referenced by ns3::int64x64::test::Int64x64CompareTestCase::Check(), ns3::int64x64::test::Int64x64Bug455TestCase::Check(), ns3::int64x64::test::Int64x64Bug863TestCase::Check(), ns3::int64x64::test::Int64x64HiLoTestCase::Check(), ns3::int64x64::test::Int64x64IntRoundTestCase::Check(), ns3::int64x64::test::Int64x64DoubleTestCase::Check(), TimeInputOutputTestCase::Check(), ns3::int64x64::test::Int64x64InputTestCase::Check(), ns3::int64x64::test::Int64x64InputOutputTestCase::Check(), ns3::int64x64::test::Int64x64Bug1786TestCase::Check(), TimeInputOutputTestCase::CheckAs(), ns3::int64x64::test::Int64x64InvertTestCase::CheckCase(), ns3::int64x64::test::Int64x64HiLoTestCase::DoRun(), ns3::int64x64::test::Int64x64IntRoundTestCase::DoRun(), ns3::int64x64::test::Int64x64InputTestCase::DoRun(), ns3::int64x64::test::Int64x64InputOutputTestCase::DoRun(), ns3::int64x64::test::Int64x64ArithmeticTestCase::DoRun(), ns3::int64x64::test::Int64x64Bug455TestCase::DoRun(), ns3::int64x64::test::Int64x64Bug863TestCase::DoRun(), ns3::int64x64::test::Int64x64Bug1786TestCase::DoRun(), ns3::int64x64::test::Int64x64CompareTestCase::DoRun(), ns3::int64x64::test::Int64x64InvertTestCase::DoRun(), ns3::int64x64::test::Int64x64DoubleTestCase::DoRun(), ns3::int64x64::test::Int64x64ImplTestCase::DoRun(), TimeInputOutputTestCase::DoRun(), and ns3::tests::CommandLineTestCaseBase::Parse().

+ Here is the caller graph for this function:

◆ IsFailed()

bool ns3::TestCase::IsFailed ( void  ) const
private

Check if any tests failed.

Returns
true if any of the tests have failed, false otherwise.

Definition at line 340 of file test.cc.

References ns3::TestCase::Result::childrenFailed, ns3::TestCase::Result::failure, m_result, and NS_LOG_FUNCTION.

◆ IsStatusFailure()

bool ns3::TestCase::IsStatusFailure ( void  ) const
protected

Check if any tests failed.

Returns
true if any of the tests have failed, false otherwise.

Definition at line 452 of file test.cc.

References IsStatusSuccess(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsStatusSuccess()

bool ns3::TestCase::IsStatusSuccess ( void  ) const
protected

Check if all tests passed.

Returns
true if the tests have succeeded, false otherwise.

Definition at line 458 of file test.cc.

References ns3::TestCase::Result::failure, m_result, and NS_LOG_FUNCTION.

Referenced by Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpStateTestCase::Ipv4L3Tx(), and IsStatusFailure().

+ Here is the caller graph for this function:

◆ MustAssertOnFailure()

bool ns3::TestCase::MustAssertOnFailure ( void  ) const
protected

Check if this run should assert on failure.

Returns
true if we should assert on failure.

Definition at line 399 of file test.cc.

References m_runner, ns3::TestRunnerImpl::MustAssertOnFailure(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ MustContinueOnFailure()

bool ns3::TestCase::MustContinueOnFailure ( void  ) const
protected

Check if this run should continue on failure.

Returns
true if we should continue on failure.

Definition at line 405 of file test.cc.

References m_runner, ns3::TestRunnerImpl::MustContinueOnFailure(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ operator=()

TestCase& ns3::TestCase::operator= ( const TestCase )
delete

◆ ReportTestFailure()

void ns3::TestCase::ReportTestFailure ( std::string  cond,
std::string  actual,
std::string  limit,
std::string  message,
std::string  file,
int32_t  line 
)
protected

Log the failure of this TestCase.

Parameters
[in]condThe test condition.
[in]actualActual value of the test.
[in]limitExpected value of the test.
[in]messageMessage indicating the type of failure.
[in]fileThe file where the test failed.
[in]lineThe line number in file where the test failed.

Definition at line 382 of file test.cc.

References ns3::TestCase::Result::childrenFailed, ns3::TestCase::Result::failure, create-module::file, m_parent, m_result, and NS_LOG_FUNCTION.

◆ Run()

void ns3::TestCase::Run ( TestRunnerImpl runner)
private

Actually run this TestCase.

Parameters
[in]runnerThe test runner implementation.

Definition at line 347 of file test.cc.

References ns3::TestCase::Result::clock, DoSetup(), m_children, m_result, m_runner, NS_LOG_FUNCTION, test-ns3::runner, and ns3::SystemWallClockMs::Start().

+ Here is the call graph for this function:

◆ SetDataDir()

void ns3::TestCase::SetDataDir ( std::string  directory)
protected

Set the data directory where reference trace files can be found.

Parameters
[in]directoryThe directory where the test data is located

In general, this method is invoked as SetDataDir (NS_TEST_SOURCEDIR); However, if a module contains a test directory with subdirectories (e.g. src/mesh/test), and the test data (e.g. pcap traces) is located in one of these subdirectories, then the variable NS_TEST_SOURCEDIR may not work and the user may want to explicitly pass in a directory string.

Note that NS_TEST_SOURCEDIR is set in src/CMakeLists.txt for each module

Definition at line 465 of file test.cc.

References m_dataDir, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvLoopbackTestSuite::AodvLoopbackTestSuite(), Ns3TcpLossTestSuite::Ns3TcpLossTestSuite(), Ns3TcpStateTestSuite::Ns3TcpStateTestSuite(), PcapFileTestSuite::PcapFileTestSuite(), and MobilityTraceTestCase::DoRun().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TestRunnerImpl

friend class TestRunnerImpl
friend

Needs access to the TestCase data members.

Definition at line 1128 of file test.h.

Member Data Documentation

◆ m_children

std::vector<TestCase *> ns3::TestCase::m_children
private

Vector of my children.

Definition at line 1172 of file test.h.

Referenced by ~TestCase(), AddTestCase(), and Run().

◆ m_dataDir

std::string ns3::TestCase::m_dataDir
private

My data directory.

Definition at line 1173 of file test.h.

Referenced by CreateDataDirFilename(), and SetDataDir().

◆ m_duration

enum TestDuration ns3::TestCase::m_duration
private

TestCase duration.

Definition at line 1176 of file test.h.

Referenced by AddTestCase().

◆ m_name

std::string ns3::TestCase::m_name
private

TestCase name.

Definition at line 1176 of file test.h.

Referenced by AddTestCase(), CreateTempDirFilename(), and GetName().

◆ m_parent

TestCase* ns3::TestCase::m_parent
private

Pointer to my parent TestCase.

Definition at line 1171 of file test.h.

Referenced by ~TestCase(), AddTestCase(), CreateDataDirFilename(), CreateTempDirFilename(), GetParent(), and ReportTestFailure().

◆ m_result

struct Result* ns3::TestCase::m_result
private

Results data.

Definition at line 1175 of file test.h.

Referenced by ~TestCase(), IsFailed(), IsStatusSuccess(), ReportTestFailure(), and Run().

◆ m_runner

TestRunnerImpl* ns3::TestCase::m_runner
private

The documentation for this class was generated from the following files: