adjust ns3tcp-cwnd-test-suite response vector

This commit is contained in:
Tom Henderson
2014-09-11 20:08:17 -07:00
parent 3a872a1d8c
commit 884ad61823

View File

@@ -516,7 +516,7 @@ Ns3TcpCwndTestCase2::DoRun (void)
const uint32_t MSS = 536;
const uint32_t N_EVENTS = 41;
const uint32_t N_EVENTS = 37;
CwndEvent event;
@@ -531,24 +531,23 @@ Ns3TcpCwndTestCase2::DoRun (void)
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 @@ Ns3TcpCwndTestCase2::DoRun (void)
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;
}
}