Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1141)

Unified Diff: src/obstacle/test/obstacle-test-suite.cc

Issue 201200043: initial add of obstacle module
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/obstacle/model/topology.cc ('k') | src/obstacle/wscript » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/obstacle/test/obstacle-test-suite.cc
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/obstacle/test/obstacle-test-suite.cc
@@ -0,0 +1,68 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+
+// Include a header file from your module to test.
+#include "ns3/obstacle.h"
+
+// An essential include is test.h
+#include "ns3/test.h"
+
+// Do not put your test classes in namespace ns3. You may find it useful
+// to use the using directive to access the ns3 namespace directly
+using namespace ns3;
+
+// This is an example TestCase.
+class ObstacleTestCase1 : public TestCase
+{
+public:
+ ObstacleTestCase1 ();
+ virtual ~ObstacleTestCase1 ();
+
+private:
+ virtual void DoRun (void);
+};
+
+// Add some help text to this case to describe what it is intended to test
+ObstacleTestCase1::ObstacleTestCase1 ()
+ : TestCase ("Obstacle test case (does nothing)")
+{
+}
+
+// This destructor does nothing but we include it as a reminder that
+// the test case should clean up after itself
+ObstacleTestCase1::~ObstacleTestCase1 ()
+{
+}
+
+//
+// This method is the pure virtual method from class TestCase that every
+// TestCase must implement
+//
+void
+ObstacleTestCase1::DoRun (void)
+{
+ // A wide variety of test macros are available in src/core/test.h
+ NS_TEST_ASSERT_MSG_EQ (true, true, "true doesn't equal true for some reason");
+ // Use this one for floating point comparisons
+ NS_TEST_ASSERT_MSG_EQ_TOL (0.01, 0.01, 0.001, "Numbers are not equal within tolerance");
+}
+
+// The TestSuite class names the TestSuite, identifies what type of TestSuite,
+// and enables the TestCases to be run. Typically, only the constructor for
+// this class must be defined
+//
+class ObstacleTestSuite : public TestSuite
+{
+public:
+ ObstacleTestSuite ();
+};
+
+ObstacleTestSuite::ObstacleTestSuite ()
+ : TestSuite ("obstacle", UNIT)
+{
+ // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
+ AddTestCase (new ObstacleTestCase1, TestCase::QUICK);
+}
+
+// Do not forget to allocate an instance of this TestSuite
+static ObstacleTestSuite obstacleTestSuite;
+
« no previous file with comments | « src/obstacle/model/topology.cc ('k') | src/obstacle/wscript » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b