mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 18:13:57 +02:00
Add test for position after some time
This commit is contained in:
parent
4324bb5984
commit
9dddf5ad20
1 changed files with 26 additions and 0 deletions
|
@ -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<LeoCircularOrbitMobilityModel> 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<LeoCircularOrbitMobilityModel> mob = CreateObject<LeoCircularOrbitMobilityModel> ();
|
||||||
|
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
|
class LeoOrbitTestSuite : TestSuite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LeoOrbitTestSuite() : TestSuite ("leo-orbit", UNIT) {
|
LeoOrbitTestSuite() : TestSuite ("leo-orbit", UNIT) {
|
||||||
AddTestCase (new LeoOrbitSpeedTestCase, TestCase::QUICK);
|
AddTestCase (new LeoOrbitSpeedTestCase, TestCase::QUICK);
|
||||||
AddTestCase (new LeoOrbitPositionTestCase, TestCase::QUICK);
|
AddTestCase (new LeoOrbitPositionTestCase, TestCase::QUICK);
|
||||||
|
AddTestCase (new LeoOrbitProgressTestCase, TestCase::QUICK);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue