A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::TestCase Class Reference

encapsulates test code More...

#include <test.h>

Inherited by AddressAllocator6TestCase, AddressAllocatorHelperTestCase, AddressAllocatorTestCase, AddressCollision6TestCase, AddressCollisionTestCase, AlternateFindTestCase, AttributeTestCase< T >, BasicAddTestCase, BasicCallbackTestCase, BasicEnergyDepletionTest, BasicEnergyUpdateTest, BasicFindTestCase, BasicRandomNumberTestCase, BasicRenameTestCase, BasicTracedCallbackTestCase, BatteryLifetimeTest, BufferTest, CallbackValueTestCase, CommandLineTestCaseBase, CsmaBridgeTestCase, CsmaBroadcastTestCase, CsmaMulticastTestCase, CsmaOneSubnetTestCase, CsmaPacketSocketTestCase, CsmaPingTestCase, CsmaRawIpSocketTestCase, CsmaStarTestCase, CtrlBAckResponseHeaderTest, DiffTestCase, DropTailQueueTestCase, DsaRequestTestCase, DualStackTestCase, DynamicGlobalRoutingTestCase, ErrorModelSimple, ExampleAddress6GeneratorTestCase, ExampleAddressGeneratorTestCase, FileHeaderTestCase, FindPathTestCase, FiveDoublesAverageTestCase, FiveDoublesTestCase, FiveIntegersAverageTestCase, FiveIntegersTestCase, FlameRegressionTest, FriisPropagationLossModelTestCase, FullyQualifiedAddTestCase, FullyQualifiedFindTestCase, FullyQualifiedRenameTestCase, GlobalRouteManagerImplTestCase, GlobalRoutingSlash32TestCase, HwmpDoRfRegressionTest, HwmpProactiveRegressionTest, HwmpReactiveRegressionTest, HwmpSimplestRegressionTest, Int64x64ArithmeticTestCase, Int64x64Bug455TestCase, Int64x64Bug863TestCase, Int64x64CompareTestCase, Int64x64FracTestCase, Int64x64InputOutputTestCase, Int64x64InputTestCase, Int64x64InvertTestCase, IntegerTraceSourceAttributeTestCase, IntegerTraceSourceTestCase, IpAddressHelperTestCasev4, IpAddressHelperTestCasev6, Ipv4FragmentationTest, Ipv4HeaderTest, Ipv4ListRoutingNegativeTestCase, Ipv4ListRoutingPositiveTestCase, Ipv4PacketInfoTagTest, Ipv4RawSocketImplTest, Ipv6AddressTestCase1, Ipv6FragmentationTest, Ipv6ListRoutingNegativeTestCase, Ipv6ListRoutingPositiveTestCase, Ipv6PacketInfoTagTest, LenaFdMtFfMacSchedulerTestCase, LenaTdMtFfMacSchedulerTestCase, LenaTtaFfMacSchedulerTestCase, LogDistancePropagationLossModelTestCase, MakeBoundCallbackTestCase, MakeCallbackTemplatesTestCase, MakeCallbackTestCase, ManyUniformRandomVariablesOneGetValueCallTestCase, MatrixPropagationLossModelTestCase, MobilityTraceTestCase, NetworkAllocatorHelperTestCase, NetworkAndAddress6TestCase, NetworkAndAddressTestCase, NetworkNumber6AllocatorTestCase, NetworkNumberAllocatorTestCase, ns3::AcousticModemEnergyDepletionTestCase, ns3::AcousticModemEnergyTestCase, ns3::AggregateObjectTestCase, ns3::AnimationInterfaceTestCase, ns3::aodv::AodvRqueueTest, ns3::aodv::AodvRtableEntryTest, ns3::aodv::AodvRtableTest, ns3::aodv::Bug772ChainTest, ns3::aodv::ChainRegressionTest, 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::BriteTopologyFunctionTestCase, ns3::BriteTopologyStructureTestCase, ns3::Bug555TestCase, ns3::BuildingsHelperOneTestCase, ns3::BuildingsPathlossTestCase, ns3::BuildingsShadowingTestCase, ns3::CosineAntennaModelTestCase, ns3::CreateObjectTestCase, ns3::DcfManagerTest, ns3::DegreesToRadiansTestCase, ns3::dot11s::HwmpRtableTest, ns3::dot11s::MeshHeaderTest, ns3::dot11s::PeerLinkFrameStartTest, ns3::DsdvHeaderTestCase, ns3::DsdvTableTestCase, ns3::dsr::DsrAckHeaderTest, ns3::dsr::DsrAckReqHeaderTest, ns3::dsr::DsrCacheEntryTest, ns3::dsr::DsrFsHeaderTest, ns3::dsr::DsrRerrHeaderTest, ns3::dsr::DsrRrepHeaderTest, ns3::dsr::DsrRreqHeaderTest, ns3::dsr::DsrRreqTableTest, ns3::dsr::DsrSendBuffTest, ns3::dsr::DsrSRHeaderTest, ns3::EpcS1uDlTestCase, ns3::EpcS1uUlTestCase, ns3::EpcTftClassifierTestCase, ns3::EpsGtpuHeaderTestCase, ns3::EventGarbageCollectorTestCase, ns3::flame::FlameHeaderTest, ns3::flame::FlameRtableTest, ns3::GlobalValueTestCase, ns3::HistogramTestCase, ns3::InterferenceHelperSequenceTest, ns3::Ipv4L3ProtocolTestCase, ns3::Ipv6L3ProtocolTestCase, ns3::IsotropicAntennaModelTestCase, ns3::ItuR1411LosPropagationLossModelTestCase, ns3::ItuR1411NlosOverRooftopPropagationLossModelTestCase, ns3::Kun2600MhzPropagationLossModelTestCase, ns3::LenaDataPhyErrorModelTestCase, ns3::LenaDlCtrlPhyErrorModelTestCase, ns3::LenaFdBetFfMacSchedulerTestCase1, ns3::LenaFdBetFfMacSchedulerTestCase2, ns3::LenaFdTbfqFfMacSchedulerTestCase1, ns3::LenaFdTbfqFfMacSchedulerTestCase2, ns3::LenaMimoTestCase, ns3::LenaPfFfMacSchedulerTestCase1, ns3::LenaPfFfMacSchedulerTestCase2, ns3::LenaPssFfMacSchedulerTestCase1, ns3::LenaPssFfMacSchedulerTestCase2, ns3::LenaRrFfMacSchedulerTestCase, ns3::LenaTdBetFfMacSchedulerTestCase1, ns3::LenaTdBetFfMacSchedulerTestCase2, ns3::LenaTdTbfqFfMacSchedulerTestCase1, ns3::LenaTdTbfqFfMacSchedulerTestCase2, ns3::LiIonEnergyTestCase, ns3::LteDownlinkCtrlSinrTestCase, ns3::LteDownlinkDataSinrTestCase, ns3::LteEarfcnTestCase, ns3::LteEnbAntennaTestCase, ns3::LteEpcE2eDataTestCase, ns3::LteFadingSystemTestCase, ns3::LteFadingTestCase, ns3::LteInterferenceTestCase, ns3::LteLinkAdaptationTestCase, ns3::LteNoisePsdTestCase, ns3::LtePathlossModelSystemTestCase, ns3::LteRlcAmE2eTestCase, ns3::LteRlcAmTransmitterTestCase, ns3::LteRlcUmE2eTestCase, ns3::LteRlcUmTransmitterTestCase, ns3::LteSpectrumModelTestCase, ns3::LteTxPsdTestCase, ns3::LteUplinkDataSinrTestCase, ns3::LteUplinkSrsSinrTestCase, ns3::MeshInformationElementVectorBist, ns3::Ns2MobilityHelperTest, ns3::ObjectFactoryTestCase, ns3::OkumuraHataPropagationLossModelTestCase, ns3::olsr::Bug780Test, ns3::olsr::HelloRegressionTest, ns3::olsr::OlsrMprTestCase, ns3::olsr::TcRegressionTest, ns3::OlsrEmfTestCase, ns3::OlsrHelloTestCase, ns3::OlsrHnaTestCase, ns3::OlsrMidTestCase, ns3::OlsrTcTestCase, ns3::OneVectorConstructorTestCase, ns3::ParabolicAntennaModelTestCase, ns3::QosUtilsIsOldPacketTest, ns3::RadiansToDegreesTestCase, ns3::RandomRoomPositionAllocatorTestCase, ns3::RocketfuelTopologyReaderTest, ns3::SameRoomPositionAllocatorTestCase, ns3::SpectrumIdealPhyTestCase, ns3::SpectrumInterferenceTestCase, ns3::SpectrumValueTestCase, ns3::SteadyStateRandomWaypointTest, ns3::TestSuite, ns3::TwoVectorsConstructorTestCase, ns3::TxDurationTest, ns3::WaypointMobilityModelNotifyTest, ns3::WifiTest, Ns3TcpCwndTestCase1, Ns3TcpCwndTestCase2, Ns3TcpInteroperabilityTestCase, Ns3TcpLossTestCase, Ns3TcpNoDelayTestCase, Ns3TcpSocketTestCase1, Ns3TcpSocketTestCase2, Ns3TcpStateTestCase, Ns3WimaxCsParamTlvTestCase, Ns3WimaxFragmentationTestCase, Ns3WimaxManagementConnectionsTestCase, Ns3WimaxNetworkEntryTestCase, Ns3WimaxSchedulingTestCase, Ns3WimaxSfCreationTestCase, Ns3WimaxSfTlvTestCase, Ns3WimaxSFTypeTestCase, Ns3WimaxSimpleOFDMTestCase, Ns3WimaxSNRtoBLERTestCase, NscTcpLossTestCase1, NscTcpLossTestCase2, NullifyCallbackTestCase, ObjectMapAttributeTestCase, ObjectVectorAttributeTestCase, ObjectVectorConfigTestCase, ObjectVectorTraceConfigTestCase, OneIntegerAverageTestCase, OneIntegerTestCase, OneUniformRandomVariableManyGetValueCallsTestCase, PacketBufferingCaseA, PacketBufferingCaseB, PacketLossCounterTestCase, PacketMetadataTest, PacketTest, PbbTestCase, PeerManagementProtocolRegressionTest, PointerAttributeTestCase, PointToPointTest, PtrTestCase, RandomNumberSerializationTestCase, RandomVariableStreamAttributeTestCase, RandomVariableStreamConstantTestCase, RandomVariableStreamDeterministicTestCase, RandomVariableStreamEmpiricalAntitheticTestCase, RandomVariableStreamEmpiricalTestCase, RandomVariableStreamErlangAntitheticTestCase, RandomVariableStreamErlangTestCase, RandomVariableStreamExponentialAntitheticTestCase, RandomVariableStreamExponentialTestCase, RandomVariableStreamGammaAntitheticTestCase, RandomVariableStreamGammaTestCase, RandomVariableStreamLogNormalAntitheticTestCase, RandomVariableStreamLogNormalTestCase, RandomVariableStreamNormalAntitheticTestCase, RandomVariableStreamNormalTestCase, RandomVariableStreamParetoAntitheticTestCase, RandomVariableStreamParetoTestCase, RandomVariableStreamSequentialTestCase, RandomVariableStreamUniformAntitheticTestCase, RandomVariableStreamUniformTestCase, RandomVariableStreamWeibullAntitheticTestCase, RandomVariableStreamWeibullTestCase, RandomVariableStreamZetaAntitheticTestCase, RandomVariableStreamZetaTestCase, RandomVariableStreamZipfAntitheticTestCase, RandomVariableStreamZipfTestCase, RangePropagationLossModelTestCase, ReadFileTestCase, ReadModeCreateTestCase, RecordHeaderTestCase, RedQueueTestCase, RelativeAddTestCase, RelativeFindTestCase, RelativeRenameTestCase, ResetAllocatorHelperTestCase, RngExponentialTestCase, RngNormalTestCase, RngParetoTestCase, RngUniformTestCase, RootNamespaceConfigTestCase, SampleTestCase1, SequenceNumberTestCase, SimulatorEventsTestCase, SimulatorTemplateTestCase, StaticRoutingSlash32TestCase, StringContextAddTestCase, StringContextFindTestCase, StringContextRenameTestCase, SwitchFlowTableTestCase, TcpTestCase, TestEmptyOptionField, TestFulfilledAlignment, TestOptionWithAlignment, TestOptionWithoutAlignment, ThreadedSimulatorEventsTestCase, TimerStateTestCase, TimerTemplateTestCase, TimeSimpleTestCase, TimesWithSignsTestCase, TracedCallbackTestCase, TwoRayGroundPropagationLossModelTestCase, TypeTraitsTestCase, UanTest, Udp6SocketImplTest, Udp6SocketLoopbackTest, UdpClientServerTestCase, UdpEchoClientSetFillTestCase, UdpSocketImplTest, UdpSocketLoopbackTest, UdpTraceClientServerTestCase, UnderRootNamespaceConfigTestCase, WatchdogTestCase, WaypointInitialPositionIsWaypoint, WaypointLazyNotifyFalse, WaypointLazyNotifyTrue, WaypointMobilityModelViaHelper, WifiInterferenceTestCase, WifiMsduAggregatorThroughputTest, and WriteModeCreateTestCase.

+ Collaboration diagram for ns3::TestCase:

Classes

struct  Result

Public Member Functions

virtual ~TestCase ()

Protected Member Functions

 TestCase (std::string name)
void AddTestCase (TestCase *testCase)
 Add an individual test case to this test suite.
std::string CreateDataDirFilename (std::string filename)
std::string CreateTempDirFilename (std::string filename)
bool GetErrorStatus (void) const NS_DEPRECATED
std::string GetName (void) const
bool IsStatusFailure (void) const
bool IsStatusSuccess (void) const
bool MustAssertOnFailure (void) const
bool MustContinueOnFailure (void) const
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
void SetDataDir (std::string directory)

Private Member Functions

 TestCase (TestCase &tc)
virtual void DoRun (void)=0
 Implementation to actually run this test case.
virtual void DoSetup (void)
 Implementation to do any local setup required for this test case.
virtual void DoTeardown (void)
 Implementation to do any local setup required for this test case.
bool IsFailed (void) const
TestCaseoperator= (TestCase &tc)
void Run (TestRunnerImpl *runner)

Private Attributes

std::vector< TestCase * > m_children
std::string m_dataDir
std::string m_name
TestCasem_parent
struct Resultm_result
TestRunnerImplm_runner

Friends

class TestRunnerImpl

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.

Definition at line 834 of file test.h.

Constructor & Destructor Documentation

ns3::TestCase::~TestCase ( )
virtual

Definition at line 155 of file test.cc.

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

ns3::TestCase::TestCase ( std::string  name)
protected
Parameters
namethe name of the new test created

Definition at line 145 of file test.cc.

References NS_LOG_FUNCTION.

ns3::TestCase::TestCase ( TestCase tc)
private

Member Function Documentation

void ns3::TestCase::AddTestCase ( TestCase testCase)
protected

Add an individual test case to this test suite.

Parameters
testCasePointer to the test case object to be added.

Definition at line 169 of file test.cc.

References m_children, m_name, m_parent, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ns3::AnglesTestSuite::AnglesTestSuite(), ns3::AnimationInterfaceTestSuite::AnimationInterfaceTestSuite(), ns3::aodv::AodvRegressionTestSuite::AodvRegressionTestSuite(), ns3::aodv::AodvTestSuite::AodvTestSuite(), AttributesTestSuite::AttributesTestSuite(), AverageTestSuite::AverageTestSuite(), BasicDataCalculatorsTestSuite::BasicDataCalculatorsTestSuite(), BasicEnergyModelTestSuite::BasicEnergyModelTestSuite(), BasicRandomNumberTestSuite::BasicRandomNumberTestSuite(), BlockAckTestSuite::BlockAckTestSuite(), ns3::BriteTestSuite::BriteTestSuite(), BufferTestSuite::BufferTestSuite(), ns3::BuildingPositionAllocatorTestSuite::BuildingPositionAllocatorTestSuite(), ns3::BuildingsHelperTestSuite::BuildingsHelperTestSuite(), ns3::BuildingsPathlossTestSuite::BuildingsPathlossTestSuite(), ns3::BuildingsShadowingTestSuite::BuildingsShadowingTestSuite(), CallbackTestSuite::CallbackTestSuite(), CommandLineTestSuite::CommandLineTestSuite(), ConfigTestSuite::ConfigTestSuite(), ns3::CosineAntennaModelTestSuite::CosineAntennaModelTestSuite(), CsmaSystemTestSuite::CsmaSystemTestSuite(), ns3::DcfTestSuite::DcfTestSuite(), ns3::DegreesRadiansTestSuite::DegreesRadiansTestSuite(), ns3::dot11s::Dot11sTestSuite::Dot11sTestSuite(), DropTailQueueTestSuite::DropTailQueueTestSuite(), ns3::DsdvTestSuite::DsdvTestSuite(), ns3::dsr::DsrTestSuite::DsrTestSuite(), ns3::EpcS1uDlTestSuite::EpcS1uDlTestSuite(), ns3::EpcS1uUlTestSuite::EpcS1uUlTestSuite(), ns3::EpcTftClassifierTestSuite::EpcTftClassifierTestSuite(), ns3::EpsGtpuTestSuite::EpsGtpuTestSuite(), ErrorModelTestSuite::ErrorModelTestSuite(), ns3::EventGarbageCollectorTestSuite::EventGarbageCollectorTestSuite(), ns3::flame::FlameTestSuite::FlameTestSuite(), GlobalRouteManagerImplTestSuite::GlobalRouteManagerImplTestSuite(), GlobalRoutingTestSuite::GlobalRoutingTestSuite(), ns3::GlobalValueTestSuite::GlobalValueTestSuite(), ns3::HistogramTestSuite::HistogramTestSuite(), ns3::aodv::IdCacheTestSuite::IdCacheTestSuite(), Int64x64128TestSuite::Int64x64128TestSuite(), Ipv4AddressGeneratorTestSuite::Ipv4AddressGeneratorTestSuite(), Ipv4AddressHelperTestSuite::Ipv4AddressHelperTestSuite(), Ipv4FragmentationTestSuite::Ipv4FragmentationTestSuite(), Ipv4HeaderTestSuite::Ipv4HeaderTestSuite(), ns3::IPv4L3ProtocolTestSuite::IPv4L3ProtocolTestSuite(), Ipv4ListRoutingTestSuite::Ipv4ListRoutingTestSuite(), Ipv4PacketInfoTagTestSuite::Ipv4PacketInfoTagTestSuite(), Ipv4RawTestSuite::Ipv4RawTestSuite(), Ipv6AddressGeneratorTestSuite::Ipv6AddressGeneratorTestSuite(), Ipv6AddressHelperTestSuite::Ipv6AddressHelperTestSuite(), Ipv6AddressTestSuite::Ipv6AddressTestSuite(), Ipv6DualStackTestSuite::Ipv6DualStackTestSuite(), Ipv6FragmentationTestSuite::Ipv6FragmentationTestSuite(), ns3::IPv6L3ProtocolTestSuite::IPv6L3ProtocolTestSuite(), Ipv6ListRoutingTestSuite::Ipv6ListRoutingTestSuite(), Ipv6PacketInfoTagTestSuite::Ipv6PacketInfoTagTestSuite(), ns3::IsotropicAntennaModelTestSuite::IsotropicAntennaModelTestSuite(), ns3::ItuR1411LosPropagationLossModelTestSuite::ItuR1411LosPropagationLossModelTestSuite(), ns3::ItuR1411NlosOverRooftopPropagationLossModelTestSuite::ItuR1411NlosOverRooftopPropagationLossModelTestSuite(), ns3::Kun2600MhzPropagationLossModelTestSuite::Kun2600MhzPropagationLossModelTestSuite(), ns3::LenaTestFdBetFfMacSchedulerSuite::LenaTestFdBetFfMacSchedulerSuite(), LenaTestFdMtFfMacSchedulerSuite::LenaTestFdMtFfMacSchedulerSuite(), ns3::LenaTestFdTbfqFfMacSchedulerSuite::LenaTestFdTbfqFfMacSchedulerSuite(), ns3::LenaTestMimoSuite::LenaTestMimoSuite(), ns3::LenaTestPfFfMacSchedulerSuite::LenaTestPfFfMacSchedulerSuite(), ns3::LenaTestPhyErrorModelrSuite::LenaTestPhyErrorModelrSuite(), ns3::LenaTestPssFfMacSchedulerSuite::LenaTestPssFfMacSchedulerSuite(), ns3::LenaTestRrFfMacSchedulerSuite::LenaTestRrFfMacSchedulerSuite(), ns3::LenaTestTdBetFfMacSchedulerSuite::LenaTestTdBetFfMacSchedulerSuite(), LenaTestTdMtFfMacSchedulerSuite::LenaTestTdMtFfMacSchedulerSuite(), ns3::LenaTestTdTbfqFfMacSchedulerSuite::LenaTestTdTbfqFfMacSchedulerSuite(), LenaTestTtaFfMacSchedulerSuite::LenaTestTtaFfMacSchedulerSuite(), ns3::LiIonEnergySourceTestSuite::LiIonEnergySourceTestSuite(), ns3::LteAntennaTestSuite::LteAntennaTestSuite(), ns3::LteDownlinkSinrTestSuite::LteDownlinkSinrTestSuite(), ns3::LteEarfcnTestSuite::LteEarfcnTestSuite(), ns3::LteEpcE2eDataTestSuite::LteEpcE2eDataTestSuite(), ns3::LteFadingTestSuite::LteFadingTestSuite(), ns3::LteInterferenceTestSuite::LteInterferenceTestSuite(), ns3::LteLinkAdaptationTestSuite::LteLinkAdaptationTestSuite(), ns3::LtePathlossModelTestSuite::LtePathlossModelTestSuite(), ns3::LteRlcAmE2eTestSuite::LteRlcAmE2eTestSuite(), ns3::LteRlcAmTransmitterTestSuite::LteRlcAmTransmitterTestSuite(), ns3::LteRlcUmE2eTestSuite::LteRlcUmE2eTestSuite(), ns3::LteRlcUmTransmitterTestSuite::LteRlcUmTransmitterTestSuite(), ns3::LteSpectrumValueHelperTestSuite::LteSpectrumValueHelperTestSuite(), ns3::LteUplinkSinrTestSuite::LteUplinkSinrTestSuite(), ManyUniformRandomVariablesOneGetValueCallTestSuite::ManyUniformRandomVariablesOneGetValueCallTestSuite(), ns3::MeshTestSuite::MeshTestSuite(), MobilityTestSuite::MobilityTestSuite(), MobilityTraceTestSuite::MobilityTraceTestSuite(), NamesTestSuite::NamesTestSuite(), ns3::Ns2MobilityHelperTestSuite::Ns2MobilityHelperTestSuite(), Ns3TcpCwndTestSuite::Ns3TcpCwndTestSuite(), Ns3TcpInteroperabilityTestSuite::Ns3TcpInteroperabilityTestSuite(), Ns3TcpLossTestSuite::Ns3TcpLossTestSuite(), Ns3TcpNoDelayTestSuite::Ns3TcpNoDelayTestSuite(), Ns3TcpSocketTestSuite::Ns3TcpSocketTestSuite(), Ns3TcpStateTestSuite::Ns3TcpStateTestSuite(), Ns3WimaxFragmentationTestSuite::Ns3WimaxFragmentationTestSuite(), Ns3WimaxMacMessagesTestSuite::Ns3WimaxMacMessagesTestSuite(), Ns3WimaxPhyTestSuite::Ns3WimaxPhyTestSuite(), Ns3WimaxQoSTestSuite::Ns3WimaxQoSTestSuite(), Ns3WimaxServiceFlowTestSuite::Ns3WimaxServiceFlowTestSuite(), Ns3WimaxSSMacTestSuite::Ns3WimaxSSMacTestSuite(), Ns3WimaxTlvTestSuite::Ns3WimaxTlvTestSuite(), NscTcpLossTestSuite::NscTcpLossTestSuite(), ns3::ObjectTestSuite::ObjectTestSuite(), ns3::OkumuraHataPropagationLossModelTestSuite::OkumuraHataPropagationLossModelTestSuite(), ns3::olsr::OlsrProtocolTestSuite::OlsrProtocolTestSuite(), ns3::OlsrTestSuite::OlsrTestSuite(), OneUniformRandomVariableManyGetValueCallsTestSuite::OneUniformRandomVariableManyGetValueCallsTestSuite(), PacketMetadataTestSuite::PacketMetadataTestSuite(), PacketTestSuite::PacketTestSuite(), ns3::ParabolicAntennaModelTestSuite::ParabolicAntennaModelTestSuite(), PbbTestSuite::PbbTestSuite(), PcapFileTestSuite::PcapFileTestSuite(), PointToPointTestSuite::PointToPointTestSuite(), PropagationLossModelsTestSuite::PropagationLossModelsTestSuite(), PtrTestSuite::PtrTestSuite(), RandomVariableStreamTestSuite::RandomVariableStreamTestSuite(), RedQueueTestSuite::RedQueueTestSuite(), ns3::olsr::RegressionTestSuite::RegressionTestSuite(), RngTestSuite::RngTestSuite(), ns3::RocketfuelTopologyReaderTestSuite::RocketfuelTopologyReaderTestSuite(), RvBatteryModelTestSuite::RvBatteryModelTestSuite(), SampleTestSuite::SampleTestSuite(), SequenceNumberTestSuite::SequenceNumberTestSuite(), SimulatorTestSuite::SimulatorTestSuite(), ns3::SpectrumConverterTestSuite::SpectrumConverterTestSuite(), ns3::SpectrumIdealPhyTestSuite::SpectrumIdealPhyTestSuite(), ns3::SpectrumInterferenceTestSuite::SpectrumInterferenceTestSuite(), ns3::SpectrumValueTestSuite::SpectrumValueTestSuite(), StaticRoutingTestSuite::StaticRoutingTestSuite(), ns3::SteadyStateRandomWaypointTestSuite::SteadyStateRandomWaypointTestSuite(), SwitchTestSuite::SwitchTestSuite(), TcpTestSuite::TcpTestSuite(), ThreadedSimulatorTestSuite::ThreadedSimulatorTestSuite(), TimerTestSuite::TimerTestSuite(), TimeTestSuite::TimeTestSuite(), TracedCallbackTestSuite::TracedCallbackTestSuite(), ns3::TxDurationTestSuite::TxDurationTestSuite(), TypeTraitsTestSuite::TypeTraitsTestSuite(), ns3::UanEnergyModelTestSuite::UanEnergyModelTestSuite(), UanTestSuite::UanTestSuite(), UdpClientServerTestSuite::UdpClientServerTestSuite(), UdpTestSuite::UdpTestSuite(), WatchdogTestSuite::WatchdogTestSuite(), ns3::WaypointMobilityModelTestSuite::WaypointMobilityModelTestSuite(), WifiInterferenceTestSuite::WifiInterferenceTestSuite(), WifiMsduAggregatorTestSuite::WifiMsduAggregatorTestSuite(), and ns3::WifiTestSuite::WifiTestSuite().

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

Definition at line 265 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(), and Ns3TcpLossTestCase::DoSetup().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implementation to actually run this test case.

Subclasses should override this method to conduct their tests.

Implemented in ns3::dsr::DsrRreqTableTest, ns3::aodv::AodvRtableTest, Udp6SocketImplTest, ns3::aodv::AodvRtableEntryTest, ns3::dsr::DsrSendBuffTest, ns3::dsr::DsrCacheEntryTest, ns3::Bug555TestCase, ns3::dsr::DsrAckHeaderTest, ns3::aodv::AodvRqueueTest, ns3::aodv::QueueEntryTest, ns3::dsr::DsrAckReqHeaderTest, Int64x64InvertTestCase, PacketMetadataTest, ns3::OlsrHnaTestCase, Int64x64CompareTestCase, ns3::aodv::RerrHeaderTest, ns3::dsr::DsrRerrHeaderTest, ns3::OlsrTcTestCase, ns3::aodv::RrepAckHeaderTest, ns3::dot11s::PeerLinkFrameStartTest, PacketTest, Int64x64Bug863TestCase, ns3::AcousticModemEnergyDepletionTestCase, UdpSocketImplTest, TestFulfilledAlignment, ns3::InterferenceHelperSequenceTest, ns3::dsr::DsrSRHeaderTest, Int64x64Bug455TestCase, ns3::aodv::RrepHeaderTest, ns3::QosUtilsIsOldPacketTest, ns3::OlsrHelloTestCase, Udp6SocketLoopbackTest, TestOptionWithAlignment, ns3::dsr::DsrRrepHeaderTest, NetworkAndAddressTestCase, ns3::aodv::RreqHeaderTest, NetworkAndAddress6TestCase, ResetAllocatorHelperTestCase, Int64x64ArithmeticTestCase, UdpSocketLoopbackTest, Ipv6FragmentationTest, ns3::DsdvTableTestCase, ns3::aodv::TypeHeaderTest, TimerTemplateTestCase, ns3::dsr::DsrRreqHeaderTest, Ipv4FragmentationTest, Ipv6ListRoutingPositiveTestCase, ns3::dot11s::HwmpRtableTest, TestOptionWithoutAlignment, Ipv4ListRoutingPositiveTestCase, Ipv4RawSocketImplTest, Int64x64InputOutputTestCase, Ipv4HeaderTest, HwmpReactiveRegressionTest, SequenceNumberTestCase, HwmpSimplestRegressionTest, HwmpDoRfRegressionTest, Ipv6ListRoutingNegativeTestCase, ns3::dsr::DsrFsHeaderTest, HwmpProactiveRegressionTest, ns3::flame::FlameRtableTest, FlameRegressionTest, ns3::DcfManagerTest, Ipv4ListRoutingNegativeTestCase, ns3::DsdvHeaderTestCase, TimerStateTestCase, ns3::Ipv6L3ProtocolTestCase, ns3::OlsrMidTestCase, ns3::Ipv4L3ProtocolTestCase, ns3::LteRlcAmTransmitterTestCase, ns3::LteRlcUmTransmitterTestCase, ns3::AcousticModemEnergyTestCase, WifiMsduAggregatorThroughputTest, ns3::AnimationInterfaceTestCase, ns3::olsr::OlsrMprTestCase, ns3::WifiTest, ns3::MeshInformationElementVectorBist, ns3::aodv::IdCacheTest, ns3::SpectrumInterferenceTestCase, ns3::SpectrumValueTestCase, Int64x64InputTestCase, TestEmptyOptionField, UanTest, PbbTestCase, ns3::aodv::LoopbackTestCase, ns3::dot11s::MeshHeaderTest, ns3::LiIonEnergyTestCase, GlobalRouteManagerImplTestCase, ns3::flame::FlameHeaderTest, ns3::EventGarbageCollectorTestCase, ns3::TxDurationTest, ns3::aodv::NeighborTest, RedQueueTestCase, SimulatorEventsTestCase, ns3::HistogramTestCase, NetworkNumber6AllocatorTestCase, ns3::OlsrEmfTestCase, WatchdogTestCase, NetworkNumberAllocatorTestCase, DropTailQueueTestCase, BufferTest, PointToPointTest, and Int64x64FracTestCase.

Referenced by Run().

+ Here is the caller graph for this function:

void ns3::TestCase::DoSetup ( void  )
privatevirtual

Implementation to do any local setup required for this test case.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Definition at line 331 of file test.cc.

References NS_LOG_FUNCTION.

Referenced by Run().

+ Here is the caller graph for this function:

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

Implementation to do any local setup required for this test case.

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

Reimplemented in NetworkAndAddressTestCase, NetworkAndAddress6TestCase, ResetAllocatorHelperTestCase, TimerTemplateTestCase, NetworkNumber6AllocatorTestCase, and NetworkNumberAllocatorTestCase.

Definition at line 336 of file test.cc.

References NS_LOG_FUNCTION.

Referenced by Run().

+ Here is the caller graph for this function:

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

This method is deprecated. IsStatusFailure replaces it.

Definition at line 305 of file test.cc.

References IsStatusFailure(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

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

Definition at line 229 of file test.cc.

References m_name, and NS_LOG_FUNCTION.

Referenced by ns3::LteFadingTestCase::DoRun(), ns3::TestRunnerImpl::FilterTests(), ns3::TestRunnerImpl::PrintReport(), and ns3::TestRunnerImpl::PrintTestNameList().

+ Here is the caller graph for this function:

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

Definition at line 199 of file test.cc.

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

Referenced by ns3::TestRunnerImpl::PrintReport(), ns3::TestRunnerImpl::Run(), and Run().

+ Here is the caller graph for this function:

bool ns3::TestCase::IsStatusFailure ( void  ) const
protected
Returns
true if the tests have failed, false otherwise.

Definition at line 311 of file test.cc.

References IsStatusSuccess(), and NS_LOG_FUNCTION.

Referenced by ns3::Ns2MobilityHelperTest::CheckInitialPositions(), and GetErrorStatus().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::TestCase::IsStatusSuccess ( void  ) const
protected
Returns
true if the tests have succeeded, false otherwise.

Definition at line 317 of file test.cc.

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

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

+ Here is the caller graph for this function:

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

Definition at line 252 of file test.cc.

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

+ Here is the call graph for this function:

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

Definition at line 258 of file test.cc.

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

+ Here is the call graph for this function:

TestCase& ns3::TestCase::operator= ( TestCase tc)
private
void ns3::TestCase::ReportTestFailure ( std::string  cond,
std::string  actual,
std::string  limit,
std::string  message,
std::string  file,
int32_t  line 
)
protected
void ns3::TestCase::Run ( TestRunnerImpl runner)
private

Definition at line 206 of file test.cc.

References ns3::TestCase::Result::clock, DoRun(), DoSetup(), DoTeardown(), ns3::SystemWallClockMs::End(), IsFailed(), m_children, m_result, m_runner, NS_LOG_FUNCTION, Run(), ns3::SystemWallClockMs::Start(), and test().

Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), UanTest::DoOnePhyTest(), PointToPointTest::DoRun(), WatchdogTestCase::DoRun(), SimulatorEventsTestCase::DoRun(), ns3::aodv::NeighborTest::DoRun(), GlobalRouteManagerImplTestCase::DoRun(), ns3::EventGarbageCollectorTestCase::DoRun(), ns3::LiIonEnergyTestCase::DoRun(), ns3::aodv::LoopbackTestCase::DoRun(), ns3::LenaMimoTestCase::DoRun(), ns3::SteadyStateRandomWaypointTest::DoRun(), ns3::SpectrumInterferenceTestCase::DoRun(), ns3::aodv::IdCacheTest::DoRun(), ns3::olsr::Bug780Test::DoRun(), ns3::LenaDataPhyErrorModelTestCase::DoRun(), ns3::LenaRrFfMacSchedulerTestCase::DoRun(), ns3::LteRlcUmE2eTestCase::DoRun(), WaypointLazyNotifyFalse::DoRun(), ns3::LteRlcAmE2eTestCase::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), ns3::WaypointMobilityModelNotifyTest::DoRun(), ns3::AnimationInterfaceTestCase::DoRun(), ns3::LenaPfFfMacSchedulerTestCase1::DoRun(), ErrorModelSimple::DoRun(), ns3::LenaPssFfMacSchedulerTestCase1::DoRun(), ns3::LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), ns3::LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), ns3::LteUplinkDataSinrTestCase::DoRun(), ns3::LteDownlinkDataSinrTestCase::DoRun(), ns3::LteLinkAdaptationTestCase::DoRun(), StaticRoutingSlash32TestCase::DoRun(), ns3::AcousticModemEnergyTestCase::DoRun(), MobilityTraceTestCase::DoRun(), UdpClientServerTestCase::DoRun(), ns3::LteInterferenceTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3WimaxSfCreationTestCase::DoRun(), ns3::LteEnbAntennaTestCase::DoRun(), ns3::LteFadingTestCase::DoRun(), Ns3TcpSocketTestCase1::DoRun(), Ns3WimaxNetworkEntryTestCase::DoRun(), ns3::LtePathlossModelSystemTestCase::DoRun(), DynamicGlobalRoutingTestCase::DoRun(), NscTcpLossTestCase1::DoRun(), PeerManagementProtocolRegressionTest::DoRun(), DualStackTestCase::DoRun(), CsmaBridgeTestCase::DoRun(), FlameRegressionTest::DoRun(), HwmpProactiveRegressionTest::DoRun(), ns3::flame::FlameRtableTest::DoRun(), ThreadedSimulatorEventsTestCase::DoRun(), ns3::LenaDlCtrlPhyErrorModelTestCase::DoRun(), ns3::olsr::HelloRegressionTest::DoRun(), Ns3TcpLossTestCase::DoRun(), TcpTestCase::DoRun(), ns3::LteDownlinkCtrlSinrTestCase::DoRun(), ns3::LenaPfFfMacSchedulerTestCase2::DoRun(), Ns3TcpStateTestCase::DoRun(), ns3::LenaTdBetFfMacSchedulerTestCase2::DoRun(), ns3::LteUplinkSrsSinrTestCase::DoRun(), ns3::LenaFdBetFfMacSchedulerTestCase2::DoRun(), ns3::LenaPssFfMacSchedulerTestCase2::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), HwmpDoRfRegressionTest::DoRun(), ns3::LteRlcUmTransmitterOneSduTestCase::DoRun(), ns3::aodv::Bug772ChainTest::DoRun(), HwmpSimplestRegressionTest::DoRun(), ns3::LteRlcAmTransmitterOneSduTestCase::DoRun(), Ipv6PacketInfoTagTest::DoRun(), HwmpReactiveRegressionTest::DoRun(), ns3::SpectrumIdealPhyTestCase::DoRun(), ns3::EpcS1uDlTestCase::DoRun(), Ipv4PacketInfoTagTest::DoRun(), ns3::LteRlcUmTransmitterSegmentationTestCase::DoRun(), ns3::LteRlcAmTransmitterSegmentationTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), ns3::dot11s::HwmpRtableTest::DoRun(), ns3::olsr::TcRegressionTest::DoRun(), ns3::LteEpcE2eDataTestCase::DoRun(), Ipv4FragmentationTest::DoRun(), ns3::BriteTopologyFunctionTestCase::DoRun(), TimerTemplateTestCase::DoRun(), ns3::LteRlcUmTransmitterConcatenationTestCase::DoRun(), ns3::LteRlcAmTransmitterConcatenationTestCase::DoRun(), WaypointLazyNotifyTrue::DoRun(), Ipv6FragmentationTest::DoRun(), UdpSocketLoopbackTest::DoRun(), Ns3WimaxManagementConnectionsTestCase::DoRun(), ns3::LteRlcAmTransmitterReportBufferStatusTestCase::DoRun(), ns3::LteRlcUmTransmitterReportBufferStatusTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), Udp6SocketLoopbackTest::DoRun(), Ns3TcpSocketTestCase2::DoRun(), WaypointInitialPositionIsWaypoint::DoRun(), NscTcpLossTestCase2::DoRun(), CsmaBroadcastTestCase::DoRun(), SimulatorTemplateTestCase::DoRun(), Ns3TcpCwndTestCase1::DoRun(), ns3::InterferenceHelperSequenceTest::DoRun(), ns3::aodv::ChainRegressionTest::DoRun(), ns3::AcousticModemEnergyDepletionTestCase::DoRun(), ns3::Ns2MobilityHelperTest::DoRun(), UdpEchoClientSetFillTestCase::DoRun(), ns3::EpcS1uUlTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), WaypointMobilityModelViaHelper::DoRun(), GlobalRoutingSlash32TestCase::DoRun(), ns3::aodv::AodvRqueueTest::DoRun(), ns3::Bug555TestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), ns3::dsr::DsrSendBuffTest::DoRun(), CsmaOneSubnetTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3WimaxSchedulingTestCase::DoRunOnce(), Ns3WimaxSimpleOFDMTestCase::DoRunOnce(), Ns3WimaxSFTypeTestCase::DoRunOnce(), TimerTemplateTestCase::DoTeardown(), ns3::DcfManagerTest::EndTest(), ns3::TestRunnerImpl::Run(), Run(), ns3::WifiTest::RunOne(), Ipv4RawSocketImplTest::SendData(), UdpSocketImplTest::SendData(), Udp6SocketImplTest::SendData(), Ipv4RawSocketImplTest::SendData_IpHdr(), Ipv4HeaderTest::SendData_IpHdr_Dscp(), BasicEnergyUpdateTest::StateSwitchTest(), BatteryLifetimeTest::VariableLoadTest(), and WifiInterferenceTestCase::WifiSimpleInterference().

+ Here is the call graph for this function:

void ns3::TestCase::SetDataDir ( std::string  directory)
protected
Parameters
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/wscript for each module

Definition at line 324 of file test.cc.

References m_dataDir, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvRegressionTestSuite::AodvRegressionTestSuite(), MobilityTraceTestCase::DoRun(), ns3::Ns2MobilityHelperTestSuite::Ns2MobilityHelperTestSuite(), Ns3TcpLossTestSuite::Ns3TcpLossTestSuite(), PcapFileTestSuite::PcapFileTestSuite(), and ns3::olsr::RegressionTestSuite::RegressionTestSuite().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class TestRunnerImpl
friend

Definition at line 894 of file test.h.

Member Data Documentation

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

Definition at line 930 of file test.h.

Referenced by AddTestCase(), ns3::TestRunnerImpl::PrintReport(), Run(), and ~TestCase().

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

Definition at line 931 of file test.h.

Referenced by CreateDataDirFilename(), and SetDataDir().

std::string ns3::TestCase::m_name
private
TestCase* ns3::TestCase::m_parent
private
struct Result* ns3::TestCase::m_result
private
TestRunnerImpl* ns3::TestCase::m_runner
private

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