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 <thiago.macieira@intel.com>
bb10
Mårten Nordheim 2021-07-28 11:50:27 +02:00
parent 5f5c342924
commit 64368bb527
1 changed files with 4 additions and 0 deletions

View File

@ -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") },