LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 University of Washington | 3 * Copyright (c) 2010 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 void | 296 void |
297 Ns3TcpStateTestCase::DoRun (void) | 297 Ns3TcpStateTestCase::DoRun (void) |
298 { | 298 { |
299 // Network topology | 299 // Network topology |
300 // | 300 // |
301 // 10Mb/s, 0.1ms 10Mb/s, 0.1ms | 301 // 10Mb/s, 0.1ms 10Mb/s, 0.1ms |
302 // n0-----------------n1-----------------n2 | 302 // n0-----------------n1-----------------n2 |
303 | 303 |
304 std::string tcpModel ("ns3::TcpNewReno"); | 304 std::string tcpModel ("ns3::TcpNewReno"); |
305 | 305 |
| 306 Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (false)); |
306 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", StringValue (tcpModel)); | 307 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", StringValue (tcpModel)); |
307 Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000)); | 308 Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000)); |
308 Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1)); | 309 Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1)); |
309 Config::SetDefault ("ns3::Queue::MaxPackets", UintegerValue (20)); | 310 Config::SetDefault ("ns3::Queue::MaxPackets", UintegerValue (20)); |
310 Config::SetDefault ("ns3::TcpSocketBase::Timestamp", BooleanValue (false)); | 311 Config::SetDefault ("ns3::TcpSocketBase::Timestamp", BooleanValue (false)); |
311 | 312 |
312 if (m_writeLogging) | 313 if (m_writeLogging) |
313 { | 314 { |
314 LogComponentEnableAll (LOG_PREFIX_FUNC); | 315 LogComponentEnableAll (LOG_PREFIX_FUNC); |
315 LogComponentEnable ("ErrorModel", LOG_LEVEL_DEBUG); | 316 LogComponentEnable ("ErrorModel", LOG_LEVEL_DEBUG); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 464 |
464 std::clog << std::endl << "Running TCP test-case " << m_testCase << ": " | 465 std::clog << std::endl << "Running TCP test-case " << m_testCase << ": " |
465 << caseDescription << std::endl; | 466 << caseDescription << std::endl; |
466 } | 467 } |
467 | 468 |
468 // Finally, set up the simulator to run. The 1000 second hard limit is a | 469 // Finally, set up the simulator to run. The 1000 second hard limit is a |
469 // failsafe in case some change above causes the simulation to never end | 470 // failsafe in case some change above causes the simulation to never end |
470 Simulator::Stop (Seconds (1000)); | 471 Simulator::Stop (Seconds (1000)); |
471 Simulator::Run (); | 472 Simulator::Run (); |
472 Simulator::Destroy (); | 473 Simulator::Destroy (); |
473 | |
474 | |
475 } | 474 } |
476 | 475 |
477 class Ns3TcpStateTestSuite : public TestSuite | 476 class Ns3TcpStateTestSuite : public TestSuite |
478 { | 477 { |
479 public: | 478 public: |
480 Ns3TcpStateTestSuite (); | 479 Ns3TcpStateTestSuite (); |
481 }; | 480 }; |
482 | 481 |
483 Ns3TcpStateTestSuite::Ns3TcpStateTestSuite () | 482 Ns3TcpStateTestSuite::Ns3TcpStateTestSuite () |
484 : TestSuite ("ns3-tcp-state", SYSTEM) | 483 : TestSuite ("ns3-tcp-state", SYSTEM) |
485 { | 484 { |
486 // We can't use NS_TEST_SOURCEDIR variable here because we use subdirectories | 485 // We can't use NS_TEST_SOURCEDIR variable here because we use subdirectories |
487 SetDataDir ("src/test/ns3tcp/response-vectors"); | 486 SetDataDir ("src/test/ns3tcp/response-vectors"); |
488 Packet::EnablePrinting (); // Enable packet metadata for all test cases | 487 Packet::EnablePrinting (); // Enable packet metadata for all test cases |
489 | 488 |
490 AddTestCase (new Ns3TcpStateTestCase (0), TestCase::QUICK); | 489 AddTestCase (new Ns3TcpStateTestCase (0), TestCase::QUICK); |
491 AddTestCase (new Ns3TcpStateTestCase (1), TestCase::QUICK); | 490 AddTestCase (new Ns3TcpStateTestCase (1), TestCase::QUICK); |
492 AddTestCase (new Ns3TcpStateTestCase (2), TestCase::QUICK); | 491 AddTestCase (new Ns3TcpStateTestCase (2), TestCase::QUICK); |
493 AddTestCase (new Ns3TcpStateTestCase (3), TestCase::QUICK); | 492 AddTestCase (new Ns3TcpStateTestCase (3), TestCase::QUICK); |
494 AddTestCase (new Ns3TcpStateTestCase (4), TestCase::QUICK); | 493 AddTestCase (new Ns3TcpStateTestCase (4), TestCase::QUICK); |
495 AddTestCase (new Ns3TcpStateTestCase (5), TestCase::QUICK); | 494 AddTestCase (new Ns3TcpStateTestCase (5), TestCase::QUICK); |
496 AddTestCase (new Ns3TcpStateTestCase (6), TestCase::QUICK); | 495 AddTestCase (new Ns3TcpStateTestCase (6), TestCase::QUICK); |
497 AddTestCase (new Ns3TcpStateTestCase (7), TestCase::QUICK); | 496 AddTestCase (new Ns3TcpStateTestCase (7), TestCase::QUICK); |
498 AddTestCase (new Ns3TcpStateTestCase (8), TestCase::QUICK); | 497 AddTestCase (new Ns3TcpStateTestCase (8), TestCase::QUICK); |
499 } | 498 } |
500 | 499 |
501 static Ns3TcpStateTestSuite ns3TcpLossTestSuite; | 500 static Ns3TcpStateTestSuite ns3TcpLossTestSuite; |
LEFT | RIGHT |