CCoordinateGeodetic::calculateEuclideanDistance unit tests

This commit is contained in:
Roland Winklmeier
2016-12-17 21:29:20 +01:00
committed by Mathew Sutcliffe
parent 58c816197e
commit 4b93d0e2d8
2 changed files with 13 additions and 0 deletions

View File

@@ -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

View File

@@ -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