33 * Define the class-tests group:
34 * \verbatim /// \ingroup module-tests
37 * Make sure test.h is included:
38 * \verbatim #include "ns3/test.h" \endverbatim
40 * Put the test code in namespace ns3::tests.
41 * \verbatim namespace ns3 {
42 namespace tests { \endverbatim
44 * Write your test cases and final test suite, and put them in
46 * \verbatim /// \ingroup class-tests
47class ClassTestSuite : public TestSuite {...}; \endverbatim
49 * Create a static variable to hold the instance of your test suite:
50 * \verbatim /// \ingroup class-tests
52static ClassTestSuite g_classTestSuite; \endverbatim
54 * Finally, close the ingroup and namespace blocks:
55 * \verbatim } // namespace tests
56} // namespace ns3 \endverbatim
83 void DoRun()
override;
88 :
TestCase(
"Sample test case (does nothing)")
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
This is an example TestCase.
SampleTestCase1()
Constructor.
~SampleTestCase1() override
Destructor.
void DoRun() override
This method is the pure virtual method from class TestCase that every TestCase must implement.
The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the TestCases...
SampleTestSuite()
Constructor.
static SampleTestSuite g_sampleTestSuite
SampleTestSuite instance variable.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Every class exported by the ns3 library is enclosed in the ns3 namespace.