adjust ns3tcp-cwnd-test-suite response vector
authorTom Henderson <tomh@tomh.org>
Thu, 11 Sep 2014 20:08:17 -0700
changeset 10930 392714d264cb
parent 10929 26baa6fb3a88
child 10931 e7b7af914245
adjust ns3tcp-cwnd-test-suite response vector
src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc
--- a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc	Thu Sep 11 17:43:37 2014 -0700
+++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc	Thu Sep 11 20:08:17 2014 -0700
@@ -516,7 +516,7 @@
   
   
   const uint32_t MSS = 536;
-  const uint32_t N_EVENTS = 41;
+  const uint32_t N_EVENTS = 37;
 
   CwndEvent event;
 
@@ -531,24 +531,23 @@
 
   VerifyCwndRun (11, 13, 9 * MSS, MSS);
   
-  //Partial ack will end up modifying cwnd 2X due to how code is written
-  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (15).m_newCwnd, 9 * MSS, "Wrong new cwnd value in cwnd change event " << 15);
+  // partial ack, cwnd reset to 9
+  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (14).m_newCwnd, 9 * MSS, "Wrong new cwnd value in cwnd change event " << 14);
+
+  // partial ack, cwnd reset to 8 
+  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (16).m_newCwnd, 8 * MSS, "Wrong new cwnd value in cwnd change event " << 16);
 
   //DUP ACKS in fast recovery
-  VerifyCwndRun (16, 17, 10 * MSS, MSS);
+  VerifyCwndRun (17, 18, 9 * MSS, MSS);
 
-  //Partial ack will end up modifying cwnd 2X due to how code is written, therefore eat 18 and 19
-  VerifyCwndRun (19, 20, 9 * MSS, MSS);
+  VerifyCwndRun (19, 22, 8 * MSS, MSS);
   
-  
-  VerifyCwndRun(22, 25, 8 * MSS, MSS);
- 
   //Leaving fast recovery
-  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (26).m_newCwnd, 5 * MSS, "Wrong new cwnd value in cwnd change event " << 26);  
+  NS_TEST_ASSERT_MSG_EQ (m_responses.Get (23).m_newCwnd, 5 * MSS, "Wrong new cwnd value in cwnd change event " << 23);  
   
   uint32_t cwnd = 5 * MSS;
   //In CongAvoid each event will increase cwnd by (MSS * MSS / cwnd)
-  for (uint32_t i = 27; i < N_EVENTS; ++i)
+  for (uint32_t i = 24; i < N_EVENTS; ++i)
     {
       double adder = static_cast<double> (MSS * MSS) / cwnd;
       adder = std::max (1.0, adder);
@@ -558,7 +557,7 @@
     
   for (uint32_t i = 0; i < N_EVENTS; ++i)
   {
-    std::cout << "i: " << m_responses.Get(i).m_newCwnd << "  " << m_responses.Get(i).m_oldCwnd << std::endl;
+    std::cout << "i: " << i << " newCwnd: " << m_responses.Get(i).m_newCwnd << " newCwnd segments " << static_cast<double> (m_responses.Get(i).m_newCwnd)/MSS << std::endl;
   }
 }