From d006cf014f56561e91313643947485f332e459a3 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 16 Aug 2013 08:28:39 -0700 Subject: [PATCH] align command-line test suite to recent changes --- CHANGES.html | 21 ++++++++++++--------- src/core/test/command-line-test-suite.cc | 7 ++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGES.html b/CHANGES.html index 2d7a0cfcb..b2bb8efe5 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -133,15 +133,18 @@ or
   cmd.PrintHelp (std::cerr);
 
- -
  • IPv4's ARP Request and IPv6's NS/RS are now transmitted with a random delay. - The delay is, by default, a uniform random variable in time between 0 and 10ms. - This is aimed at preventing reception errors due to collisions during wifi broadcasts. - This behaviour can be modified by using ArpL3Protocol's - RequestJitter and Icmpv6L4Protocol's SolicitationJitter - attributes or by using the new InternetStackHelper functions. -
  • - + +
  • IPv4's ARP Request and IPv6's NS/RS are now transmitted with a random delay. + The delay is, by default, a uniform random variable in time between 0 and 10ms. + This is aimed at preventing reception errors due to collisions during wifi broadcasts. + This behaviour can be modified by using ArpL3Protocol's + RequestJitter and Icmpv6L4Protocol's SolicitationJitter + attributes or by using the new InternetStackHelper functions. +
  • +
  • Command line boolean arguments specified with no integer value (e.g. + "--boolArg") will toggle the value from the default, instead of + always setting the value to true. +

  • diff --git a/src/core/test/command-line-test-suite.cc b/src/core/test/command-line-test-suite.cc index 971eaf4d9..678c2ba11 100644 --- a/src/core/test/command-line-test-suite.cc +++ b/src/core/test/command-line-test-suite.cc @@ -102,8 +102,10 @@ CommandLineBooleanTestCase::DoRun (void) { CommandLine cmd; bool myBool = true; + bool myDefaultFalseBool = false; cmd.AddValue ("my-bool", "help", myBool); + cmd.AddValue ("my-false-bool", "help", myDefaultFalseBool); Parse (cmd, 1, "--my-bool=0"); NS_TEST_ASSERT_MSG_EQ (myBool, false, "Command parser did not correctly set a boolean value to false"); @@ -112,7 +114,10 @@ CommandLineBooleanTestCase::DoRun (void) NS_TEST_ASSERT_MSG_EQ (myBool, true, "Command parser did not correctly set a boolean value to true, given integer argument"); Parse (cmd, 1, "--my-bool"); - NS_TEST_ASSERT_MSG_EQ (myBool, true, "Command parser did not correctly set a boolean value to true, given no argument"); + NS_TEST_ASSERT_MSG_EQ (myBool, false, "Command parser did not correctly toggle a default true boolean value to false, given no argument"); + + Parse (cmd, 1, "--my-false-bool"); + NS_TEST_ASSERT_MSG_EQ (myDefaultFalseBool, true, "Command parser did not correctly toggle a default false boolean value to true, given no argument"); Parse (cmd, 1, "--my-bool=t"); NS_TEST_ASSERT_MSG_EQ (myBool, true, "Command parser did not correctly set a boolean value to true, given 't' argument");