devices-point-to-point test suite ported to new framework
authorPavel Boyko <boyko@iitp.ru>
Thu Oct 01 12:00:02 2009 +0400 (4 months ago)
changeset 53277088d8f69a4e
parent 5324 0ba73cdd2a43
child 5328 77172366f83b
devices-point-to-point test suite ported to new framework
src/devices/point-to-point/point-to-point-test.cc
     1.1 --- a/src/devices/point-to-point/point-to-point-test.cc	Wed Sep 30 20:26:33 2009 -0700
     1.2 +++ b/src/devices/point-to-point/point-to-point-test.cc	Thu Oct 01 12:00:02 2009 +0400
     1.3 @@ -1,5 +1,3 @@
     1.4 -#ifdef RUN_SELF_TESTS
     1.5 -
     1.6  #include "ns3/test.h"
     1.7  #include "ns3/drop-tail-queue.h"
     1.8  #include "ns3/simulator.h"
     1.9 @@ -8,19 +6,19 @@
    1.10  
    1.11  namespace ns3 {
    1.12  
    1.13 -class PointToPointTest : public Test
    1.14 +class PointToPointTest : public TestCase
    1.15  {
    1.16  public:
    1.17    PointToPointTest ();
    1.18  
    1.19 -  virtual bool RunTests (void);
    1.20 +  virtual bool DoRun (void);
    1.21  
    1.22  private:
    1.23    void SendOnePacket (Ptr<PointToPointNetDevice> device);
    1.24  };
    1.25  
    1.26  PointToPointTest::PointToPointTest ()
    1.27 -  : Test ("PointToPoint")
    1.28 +  : TestCase ("PointToPoint")
    1.29  {}
    1.30  
    1.31  void
    1.32 @@ -32,10 +30,8 @@
    1.33  
    1.34  
    1.35  bool
    1.36 -PointToPointTest::RunTests (void)
    1.37 +PointToPointTest::DoRun (void)
    1.38  {
    1.39 -  bool result = true;
    1.40 -
    1.41    Ptr<Node> a = CreateObject<Node> ();
    1.42    Ptr<Node> b = CreateObject<Node> ();
    1.43    Ptr<PointToPointNetDevice> devA = CreateObject<PointToPointNetDevice> ();
    1.44 @@ -58,11 +54,21 @@
    1.45  
    1.46    Simulator::Destroy ();
    1.47  
    1.48 -  return result;
    1.49 +  return GetErrorStatus ();
    1.50 +}
    1.51 +//-----------------------------------------------------------------------------
    1.52 +class PointToPointTestSuite : public TestSuite
    1.53 +{
    1.54 +public:
    1.55 +  PointToPointTestSuite ();
    1.56 +};
    1.57 +
    1.58 +PointToPointTestSuite::PointToPointTestSuite ()
    1.59 +  : TestSuite ("devices-point-to-point", UNIT)
    1.60 +{
    1.61 +  AddTestCase (new PointToPointTest);
    1.62  }
    1.63  
    1.64 -static PointToPointTest g_pointToPointTest;
    1.65 +PointToPointTestSuite g_pointToPointTestSuite;
    1.66  
    1.67  } // namespace ns3
    1.68 -
    1.69 -#endif /* RUN_SELF_TESTS */