Change test data from 6.7 to 6.5
6.5 is an exact binary number (4 + 2 + 0.5), so all conversions to string will result in "6.5", regardless of how many digits of precision are used. This is done in advance of changing QVariant to add more digits of precision, which would cause toString() of 6.7 to result in "6.7000000000000002". Change-Id: I19ea4c5bb02b99f0655c0b9bc9dc09f06ec654e5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
parent
54ec039a97
commit
205336ebc8
|
@ -40,7 +40,7 @@ QtObject {
|
|||
property int d: 176
|
||||
property string e: "Hello"
|
||||
property string f: "World"
|
||||
property variant g: 6.7
|
||||
property variant g: 6.5
|
||||
property variant h: "!"
|
||||
property variant i: true
|
||||
property string j: "#112233"
|
||||
|
|
|
@ -3540,8 +3540,8 @@ void tst_qqmlecmascript::compiled()
|
|||
QCOMPARE(object->property("test17").toInt(), 4);
|
||||
QCOMPARE(object->property("test18").toReal(), qreal(176));
|
||||
QCOMPARE(object->property("test19").toInt(), 6);
|
||||
QCOMPARE(object->property("test20").toReal(), qreal(6.7));
|
||||
QCOMPARE(object->property("test21").toString(), QLatin1String("6.7"));
|
||||
QCOMPARE(object->property("test20").toReal(), qreal(6.5));
|
||||
QCOMPARE(object->property("test21").toString(), QLatin1String("6.5"));
|
||||
QCOMPARE(object->property("test22").toString(), QLatin1String("!"));
|
||||
QCOMPARE(object->property("test23").toBool(), true);
|
||||
QCOMPARE(qvariant_cast<QColor>(object->property("test24")), QColor(0x11,0x22,0x33));
|
||||
|
|
Loading…
Reference in New Issue