# HG changeset patch # User Chris Cannam # Date 1548846045 0 # Node ID a090221caedad07a15a3b196f8417618b1cc29f3 # Parent ce185d4dd408323d9232b423c4991493a2d72518 Fix incorrect number formatting results for 32-bit MinGW build diff -r ce185d4dd408 -r a090221caeda base/test/svcore-base-test.cpp --- a/base/test/svcore-base-test.cpp Wed Jan 23 14:43:43 2019 +0000 +++ b/base/test/svcore-base-test.cpp Wed Jan 30 11:00:45 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 ce185d4dd408 -r a090221caeda data/fileio/test/svcore-data-fileio-test.cpp --- a/data/fileio/test/svcore-data-fileio-test.cpp Wed Jan 23 14:43:43 2019 +0000 +++ b/data/fileio/test/svcore-data-fileio-test.cpp Wed Jan 30 11:00:45 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 ce185d4dd408 -r a090221caeda data/model/test/svcore-data-model-test.cpp --- a/data/model/test/svcore-data-model-test.cpp Wed Jan 23 14:43:43 2019 +0000 +++ b/data/model/test/svcore-data-model-test.cpp Wed Jan 30 11:00:45 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 ce185d4dd408 -r a090221caeda system/Init.cpp --- a/system/Init.cpp Wed Jan 23 14:43:43 2019 +0000 +++ b/system/Init.cpp Wed Jan 30 11:00:45 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 } - -