diff --git a/test/leo-orbit-test-suite.cc b/test/leo-orbit-test-suite.cc index e640aca..404dc93 100644 --- a/test/leo-orbit-test-suite.cc +++ b/test/leo-orbit-test-suite.cc @@ -39,12 +39,38 @@ private: } }; +class LeoOrbitProgressTestCase : public TestCase +{ +public: + LeoOrbitProgressTestCase () : TestCase ("Test position for 0 altitude and 0 inclination after 60 seconds") {} + virtual ~LeoOrbitProgressTestCase () {} +private: + void TestLengthPosition (double expected, Ptr mob) + { + Vector pos = mob->GetPosition (); + NS_TEST_EXPECT_MSG_EQ_TOL_INTERNAL (pos.GetLength (), expected, 0.001, "Position not equal", __FILE__, __LINE__); + } + + virtual void DoRun (void) + { + Ptr mob = CreateObject (); + mob->SetAttribute ("Altitude", DoubleValue (0.0)); + mob->SetAttribute ("Inclination", DoubleValue (1.0)); + + Simulator::Schedule (Seconds (360.0), &LeoOrbitProgressTestCase::TestLengthPosition, this, LEO_EARTH_RAD_M, mob); + Simulator::Run (); + Simulator::Destroy (); + } +}; +// TODO offset + class LeoOrbitTestSuite : TestSuite { public: LeoOrbitTestSuite() : TestSuite ("leo-orbit", UNIT) { AddTestCase (new LeoOrbitSpeedTestCase, TestCase::QUICK); AddTestCase (new LeoOrbitPositionTestCase, TestCase::QUICK); + AddTestCase (new LeoOrbitProgressTestCase, TestCase::QUICK); } };