2006-11-01 13:11:30 +01:00
|
|
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
2006-09-06 13:35:23 +02:00
|
|
|
|
|
|
|
|
#include "ns3/test.h"
|
|
|
|
|
|
|
|
|
|
using namespace ns3;
|
|
|
|
|
|
2006-09-06 14:06:04 +02:00
|
|
|
#ifdef RUN_SELF_TESTS
|
2006-09-06 13:35:23 +02:00
|
|
|
|
2006-09-06 14:03:39 +02:00
|
|
|
// declare subclass of base class Test
|
2006-09-06 13:35:23 +02:00
|
|
|
class MyTest : public Test {
|
|
|
|
|
public:
|
2006-11-01 13:11:30 +01:00
|
|
|
MyTest (bool ok);
|
|
|
|
|
virtual ~MyTest ();
|
|
|
|
|
virtual bool RunTests (void);
|
2006-09-06 13:35:23 +02:00
|
|
|
private:
|
2006-11-01 13:11:30 +01:00
|
|
|
bool m_ok;
|
2006-09-06 13:35:23 +02:00
|
|
|
};
|
|
|
|
|
|
2006-09-06 14:03:39 +02:00
|
|
|
// implement MyTest
|
2006-09-06 13:35:23 +02:00
|
|
|
MyTest::MyTest (bool ok)
|
2006-11-01 13:11:30 +01:00
|
|
|
: Test ("My"),
|
|
|
|
|
m_ok (ok)
|
2006-09-06 13:35:23 +02:00
|
|
|
{}
|
|
|
|
|
MyTest::~MyTest ()
|
|
|
|
|
{}
|
|
|
|
|
bool
|
2006-10-06 13:37:25 +02:00
|
|
|
MyTest::RunTests (void)
|
2006-09-06 13:35:23 +02:00
|
|
|
{
|
2006-11-01 13:11:30 +01:00
|
|
|
return m_ok;
|
2006-09-06 13:35:23 +02:00
|
|
|
}
|
|
|
|
|
|
2006-09-06 14:03:39 +02:00
|
|
|
// instantiate MyTest once
|
2006-09-06 14:06:04 +02:00
|
|
|
static MyTest g_my_test = MyTest (true);
|
2006-09-06 13:35:23 +02:00
|
|
|
|
|
|
|
|
#endif /* RUN_SELF_TESTS */
|
|
|
|
|
|
|
|
|
|
int main (int argc, char *argv[])
|
|
|
|
|
{
|
2006-11-01 13:11:30 +01:00
|
|
|
// run tests
|
|
|
|
|
TestManager::EnableVerbose ();
|
|
|
|
|
TestManager::RunTests ();
|
|
|
|
|
return 0;
|
2006-09-06 13:35:23 +02:00
|
|
|
}
|