View | Details | Raw Unified | Return to bug 699
Collapse All | Expand All

(-)a/src/core/test.cc (-14 / +5 lines)
 Lines 149-158    Link Here 
149
149
150
  DoReportStart ();
150
  DoReportStart ();
151
  DoSetup ();
151
  DoSetup ();
152
152
  DoRun ();
153
  bool result = DoRun ();
154
  UpdateErrorStatus (result);
155
156
  DoTeardown ();
153
  DoTeardown ();
157
154
158
  if (GetErrorStatus () == false)
155
  if (GetErrorStatus () == false)
 Lines 454-465    Link Here 
454
TestSuite::Run (void)
451
TestSuite::Run (void)
455
{
452
{
456
  DoReportStart ();
453
  DoReportStart ();
457
458
  DoSetup (); 
454
  DoSetup (); 
459
455
  DoRun ();
460
  bool result = DoRun ();
461
  UpdateErrorStatus (result);
462
463
  DoTeardown ();
456
  DoTeardown ();
464
457
465
  if (GetErrorStatus () == false)
458
  if (GetErrorStatus () == false)
 Lines 663-669    Link Here 
663
{
656
{
664
}
657
}
665
658
666
bool
659
void
667
TestSuite::DoRun (void)
660
TestSuite::DoRun (void)
668
{
661
{
669
  SetErrorStatus (false);
662
  SetErrorStatus (false);
 Lines 682-700    Link Here 
682
      //
675
      //
683
      // Run the test case
676
      // Run the test case
684
      //
677
      //
685
      bool result = (*i)->Run ();
678
      (*i)->Run ();
686
      UpdateErrorStatus (result);
687
679
688
      //
680
      //
689
      // Exit if we have detected an error and we are not allowing multiple filures
681
      // Exit if we have detected an error and we are not allowing multiple filures
690
      //
682
      //
691
      if (GetErrorStatus () && m_continueOnFailure == false)
683
      if (GetErrorStatus () && m_continueOnFailure == false)
692
        {
684
        {
693
          return GetErrorStatus ();
685
          return;
694
        }
686
        }
695
    }
687
    }
696
688
697
  return GetErrorStatus ();
698
}
689
}
699
690
700
void 
691
void 
(-)a/src/core/test.h (-4 / +2 lines)
 Lines 830-838    Link Here 
830
   * \internal
830
   * \internal
831
   * \brief Implementation to actually run this test case.
831
   * \brief Implementation to actually run this test case.
832
   * \param verbose Turn on any output the test case may provide
832
   * \param verbose Turn on any output the test case may provide
833
   * \returns Boolean sense of "an error has occurred."
834
   */
833
   */
835
  virtual bool DoRun (void) = 0;
834
  virtual void DoRun (void) = 0;
836
835
837
  /**
836
  /**
838
   * \internal
837
   * \internal
 Lines 1076-1084    Link Here 
1076
   * \internal
1075
   * \internal
1077
   * \brief Implementation to actually run this test suite.
1076
   * \brief Implementation to actually run this test suite.
1078
   * \param verbose Turn on any output the test case may provide
1077
   * \param verbose Turn on any output the test case may provide
1079
   * \returns Boolean sense of "an error has occurred."
1080
   */
1078
   */
1081
  virtual bool DoRun (void);
1079
  virtual void DoRun (void);
1082
1080
1083
  /**
1081
  /**
1084
   * \internal
1082
   * \internal
(-)a/src/test/sample-test-suite.cc (-4 / +2 lines)
 Lines 15-21    Link Here 
15
  virtual ~SampleTestCase1 ();
15
  virtual ~SampleTestCase1 ();
16
16
17
private:
17
private:
18
  virtual bool DoRun (void);
18
  virtual void DoRun (void);
19
};
19
};
20
20
21
// Add some help text to this case to describe what it is intended to test
21
// Add some help text to this case to describe what it is intended to test
 Lines 34-40    Link Here 
34
// This method is the pure virtual method from class TestCase that every
34
// This method is the pure virtual method from class TestCase that every
35
// TestCase must implement
35
// TestCase must implement
36
//
36
//
37
bool
37
void
38
SampleTestCase1::DoRun (void)
38
SampleTestCase1::DoRun (void)
39
{
39
{
40
  // A wide variety of test macros are available in src/core/test.h
40
  // A wide variety of test macros are available in src/core/test.h
 Lines 42-49    Link Here 
42
  // Use this one for floating point comparisons
42
  // Use this one for floating point comparisons
43
  NS_TEST_ASSERT_MSG_EQ_TOL (0.01, 0.01, 0.001, "Numbers are not equal within tolerance");
43
  NS_TEST_ASSERT_MSG_EQ_TOL (0.01, 0.01, 0.001, "Numbers are not equal within tolerance");
44
44
45
  // Return false if an error has _not_ occurred
46
  return false;
47
}
45
}
48
46
49
// The TestSuite class names the TestSuite, identifies what type of TestSuite,
47
// The TestSuite class names the TestSuite, identifies what type of TestSuite,

Return to bug 699