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 postion
This commit is contained in:
parent
0a9aa411ef
commit
4324bb5984
2 changed files with 19 additions and 2 deletions
|
@ -13,7 +13,6 @@ class LeoOrbitSpeedTestCase : public TestCase
|
|||
public:
|
||||
LeoOrbitSpeedTestCase () : TestCase ("Test speed for 0 altitude") {}
|
||||
virtual ~LeoOrbitSpeedTestCase () {}
|
||||
|
||||
private:
|
||||
virtual void DoRun (void)
|
||||
{
|
||||
|
@ -24,11 +23,28 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
class LeoOrbitPositionTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
LeoOrbitPositionTestCase () : TestCase ("Test position for 0 altitude and 0 inclination") {}
|
||||
virtual ~LeoOrbitPositionTestCase () {}
|
||||
private:
|
||||
virtual void DoRun (void)
|
||||
{
|
||||
Ptr<LeoCircularOrbitMobilityModel> mob = CreateObject<LeoCircularOrbitMobilityModel> ();
|
||||
mob->SetAttribute ("Altitude", DoubleValue (0.0));
|
||||
mob->SetAttribute ("Inclination", DoubleValue (1.0));
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ (mob->GetPosition ().GetLength(), LEO_EARTH_RAD_M, "Unexpected position on earths surface for 1 deg inclination");
|
||||
}
|
||||
};
|
||||
|
||||
class LeoOrbitTestSuite : TestSuite
|
||||
{
|
||||
public:
|
||||
LeoOrbitTestSuite() : TestSuite ("leo-orbit", UNIT) {
|
||||
AddTestCase (new LeoOrbitSpeedTestCase, TestCase::QUICK);
|
||||
AddTestCase (new LeoOrbitPositionTestCase, TestCase::QUICK);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue