fixed regression in lte-epc-e2e-data test
authorNicola Baldo <nbaldo@cttc.es>
Thu, 29 Nov 2012 12:44:23 +0100
changeset 9440 eb053bae286c
parent 9439 5107601b7a75
child 9441 e18fa929e485
child 9443 33e358d8d64d
fixed regression in lte-epc-e2e-data test
src/lte/test/test-lte-epc-e2e-data.cc
--- a/src/lte/test/test-lte-epc-e2e-data.cc	Thu Nov 29 12:00:06 2012 +0100
+++ b/src/lte/test/test-lte-epc-e2e-data.cc	Thu Nov 29 12:44:23 2012 +0100
@@ -100,6 +100,7 @@
   : TestCase (name),
     m_enbTestData (v)
 {
+  NS_LOG_FUNCTION (this << name);
 }
 
 LteEpcE2eDataTestCase::~LteEpcE2eDataTestCase ()
@@ -109,6 +110,7 @@
 void 
 LteEpcE2eDataTestCase::DoRun ()
 {
+  NS_LOG_FUNCTION (this << GetName ());
   Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
   Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
@@ -279,7 +281,7 @@
   Simulator::Stop (simulationTime);  
   Simulator::Run ();
 
-  static uint64_t imsiCounter = 0;
+  uint64_t imsiCounter = 0;
 
   for (std::vector<EnbTestData>::iterator enbit = m_enbTestData.begin ();
        enbit < m_enbTestData.end ();
@@ -295,24 +297,35 @@
               // LCID 0, 1, 2 are for SRBs
               // LCID 3 is (at the moment) the Default EPS bearer, and is unused in this test program
               uint8_t lcid = b+4;
-              NS_TEST_ASSERT_MSG_EQ (lteHelper->GetPdcpStats ()->GetDlTxPackets (imsi, lcid), 
-                                     ueit->bearers.at (b).numPkts, 
+              uint32_t expectedPkts = ueit->bearers.at (b).numPkts;
+              uint32_t expectedBytes = (ueit->bearers.at (b).numPkts) * (ueit->bearers.at (b).pktSize);
+              uint32_t txPktsPdcpDl = lteHelper->GetPdcpStats ()->GetDlTxPackets (imsi, lcid);
+              uint32_t rxPktsPdcpDl = lteHelper->GetPdcpStats ()->GetDlRxPackets (imsi, lcid);
+              uint32_t txPktsPdcpUl = lteHelper->GetPdcpStats ()->GetUlTxPackets (imsi, lcid);
+              uint32_t rxPktsPdcpUl = lteHelper->GetPdcpStats ()->GetUlRxPackets (imsi, lcid);
+              uint32_t rxBytesDl = ueit->bearers.at (b).dlServerApp->GetTotalRx ();
+              uint32_t rxBytesUl = ueit->bearers.at (b).ulServerApp->GetTotalRx ();
+              
+              
+              NS_TEST_ASSERT_MSG_EQ (txPktsPdcpDl, 
+                                     expectedPkts, 
                                      "wrong TX PDCP packets in downlink for IMSI=" << imsi << " LCID=" << (uint16_t) lcid);
-              NS_TEST_ASSERT_MSG_EQ (lteHelper->GetPdcpStats ()->GetDlRxPackets (imsi, lcid), 
-                                     ueit->bearers.at (b).numPkts, 
+              
+              NS_TEST_ASSERT_MSG_EQ (rxPktsPdcpDl, 
+                                     expectedPkts, 
                                      "wrong RX PDCP packets in downlink for IMSI=" << imsi << " LCID=" << (uint16_t) lcid);
-              NS_TEST_ASSERT_MSG_EQ (lteHelper->GetPdcpStats ()->GetUlTxPackets (imsi, lcid), 
-                                     ueit->bearers.at (b).numPkts, 
+              NS_TEST_ASSERT_MSG_EQ (txPktsPdcpUl, 
+                                     expectedPkts, 
                                      "wrong TX PDCP packets in uplink for IMSI=" << imsi << " LCID=" << (uint16_t) lcid);
-              NS_TEST_ASSERT_MSG_EQ (lteHelper->GetPdcpStats ()->GetUlRxPackets (imsi, lcid), 
-                                     ueit->bearers.at (b).numPkts, 
+              NS_TEST_ASSERT_MSG_EQ (rxPktsPdcpUl, 
+                                     expectedPkts, 
                                      "wrong RX PDCP packets in uplink for IMSI=" << imsi << " LCID=" << (uint16_t) lcid);        
 
-              NS_TEST_ASSERT_MSG_EQ (ueit->bearers.at (b).dlServerApp->GetTotalRx (), 
-                                     (ueit->bearers.at (b).numPkts) * (ueit->bearers.at (b).pktSize), 
+              NS_TEST_ASSERT_MSG_EQ (rxBytesDl, 
+                                     expectedBytes, 
                                      "wrong total received bytes in downlink");
-              NS_TEST_ASSERT_MSG_EQ (ueit->bearers.at (b).ulServerApp->GetTotalRx (), 
-                                     (ueit->bearers.at (b).numPkts) * (ueit->bearers.at (b).pktSize), 
+              NS_TEST_ASSERT_MSG_EQ (rxBytesUl, 
+                                     expectedBytes, 
                                      "wrong total received bytes in uplink");
             }
         }