mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
CCoordinateGeodetic::calculateEuclideanDistance unit tests
This commit is contained in:
committed by
Mathew Sutcliffe
parent
58c816197e
commit
4b93d0e2d8
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "testgeo.h"
|
#include "testgeo.h"
|
||||||
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
#include "blackmisc/geo/earthangle.h"
|
#include "blackmisc/geo/earthangle.h"
|
||||||
#include "blackmisc/geo/latitude.h"
|
#include "blackmisc/geo/latitude.h"
|
||||||
#include "blackmisc/pq/physicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
@@ -39,6 +40,15 @@ namespace BlackMiscTest
|
|||||||
QVERIFY2(lati.valueRounded() == 30.0, "Latitude should be 30 degrees");
|
QVERIFY2(lati.valueRounded() == 30.0, "Latitude should be 30 degrees");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTestGeo::coordinateGeodetic()
|
||||||
|
{
|
||||||
|
CCoordinateGeodetic northPole = { 90.0, 0.0 };
|
||||||
|
CCoordinateGeodetic southPole = { -90.0, 0.0 };
|
||||||
|
QCOMPARE(calculateEuclideanDistance(northPole, southPole), 2.0);
|
||||||
|
CCoordinateGeodetic equator = { 0.0, 70.354683 };
|
||||||
|
QCOMPARE(calculateEuclideanDistance(northPole, equator), std::sqrt(2.0f));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ namespace BlackMiscTest
|
|||||||
private slots:
|
private slots:
|
||||||
//! Basic unit tests for geo classes
|
//! Basic unit tests for geo classes
|
||||||
void geoBasics();
|
void geoBasics();
|
||||||
|
|
||||||
|
//! CCoordinateGeodetic unit tests
|
||||||
|
void coordinateGeodetic();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user