21 #include "ns3/simulator.h"
24 #include "ns3/lte-rlc-header.h"
25 #include "ns3/lte-rlc-um.h"
40 :
TestSuite (
"lte-rlc-um-transmitter", SYSTEM)
85 txPdcp = CreateObject<LteTestPdcp> ();
88 txRlc = CreateObject<LteRlcUm> ();
89 txRlc->SetRnti (rnti);
90 txRlc->SetLcId (lcid);
93 txMac = CreateObject<LteTestMac> ();
97 txPdcp->SetLteRlcSapProvider (txRlc->GetLteRlcSapProvider ());
98 txRlc->SetLteRlcSapUser (
txPdcp->GetLteRlcSapUser ());
100 txRlc->SetLteMacSapProvider (
txMac->GetLteMacSapProvider ());
101 txMac->SetLteMacSapUser (txRlc->GetLteMacSapUser ());
141 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
144 txMac->SendTxOpportunity (Seconds (0.150), 28);
145 CheckDataReceived (Seconds (0.200),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"SDU is not OK");
174 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
177 txMac->SendTxOpportunity (Seconds (0.150), 10);
180 txMac->SendTxOpportunity (Seconds (0.200), 10);
183 txMac->SendTxOpportunity (Seconds (0.300), 10);
186 txMac->SendTxOpportunity (Seconds (0.400), 4);
216 txPdcp->SendData (Seconds (0.100),
"ABCDEFGH");
217 txPdcp->SendData (Seconds (0.150),
"IJKLMNOPQR");
218 txPdcp->SendData (Seconds (0.200),
"STUVWXYZ");
221 txMac->SendTxOpportunity (Seconds (0.250), 31);
222 CheckDataReceived (Seconds (0.300),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"Concatenation is not OK");
251 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJ");
252 txPdcp->SendData (Seconds (0.150),
"KLMNOPQRS");
253 txPdcp->SendData (Seconds (0.200),
"TUVWXYZ");
255 txMac->SendTxOpportunity (Seconds (0.250), (2+2) + (10+6));
258 txPdcp->SendData (Seconds (0.350),
"ABCDEFGH");
259 txPdcp->SendData (Seconds (0.400),
"IJKLMNOPQRST");
260 txPdcp->SendData (Seconds (0.450),
"UVWXYZ");
262 txMac->SendTxOpportunity (Seconds (0.500), 2 + 3);
265 txPdcp->SendData (Seconds (0.600),
"ABCDEFGH");
266 txPdcp->SendData (Seconds (0.650),
"IJKLMNOPQRST");
267 txPdcp->SendData (Seconds (0.700),
"UVWXYZ");
269 txPdcp->SendData (Seconds (0.750),
"ABCDEFGHIJ");
270 txPdcp->SendData (Seconds (0.800),
"KLMNOPQRST");
271 txPdcp->SendData (Seconds (0.850),
"UVWXYZ");
273 txMac->SendTxOpportunity (Seconds (0.900), 2 + 7);
276 txMac->SendTxOpportunity (Seconds (1.000), (2+2) + (8+2));
279 txPdcp->SendData (Seconds (1.100),
"ABCDEFGHIJ");
280 txPdcp->SendData (Seconds (1.150),
"KLMNOPQRST");
281 txPdcp->SendData (Seconds (1.200),
"UVWXYZ");
283 txMac->SendTxOpportunity (Seconds (1.250), 2 + 2);
286 txMac->SendTxOpportunity (Seconds (1.350), 2 + 3);
289 txMac->SendTxOpportunity (Seconds (1.450), 2 + 5);
292 txMac->SendTxOpportunity (Seconds (1.550), (2+2+1+2+1+2+1) + (6+8+12+6+10+10+3));
293 CheckDataReceived (Seconds (1.600),
"UVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW",
"SDU is not OK");
295 txMac->SendTxOpportunity (Seconds (1.650), (2+2+1+2) + (3+10+10+6));
296 CheckDataReceived (Seconds (1.700),
"XYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
"SDU is not OK");
keep track of time values and allow control of global simulation resolution
virtual ~LteRlcUmTransmitterSegmentationTestCase()
Test 4.1.1.1 One SDU, One PDU.
virtual ~LteRlcUmTransmitterConcatenationTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
static void Run(void)
Run the simulation until one of:
virtual void DoRun(void)
Implementation to actually run this TestCase.
LteRlcUmTransmitterTestSuite()
TestSuite 4.1.1 RLC UM: Only transmitter.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Test 4.1.1.4 Report Buffer Status (test primitive parameters)
virtual ~LteRlcUmTransmitterReportBufferStatusTestCase()
void CheckDataReceived(Time time, std::string shouldReceived, std::string assertMsg)
LteRlcUmTransmitterTestCase()
LteRlcUmTransmitterOneSduTestCase()
static void EnablePrinting(void)
By default, packets do not keep around enough metadata to perform the operations requested by the Pri...
Ptr< LteTestPdcp > txPdcp
TestSuite 4.1.1 RLC UM: Only transmitter.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
Test 4.1.1.3 Concatenation (n SDUs => One PDU)
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
LteRlcUmTransmitterConcatenationTestCase()
virtual ~LteRlcUmTransmitterTestCase()
NS_LOG_COMPONENT_DEFINE("LteRlcUmTransmitterTest")
static LteRlcUmTransmitterTestSuite lteRlcUmTransmitterTestSuite
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
LteRlcUmTransmitterSegmentationTestCase()
Test 4.1.1.2 Segmentation (One SDU => n PDUs)
virtual ~LteRlcUmTransmitterOneSduTestCase()
LteRlcUmTransmitterReportBufferStatusTestCase()
void DoCheckDataReceived(std::string shouldReceived, std::string assertMsg)
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.