diff --git a/.appveyor.yml b/.appveyor.yml index b5df77ce..c61e47fb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -66,6 +66,8 @@ after_build: test_script: - cd %APPVEYOR_BUILD_FOLDER%-build - if not %CONFIGURATION%==debug %make% check TESTARGS=-silent + - if %QTDIR:msvc=%==%QTDIR% ( set "BIPOLAR_TEST_LOCALE=german" ) else set "BIPOLAR_TEST_LOCALE=de-DE" + - if not %CONFIGURATION%==debug %make% check TESTARGS=-silent artifacts: - path: Bipolar.exe diff --git a/.travis.yml b/.travis.yml index 09a779cb..76b8e232 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,6 +60,7 @@ before_script: script: - make -C "$TRAVIS_BUILD_DIR-build" -j2 all - make -C "$TRAVIS_BUILD_DIR-build" -j2 check + - BIPOLAR_TEST_LOCALE=de_DE.UTF-8 make -C "$TRAVIS_BUILD_DIR-build" -j2 check - '[ "$TRAVIS_OS_NAME" != osx ] || make -C "$TRAVIS_BUILD_DIR-build/pkg/osx" dmg' deploy: diff --git a/src/polar/v2/trainingsession.cpp b/src/polar/v2/trainingsession.cpp index e9638649..6f6b1b4b 100644 --- a/src/polar/v2/trainingsession.cpp +++ b/src/polar/v2/trainingsession.cpp @@ -1474,8 +1474,8 @@ QDomDocument TrainingSession::toGPX(const QDateTime &creationTime) const } QDomElement trkpt = doc.createElement(QLatin1String("trkpt")); - trkpt.setAttribute(QLatin1String("lat"), latitude.at(index).toDouble()); - trkpt.setAttribute(QLatin1String("lon"), longitude.at(index).toDouble()); + trkpt.setAttribute(QLatin1String("lat"), VARIANT_TO_STRING(latitude.at(index))); + trkpt.setAttribute(QLatin1String("lon"), VARIANT_TO_STRING(longitude.at(index))); trkpt.appendChild(doc.createElement(QLatin1String("ele"))) .appendChild(doc.createTextNode(VARIANT_TO_STRING(altitude.at(index)))); trkpt.appendChild(doc.createElement(QLatin1String("time"))) diff --git a/test/test.cpp b/test/test.cpp index f97fbacb..440d5947 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -24,6 +24,7 @@ #include +#include #include typedef QObject * (*ObjectConstructor)(); @@ -53,6 +54,19 @@ int main(int argc, char *argv[]) { app.setApplicationVersion(QLatin1String("1.2.3.4")); app.setAttribute(Qt::AA_Use96Dpi, true); + // If the BIPOLAR_TEST_LOCALE environment variable is set, then set this + // test application's locale accordingly. The same can be done other ways, + // but its near impossible to acheive externally on AppVeyor, and at least + // here we get to bail if the setlocale call fails. + const QByteArray locale = qgetenv("BIPOLAR_TEST_LOCALE"); + if (!locale.isEmpty()) { + if (setlocale(LC_ALL, locale.data()) == NULL) { + fprintf(stderr, "failed to set locale '%s'\n", locale.data()); + return EXIT_FAILURE; + } + fprintf(stdout, "set locale '%s'\n", locale.data()); + } + // Setup our tests factory object. ObjectFactory testFactory; testFactory.registerClass();