Tests that the DataRate attribute governs the transmission time. More...
Public Member Functions | |
| SimpleNetDeviceDataRateTestCase () | |
| 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. | |
| bool | Rx (Ptr< NetDevice > d, Ptr< const Packet > p, uint16_t proto, const Address &from) |
| Receive callback recording the reception time. | |
Private Attributes | |
| Time | m_rxTime {Time::Min()} |
| Time the packet was received. | |
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. | |
Tests that the DataRate attribute governs the transmission time.
A packet sent through a device configured with a finite DataRate is delivered after packetSize / DataRate seconds (the channel delay is zero). Sending a 125-byte (1000-bit) packet at 1 Mbps must complete at exactly 1 ms.
Definition at line 257 of file simple-net-device-test.cc.
| SimpleNetDeviceDataRateTestCase::SimpleNetDeviceDataRateTestCase | ( | ) |
Definition at line 278 of file simple-net-device-test.cc.
References ns3::TestCase::TestCase().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 294 of file simple-net-device-test.cc.
References ns3::Mac48Address::Allocate(), ns3::Create(), ns3::ObjectFactory::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), m_rxTime, ns3::MakeCallback(), ns3::MilliSeconds(), NS_TEST_ASSERT_MSG_EQ, ns3::Simulator::Run(), Rx(), ns3::Simulator::Schedule(), ns3::Seconds(), and ns3::SimpleNetDevice::Send().
|
private |
Receive callback recording the reception time.
| d | The receiving device. |
| p | The received packet. |
| proto | The protocol number. |
| from | The source address. |
Definition at line 284 of file simple-net-device-test.cc.
References m_rxTime, and ns3::Simulator::Now().
Referenced by DoRun().
Time the packet was received.
Definition at line 275 of file simple-net-device-test.cc.