# HG changeset patch # User Chris Cannam # Date 1548846054 0 # Node ID 08a389e9658207b0ae4eac061b8d5e576ace59ad # Parent a090221caedad07a15a3b196f8417618b1cc29f3# Parent 40d8b01efbc6b021f5bbc23377449b03576832dd Merge diff -r 40d8b01efbc6 -r 08a389e96582 base/test/svcore-base-test.cpp --- a/base/test/svcore-base-test.cpp Thu Jan 24 15:09:00 2019 +0000 +++ b/base/test/svcore-base-test.cpp Wed Jan 30 11:00:54 2019 +0000 @@ -21,6 +21,8 @@ #include "TestColumnOp.h" #include "TestMovingMedian.h" +#include "system/Init.h" + #include #include @@ -29,6 +31,10 @@ { int good = 0, bad = 0; + // This is necessary to ensure correct behaviour of snprintf with + // older MinGW implementations + svSystemSpecificInitialisation(); + QCoreApplication app(argc, argv); app.setOrganizationName("sonic-visualiser"); app.setApplicationName("test-svcore-base"); diff -r 40d8b01efbc6 -r 08a389e96582 data/fileio/test/svcore-data-fileio-test.cpp --- a/data/fileio/test/svcore-data-fileio-test.cpp Thu Jan 24 15:09:00 2019 +0000 +++ b/data/fileio/test/svcore-data-fileio-test.cpp Wed Jan 30 11:00:54 2019 +0000 @@ -19,6 +19,8 @@ #include "CSVFormatTest.h" #include "CSVStreamWriterTest.h" +#include "system/Init.h" + #include #include @@ -27,6 +29,8 @@ { int good = 0, bad = 0; + svSystemSpecificInitialisation(); + QString testDir; #ifdef Q_OS_WIN diff -r 40d8b01efbc6 -r 08a389e96582 data/model/test/svcore-data-model-test.cpp --- a/data/model/test/svcore-data-model-test.cpp Thu Jan 24 15:09:00 2019 +0000 +++ b/data/model/test/svcore-data-model-test.cpp Wed Jan 30 11:00:54 2019 +0000 @@ -15,6 +15,8 @@ #include "TestZoomConstraints.h" #include "TestWaveformOversampler.h" +#include "system/Init.h" + #include #include @@ -25,6 +27,8 @@ { int good = 0, bad = 0; + svSystemSpecificInitialisation(); + QCoreApplication app(argc, argv); app.setOrganizationName("sonic-visualiser"); app.setApplicationName("test-model"); diff -r 40d8b01efbc6 -r 08a389e96582 system/Init.cpp --- a/system/Init.cpp Thu Jan 24 15:09:00 2019 +0000 +++ b/system/Init.cpp Wed Jan 30 11:00:54 2019 +0000 @@ -63,9 +63,11 @@ // Remove the CWD from the DLL search path, just in case SetDllDirectory(L""); putenv("PATH="); + + // Some older versions of MinGW require this in order to get + // C99/POSIX-standard behaviour for (s)printf formatting + putenv("PRINTF_EXPONENT_DIGITS=2"); #else #endif } - -