From 64368bb527f41a63dff17fbacdefb6ee95e81f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 28 Jul 2021 11:50:27 +0200 Subject: [PATCH] Add a few more cases to the QString::number(double) test Formatting using scientific notation with extra precision wasn't tested Change-Id: I7a89a0f3d6468515604e43e52fc366dedf3c39ea Reviewed-by: Thiago Macieira --- tests/auto/corelib/text/qstring/tst_qstring.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index a00a032f94..563d24b606 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -5224,6 +5224,10 @@ void tst_QString::number_double_data() { 0.0001, 'e', 1, QLatin1String("1.0e-04") }, { 1e8, 'e', 1, QLatin1String("1.0e+08") }, { -1e8, 'e', 1, QLatin1String("-1.0e+08") }, + { 1.1e-8, 'e', 6, QLatin1String("1.100000e-08") }, + { -1.1e-8, 'e', 6, QLatin1String("-1.100000e-08") }, + { 1.1e+8, 'e', 6, QLatin1String("1.100000e+08") }, + { -1.1e+8, 'e', 6, QLatin1String("-1.100000e+08") }, { 100000, 'f', 0, QLatin1String("100000") }, // Increasingly small fraction, test how/when 'g' switches to scientific notation: { 0.001, 'g', 6, QLatin1String("0.001") },