It tests a number of cases related to SimpleGatewayLoraPhy's parallel reception paths. More...
Public Member Functions | |
| ReceivePathTest () | |
| Default constructor. | |
| ~ReceivePathTest () override | |
| Destructor. | |
| Public Member Functions inherited from ns3::TestCase | |
| TestCase (const TestCase &)=delete | |
| Caller graph was not generated because of its size. | |
| virtual | ~TestCase () |
| Destructor. | |
| std::string | GetName () const |
| TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
| void | DoRun () override |
| Implementation to actually run this TestCase. | |
| void | Interference (Ptr< const Packet > packet, uint32_t node) |
| Callback for tracing LostPacketBecauseInterference. | |
| void | NoMoreDemodulators (Ptr< const Packet > packet, uint32_t node) |
| Callback for tracing LostPacketBecauseNoMoreReceivers. | |
| void | OccupiedReceptionPaths (int oldValue, int newValue) |
| Callback for tracing OccupiedReceptionPaths. | |
| void | ReceivedPacket (Ptr< const Packet > packet, uint32_t node) |
| Callback for tracing ReceivedPacket. | |
| void | Reset (uint8_t rxPathNb) |
| Reset counters and gateway PHY for new sub test case. | |
Private Attributes | |
| Ptr< SimpleGatewayLoraPhy > | gatewayPhy |
| PHY layer of a gateway to be tested. | |
| int | m_interferenceCalls = 0 |
| Counter for LostPacketBecauseInterference calls. | |
| int | m_maxOccupiedReceptionPaths = 0 |
| Max number of concurrent OccupiedReceptionPaths. | |
| int | m_noMoreDemodulatorsCalls = 0 |
| Counter for LostPacketBecauseNoMoreReceivers calls. | |
| int | m_receivedPacketCalls = 0 |
| Counter for ReceivedPacket calls. | |
Additional Inherited Members | |
| Public Types inherited from ns3::TestCase | |
| enum class | Duration { 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, Duration duration=Duration::QUICK) |
| Add an individual child TestCase to this test suite. | |
| TestCase * | GetParent () 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. | |
It tests a number of cases related to SimpleGatewayLoraPhy's parallel reception paths.
Definition at line 427 of file lorawan-test-suite.cc.
| ReceivePathTest::ReceivePathTest | ( | ) |
Default constructor.
Definition at line 479 of file lorawan-test-suite.cc.
References ns3::TestCase::TestCase().
|
override |
Destructor.
Definition at line 485 of file lorawan-test-suite.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 564 of file lorawan-test-suite.cc.
References ns3::Create(), ns3::Simulator::Destroy(), gatewayPhy, ns3::Hours(), m_interferenceCalls, m_maxOccupiedReceptionPaths, m_noMoreDemodulatorsCalls, m_receivedPacketCalls, ns3::NanoSeconds(), NS_LOG_DEBUG, NS_TEST_EXPECT_MSG_EQ, Reset(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::lorawan::SimpleGatewayLoraPhy::StartReceive(), ns3::Simulator::Stop(), and ns3::lorawan::UP.
Callback for tracing LostPacketBecauseInterference.
| Packet | The packet lost. |
| node | The receiver node id if any, 0 otherwise. |
Definition at line 546 of file lorawan-test-suite.cc.
References m_interferenceCalls, and NS_LOG_FUNCTION.
Referenced by Reset().
Callback for tracing LostPacketBecauseNoMoreReceivers.
| Packet | The packet lost. |
| node | The receiver node id if any, 0 otherwise. |
Definition at line 538 of file lorawan-test-suite.cc.
References m_noMoreDemodulatorsCalls, and NS_LOG_FUNCTION.
Referenced by Reset().
|
private |
Callback for tracing OccupiedReceptionPaths.
| oldValue | The old value. |
| newValue | The new value. |
Definition at line 527 of file lorawan-test-suite.cc.
References m_maxOccupiedReceptionPaths, and NS_LOG_FUNCTION.
Referenced by Reset().
Callback for tracing ReceivedPacket.
| Packet | The packet received. |
| node | The receiver node id if any, 0 otherwise. |
Definition at line 554 of file lorawan-test-suite.cc.
References m_receivedPacketCalls, and NS_LOG_FUNCTION.
Referenced by Reset().
|
private |
Reset counters and gateway PHY for new sub test case.
| rxPathNb | Number of reception paths to be created on the gateway PHY |
Definition at line 490 of file lorawan-test-suite.cc.
References ns3::lorawan::LoraInterferenceHelper::collisionMatrix, ns3::CreateObject(), gatewayPhy, ns3::lorawan::LoraInterferenceHelper::GOURSAUD, Interference(), m_interferenceCalls, m_maxOccupiedReceptionPaths, m_noMoreDemodulatorsCalls, m_receivedPacketCalls, ns3::MakeCallback(), NoMoreDemodulators(), OccupiedReceptionPaths(), and ReceivedPacket().
Referenced by DoRun().
|
private |
PHY layer of a gateway to be tested.
Definition at line 470 of file lorawan-test-suite.cc.
|
private |
Counter for LostPacketBecauseInterference calls.
Definition at line 473 of file lorawan-test-suite.cc.
Referenced by DoRun(), Interference(), and Reset().
|
private |
Max number of concurrent OccupiedReceptionPaths.
Definition at line 475 of file lorawan-test-suite.cc.
Referenced by DoRun(), OccupiedReceptionPaths(), and Reset().
|
private |
Counter for LostPacketBecauseNoMoreReceivers calls.
Definition at line 472 of file lorawan-test-suite.cc.
Referenced by DoRun(), NoMoreDemodulators(), and Reset().
|
private |
Counter for ReceivedPacket calls.
Definition at line 474 of file lorawan-test-suite.cc.
Referenced by DoRun(), ReceivedPacket(), and Reset().