mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 14:40:28 +00:00
bd9a443793
Refactored the parsing logic to make it more solid (no more guessing) and more flexible (support more formats). Added a test for checking that. Fixed a few warnings. [Dirk Hohndel: some changes to coding style] Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
28 lines
684 B
C++
28 lines
684 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();
|
|
|
|
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
|