18using namespace swift::misc::geo;
19using namespace swift::misc::physical_quantities;
20using namespace swift::misc::math;
34 void coordinateGeodetic();
37 void CTestGeo::geoBasics()
40 QVERIFY2(lat * 2 == lat + lat,
"Latitude addition should be equal");
42 QVERIFY2(lat.valueRounded() == 30.0,
"Latitude should be 30 degrees");
47 QVERIFY2(v == 20.0,
"Values shall be the same");
52 QVERIFY2(v == 28.0,
"Values shall be the same");
57 QVERIFY2(v == 30.0,
"Values shall be the same");
60 void CTestGeo::coordinateGeodetic()
63 CCoordinateGeodetic southPole = { -90.0, 0.0 };
64 QCOMPARE(calculateEuclideanDistance(northPole, southPole), 2.0);
65 CCoordinateGeodetic equator = { 0.0, 70.354683 };
66 QCOMPARE(calculateEuclideanDistance(northPole, equator), std::sqrt(2.0f));
68 CCoordinateGeodetic testCoordinate = northPole;
71 QVERIFY2(latValue == 90.0,
"Latitude value supposed to be 90");
72 QVERIFY2(lngValue == 0.0,
"Longitude value supposed to be 0");
static CAngleUnit deg()
Degrees.
void setLatitude(const CLatitude &latitude)
Set latitude.
CLatitude latitude() const
Latitude.
CLongitude longitude() const
Longitude.
Physical unit angle (radians, degrees).
double value(MU unit) const
Value in given unit.
QCOMPARE(actual, expected)
QVERIFY2(condition, message)
#define SWIFTTEST_APPLESS_MAIN(TestObject)
Implements a main() function that executes all tests in TestObject without instantiating a QApplicati...