A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
UanTest Class Reference

Uan Test. More...

+ Inheritance diagram for UanTest:
+ Collaboration diagram for UanTest:

Public Member Functions

 UanTest ()
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

Ptr< UanNetDeviceCreateNode (Vector pos, Ptr< UanChannel > chan)
 Create node function.
 
uint32_t DoOnePhyTest (Time t1, Time t2, uint32_t r1, uint32_t r2, Ptr< UanPropModel > prop, uint16_t mode1=0, uint16_t mode2=0)
 Do one Phy test function.
 
bool DoPhyTests ()
 Phy test function.
 
bool RxPacket (Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender)
 Receive packet function.
 
void SendOnePacket (Ptr< UanNetDevice > dev, uint16_t mode)
 Send one packet function.
 

Private Attributes

uint32_t m_bytesRx
 byes received
 
ObjectFactory m_phyFac
 Phy.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
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.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

Uan Test.

Definition at line 42 of file uan-test.cc.

Constructor & Destructor Documentation

◆ UanTest()

UanTest::UanTest ( )

Definition at line 99 of file uan-test.cc.

Member Function Documentation

◆ CreateNode()

Ptr< UanNetDevice > UanTest::CreateNode ( Vector  pos,
Ptr< UanChannel chan 
)
private

Create node function.

Parameters
posthe position of the device
chanthe communication channel
Returns
the UAN device

Definition at line 123 of file uan-test.cc.

References ns3::Mac8Address::Allocate(), ns3::ObjectFactory::Create(), and m_phyFac.

Referenced by DoOnePhyTest().

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

◆ DoOnePhyTest()

uint32_t UanTest::DoOnePhyTest ( Time  t1,
Time  t2,
uint32_t  r1,
uint32_t  r2,
Ptr< UanPropModel prop,
uint16_t  mode1 = 0,
uint16_t  mode2 = 0 
)
private

Do one Phy test function.

Parameters
t1the time to send first packet
t2the time to send the second packet
r1first distance constant
r2second distance constant
propthe propagation model
mode1the send mode for device 1
mode2the send mode for device 2
Returns
number of bytes received

Definition at line 147 of file uan-test.cc.

References CreateNode(), ns3::Simulator::Destroy(), m_bytesRx, ns3::MakeCallback(), ns3::Simulator::Run(), RxPacket(), ns3::Simulator::Schedule(), ns3::Seconds(), SendOnePacket(), and ns3::Simulator::Stop().

Referenced by DoPhyTests().

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

◆ DoPhyTests()

bool UanTest::DoPhyTests ( )
private

Phy test function.

Returns
true if successful

Definition at line 176 of file uan-test.cc.

References ns3::UanModesList::AppendMode(), ns3::UanTxModeFactory::CreateMode(), DoOnePhyTest(), ns3::UanTxMode::FSK, MRG32k3a::m1, m_phyFac, NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL, ns3::Seconds(), ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by DoRun().

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

◆ DoRun()

void UanTest::DoRun ( )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 286 of file uan-test.cc.

References DoPhyTests(), ns3::UanPhyGen::GetDefaultModes(), and NS_TEST_ASSERT_MSG_EQ_TOL.

+ Here is the call graph for this function:

◆ RxPacket()

bool UanTest::RxPacket ( Ptr< NetDevice dev,
Ptr< const Packet pkt,
uint16_t  mode,
const Address sender 
)
private

Receive packet function.

Parameters
devthe device
pktthe packet
modethe receive mode
senderthe address of the sender
Returns
true if successful

Definition at line 105 of file uan-test.cc.

References m_bytesRx.

Referenced by DoOnePhyTest().

+ Here is the caller graph for this function:

◆ SendOnePacket()

void UanTest::SendOnePacket ( Ptr< UanNetDevice dev,
uint16_t  mode 
)
private

Send one packet function.

Parameters
devthe device
modethe transmit mode

Definition at line 115 of file uan-test.cc.

Referenced by DoOnePhyTest().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bytesRx

uint32_t UanTest::m_bytesRx
private

byes received

Definition at line 96 of file uan-test.cc.

Referenced by DoOnePhyTest(), and RxPacket().

◆ m_phyFac

ObjectFactory UanTest::m_phyFac
private

Phy.

Definition at line 95 of file uan-test.cc.

Referenced by CreateNode(), and DoPhyTests().


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