subsurface/tests/testgpscoords.h
Patrick Valsecchi ce79b9ffa4 Add support for more GPS coordinate formats.
As requested in the user forum and in the mailing list, now support:
 - 46.473881 6.784696  (format used in XML files)
 - 48 51.491n 2 17.677e

I was not able to handle the XML format in a generic way without making
the code too ugly. So I've added an exception.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23 05:37:34 -08:00

32 lines
804 B
C++

#ifndef TESTGPSCOORDS_H
#define TESTGPSCOORDS_H
#include <QtTest>
class TestGpsCoords : public QObject {
Q_OBJECT
private slots:
void testISO6709DParse();
void testNegativeISO6709DParse();
void testSpaceISO6709DParse();
void testSecondsParse();
void testSpaceSecondsParse();
void testNegativeSecondsParse();
void testMinutesParse();
void testSpaceMinutesParse();
void testMinutesInversedParse();
void testDecimalParse();
void testSpaceDecimalParse();
void testDecimalInversedParse();
void testXmlFormatParse();
void testNoUnitParse();
void testNegativeXmlFormatParse();
void testPrefixNoUnitParse();
private:
static void testParseOK(const QString &txt, double expectedLat,
double expectedLon);
static double coord2double(double deg, double min = 0.0, double sec = 0.0);
};
#endif