aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-18 13:22:17 +0000
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-18 14:16:29 +0000
commitfc0e40f413808dd1a7b5631e5f087c3970db2869 (patch)
treed7b5dec0f821c14e5dd4edcfe62fd802dc4377f7 /tests/auto/qml/qqmlproperty
parent0d8a4a1bbcbd7fa27766eb1e86d758f2c1759909 (diff)
Re-apply "Tighten expected output for floating point conversions"
This re-applies commit e613de803c85191d3fbbef5a8b0f5e8b5ed8c76f. It was disabled while qtbase in qt5 was missing the corresponding change. Change-Id: Idd2e9811c41f8a09e00bfd3a9601028704514d3f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index ba7c85df15..27e06c6f67 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -2064,15 +2064,14 @@ void tst_qqmlproperty::floatToStringPrecision_data()
QTest::addColumn<QString>("propertyName");
QTest::addColumn<double>("number");
QTest::addColumn<QString>("qtString");
- QTest::addColumn<QString>("alternateQtString");
QTest::addColumn<QString>("jsString");
- QTest::newRow("3.4") << "a" << 3.4 << "3.4" << "3.4" << "3.4";
- QTest::newRow("0.035003945") << "b" << 0.035003945 << "0.035003945" << "0.0035003945" << "0.035003945";
- QTest::newRow("0.0000012345") << "c" << 0.0000012345 << "1.2345e-6" << "1.2345e-06" << "0.0000012345";
- QTest::newRow("0.00000012345") << "d" << 0.00000012345 << "1.2345e-7" << "1.2345e-07" << "1.2345e-7";
- QTest::newRow("1e20") << "e" << 1e20 << "1e+20" << "1e+20" << "100000000000000000000";
- QTest::newRow("1e21") << "f" << 1e21 << "1e+21" << "1e+21" << "1e+21";
+ QTest::newRow("3.4") << "a" << 3.4 << "3.4" << "3.4";
+ QTest::newRow("0.035003945") << "b" << 0.035003945 << "0.035003945" << "0.035003945";
+ QTest::newRow("0.0000012345") << "c" << 0.0000012345 << "1.2345e-06" << "0.0000012345";
+ QTest::newRow("0.00000012345") << "d" << 0.00000012345 << "1.2345e-07" << "1.2345e-7";
+ QTest::newRow("1e20") << "e" << 1e20 << "1e+20" << "100000000000000000000";
+ QTest::newRow("1e21") << "f" << 1e21 << "1e+21" << "1e+21";
}
void tst_qqmlproperty::floatToStringPrecision()
@@ -2084,24 +2083,15 @@ void tst_qqmlproperty::floatToStringPrecision()
QFETCH(QString, propertyName);
QFETCH(double, number);
QFETCH(QString, qtString);
- QFETCH(QString, alternateQtString);
QFETCH(QString, jsString);
QByteArray name = propertyName.toLatin1();
QCOMPARE(obj->property(name).toDouble(), number);
- if (obj->property(name).toString() != qtString) {
- QCOMPARE(obj->property(name).toString(), alternateQtString);
- } else {
- QCOMPARE(obj->property(name).toString(), qtString);
- }
+ QCOMPARE(obj->property(name).toString(), qtString);
QByteArray name1 = (propertyName + QLatin1Char('1')).toLatin1();
QCOMPARE(obj->property(name1).toDouble(), number);
- if (obj->property(name1).toString() != qtString) {
- QCOMPARE(obj->property(name1).toString(), alternateQtString);
- } else {
- QCOMPARE(obj->property(name1).toString(), qtString);
- }
+ QCOMPARE(obj->property(name1).toString(), qtString);
QByteArray name2 = (propertyName + QLatin1Char('2')).toLatin1();
QCOMPARE(obj->property(name2).toDouble(), number);