From 06c72254f1d48d78324510c98612b94b612ca00b Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 29 Sep 2009 15:49:37 +0200 Subject: [PATCH 1/2] I know why we need to return false uncondtionally --- src/simulator/time.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/simulator/time.cc b/src/simulator/time.cc index 35e8f07b7..65d0a9027 100644 --- a/src/simulator/time.cc +++ b/src/simulator/time.cc @@ -446,7 +446,6 @@ OldTimeTestCase::DoRun (void) ASSERT_EQ((t1 / t2).GetDouble (), t1.GetSeconds()/t2.GetSeconds()); - // XXX return false; } @@ -501,7 +500,6 @@ OperationsTimeTestCase::DoRun(void) ASSERT_EQ((t0 * t1 / ((t0-t1) * t0)).GetDouble (), (t0.GetSeconds () * t1.GetSeconds () / ((t0.GetSeconds () - t1.GetSeconds()) * t0.GetSeconds ()))); - // XXX return false; } @@ -526,7 +524,6 @@ TimeStepTestCase::DoRun (void) NS_TEST_ASSERT_MSG_EQ (tooBig.IsPositive (), true, "Is not negative ?"); tooBig += TimeStep (1); NS_TEST_ASSERT_MSG_EQ (tooBig.IsNegative (), true, "Is not negative ?"); - // XXX return false; } @@ -553,7 +550,6 @@ GlobalPrecisionTestCase::DoRun (void) CHECK_PRECISION(NS); CHECK_PRECISION(PS); CHECK_PRECISION(FS); - // XXX return false; } From ae88f3d16f15095b88395b3d86b4791b502beca6 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 29 Sep 2009 16:04:27 +0200 Subject: [PATCH 2/2] bug 675: convert unit tests to new test framework --- src/simulator/high-precision-128.cc | 120 ++++++++++++++-------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/src/simulator/high-precision-128.cc b/src/simulator/high-precision-128.cc index 67c544305..7fc3e3888 100644 --- a/src/simulator/high-precision-128.cc +++ b/src/simulator/high-precision-128.cc @@ -260,46 +260,31 @@ HighPrecision::SlowCompare (HighPrecision const &o) const } } -}; // namespace ns3 +} // namespace ns3 - -#ifdef RUN_SELF_TESTS #include "ns3/test.h" -namespace ns3 { - -class HighPrecision128Tests : public Test -{ -public: - HighPrecision128Tests (); - virtual ~HighPrecision128Tests (); - virtual bool RunTests (void); -}; - -HighPrecision128Tests::HighPrecision128Tests () - : Test ("Int128") -{} -HighPrecision128Tests::~HighPrecision128Tests () -{} - -#define CHECK_EXPECTED(v,expected) \ - { \ - if (v.GetInteger () != expected) \ - { \ - Failure () << "file="<<__FILE__<<", line="<<__LINE__<< \ - ", expected: "<