From 28aea07674ce1cd81f5ad69433ded68549495eab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 9 Dec 2016 17:44:04 +0100 Subject: [PATCH] Fix wxString::From[C]Double() unit test for MSVC 14 and later Since MSVC 14, VC CRT uses standard-conforming 2 digits for the exponent instead of the non-standard 3 used previously. (cherry picked from commit 7122288416d56f2883a2872ed334b3dd6bde802c) --- tests/strings/strings.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp index 78a3a9d1ea..764939a5ec 100644 --- a/tests/strings/strings.cpp +++ b/tests/strings/strings.cpp @@ -832,10 +832,9 @@ void StringTestCase::FromDouble() } testData[] = { { 1.23, -1, "1.23" }, - // NB: there are no standards about the minimum exponent width - // and newer MSVC versions use 3 digits as minimum exponent - // width while GNU libc uses 2 digits as minimum width... -#ifdef wxUSING_VC_CRT_IO + // All MSVC versions until MSVC 14 used 3 digits for the exponent + // unnecessarily, account for this non-standard behaviour. +#if defined(wxUSING_VC_CRT_IO) && !wxCHECK_VISUALC_VERSION(14) { -3e-10, -1, "-3e-010" }, #else { -3e-10, -1, "-3e-10" },