diff --git a/tests/blackmisc/testgeo.cpp b/tests/blackmisc/testgeo.cpp index 3ba0f57a5..7ee4e64e7 100644 --- a/tests/blackmisc/testgeo.cpp +++ b/tests/blackmisc/testgeo.cpp @@ -15,6 +15,7 @@ */ #include "testgeo.h" +#include "blackmisc/geo/coordinategeodetic.h" #include "blackmisc/geo/earthangle.h" #include "blackmisc/geo/latitude.h" #include "blackmisc/pq/physicalquantity.h" @@ -39,6 +40,15 @@ namespace BlackMiscTest 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 //! \endcond diff --git a/tests/blackmisc/testgeo.h b/tests/blackmisc/testgeo.h index a821dde45..8b945bd0f 100644 --- a/tests/blackmisc/testgeo.h +++ b/tests/blackmisc/testgeo.h @@ -34,6 +34,9 @@ namespace BlackMiscTest private slots: //! Basic unit tests for geo classes void geoBasics(); + + //! CCoordinateGeodetic unit tests + void coordinateGeodetic(); }; } // namespace