ns3::Test Class Reference

base class for new regressions tests More...

#include <test.h>

List of all members.

Public Member Functions

 Test (char const *name)
virtual bool RunTests (void)=0

Protected Member Functions

std::ostream & Failure (void)

Detailed Description

base class for new regressions tests

To add a new regression test, you need to:

The following sample code shows you how to do this:

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

#include "ns3/test.h"

using namespace ns3;


// declare subclass of base class Test
class MyTest : public Test {
  MyTest (bool ok);
  virtual ~MyTest ();
  virtual bool RunTests (void);
  bool m_ok;

// implement MyTest
MyTest::MyTest (bool ok)
  : Test ("My"),
    m_ok (ok)
MyTest::~MyTest ()
MyTest::RunTests (void)
  return m_ok;

// instantiate MyTest once
static MyTest g_my_test = MyTest (true);

#endif /* RUN_SELF_TESTS */

int main (int argc, char *argv[])
  // run tests
  TestManager::EnableVerbose ();
  TestManager::RunTests ();
  return 0;

Constructor & Destructor Documentation

ns3::Test::Test ( char const *  name  ) 

name the name of the test

Member Function Documentation

std::ostream& ns3::Test::Failure ( void   )  [protected]

an output stream which base classes can write to to return extra information on test errors.

virtual bool ns3::Test::RunTests ( void   )  [pure virtual]

true if the test was successful, false otherwise.

The documentation for this class was generated from the following file:

Generated on Fri Apr 9 15:01:09 2010 for NS-3 by  doxygen 1.5.8