samples/main-test.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 06 Oct 2006 13:37:25 +0200
changeset 122 6b8f1eda5c57
parent 111 ad64f88919b5
child 131 f4fb87e77034
permissions -rw-r--r--
fix coding style

/* -*-    Mode:C++; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */

#include "ns3/test.h"

using namespace ns3;

#ifdef RUN_SELF_TESTS

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

// implement MyTest
MyTest::MyTest (bool ok)
    : Test ("My"),
      m_ok (ok)
{}
MyTest::~MyTest ()
{}
bool
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;
}