21 #include "ns3/simulator.h"
24 #include "ns3/lte-rlc-header.h"
25 #include "ns3/lte-rlc-um.h"
27 #include "lte-test-rlc-um-transmitter.h"
28 #include "lte-test-entities.h"
40 :
TestSuite (
"lte-rlc-um-transmitter", SYSTEM)
57 LteRlcUmTransmitterTestCase::LteRlcUmTransmitterTestCase (std::string name)
63 LteRlcUmTransmitterTestCase::~LteRlcUmTransmitterTestCase ()
85 txPdcp = CreateObject<LteTestPdcp> ();
88 txRlc = CreateObject<LteRlcUm> ();
89 txRlc->SetRnti (rnti);
90 txRlc->SetLcId (lcid);
93 txMac = CreateObject<LteTestMac> ();
94 txMac->SetRlcHeaderType (LteTestMac::UM_RLC_HEADER);
97 txPdcp->SetLteRlcSapProvider (txRlc->GetLteRlcSapProvider ());
98 txRlc->SetLteRlcSapUser (txPdcp->GetLteRlcSapUser ());
100 txRlc->SetLteMacSapProvider (txMac->GetLteMacSapProvider ());
101 txMac->SetLteMacSapUser (txRlc->GetLteMacSapUser ());
106 LteRlcUmTransmitterTestCase::CheckDataReceived (
Time time, std::string shouldReceived, std::string assertMsg)
108 Simulator::Schedule (time, &LteRlcUmTransmitterTestCase::DoCheckDataReceived,
this, shouldReceived, assertMsg);
112 LteRlcUmTransmitterTestCase::DoCheckDataReceived (std::string shouldReceived, std::string assertMsg)
114 NS_TEST_ASSERT_MSG_EQ (shouldReceived, txMac->GetDataReceived (), assertMsg);
121 LteRlcUmTransmitterOneSduTestCase::LteRlcUmTransmitterOneSduTestCase (std::string name)
126 LteRlcUmTransmitterOneSduTestCase::~LteRlcUmTransmitterOneSduTestCase ()
141 txPdcp->SendData (
Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
144 txMac->SendTxOpportunity (
Seconds (0.150), 28);
145 CheckDataReceived (
Seconds (0.200),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"SDU is not OK");
154 LteRlcUmTransmitterSegmentationTestCase::LteRlcUmTransmitterSegmentationTestCase (std::string name)
159 LteRlcUmTransmitterSegmentationTestCase::~LteRlcUmTransmitterSegmentationTestCase ()
174 txPdcp->SendData (
Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
177 txMac->SendTxOpportunity (
Seconds (0.150), 10);
178 CheckDataReceived (
Seconds (0.200),
"ABCDEFGH",
"Segment #1 is not OK");
180 txMac->SendTxOpportunity (
Seconds (0.200), 10);
181 CheckDataReceived (
Seconds (0.250),
"IJKLMNOP",
"Segment #2 is not OK");
183 txMac->SendTxOpportunity (
Seconds (0.300), 10);
184 CheckDataReceived (
Seconds (0.350),
"QRSTUVWX",
"Segment #3 is not OK");
186 txMac->SendTxOpportunity (
Seconds (0.400), 4);
187 CheckDataReceived (
Seconds (0.450),
"YZ",
"Segment #4 is not OK");
196 LteRlcUmTransmitterConcatenationTestCase::LteRlcUmTransmitterConcatenationTestCase (std::string name)
201 LteRlcUmTransmitterConcatenationTestCase::~LteRlcUmTransmitterConcatenationTestCase ()
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");
231 LteRlcUmTransmitterReportBufferStatusTestCase::LteRlcUmTransmitterReportBufferStatusTestCase (std::string name)
236 LteRlcUmTransmitterReportBufferStatusTestCase::~LteRlcUmTransmitterReportBufferStatusTestCase ()
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));
256 CheckDataReceived (
Seconds (0.300),
"ABCDEFGHIJKLMNOP",
"SDU is not OK");
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);
263 CheckDataReceived (
Seconds (0.550),
"QRS",
"SDU is not OK");
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);
274 CheckDataReceived (
Seconds (0.950),
"TUVWXYZ",
"SDU is not OK");
276 txMac->SendTxOpportunity (
Seconds (1.000), (2+2) + (8+2));
277 CheckDataReceived (
Seconds (1.050),
"ABCDEFGHIJ",
"SDU is not OK");
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);
284 CheckDataReceived (
Seconds (1.300),
"KL",
"SDU is not OK");
286 txMac->SendTxOpportunity (
Seconds (1.350), 2 + 3);
287 CheckDataReceived (
Seconds (1.400),
"MNO",
"SDU is not OK");
289 txMac->SendTxOpportunity (
Seconds (1.450), 2 + 5);
290 CheckDataReceived (
Seconds (1.500),
"PQRST",
"SDU is not OK");
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");
virtual void DoRun(void)
Implementation to actually run this test case.
virtual void DoRun(void)
Implementation to actually run this test case.
#define NS_LOG_COMPONENT_DEFINE(name)
LteRlcUmTransmitterTestSuite()
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
static void EnablePrinting(void)
static void Destroy(void)
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
virtual void DoRun(void)
Implementation to actually run this test case.
virtual void DoRun(void)
Implementation to actually run this test case.
virtual void DoRun(void)
Implementation to actually run this test case.