diff options
author | Dominik Holland <dominik.holland@nokia.com> | 2010-07-26 13:45:54 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-02 14:28:33 (GMT) |
commit | efc4e9c3602d569a8437db52c09edd7fb6a6dc34 (patch) | |
tree | 2281c89e48116dce9b4032ff719dc73fc731542d /tests/auto/qxmlquery | |
parent | 65bad8e2c8894f23f47ff2b7418bcd1fc71d4602 (diff) | |
download | Qt-efc4e9c3602d569a8437db52c09edd7fb6a6dc34.zip Qt-efc4e9c3602d569a8437db52c09edd7fb6a6dc34.tar.gz Qt-efc4e9c3602d569a8437db52c09edd7fb6a6dc34.tar.bz2 |
Fixed QXmlQuery autotest to pass when qreal != double
Diffstat (limited to 'tests/auto/qxmlquery')
-rw-r--r-- | tests/auto/qxmlquery/tst_qxmlquery.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 2187aeb..e6c40b8 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -1197,9 +1197,15 @@ void tst_QXmlQuery::basicXQueryToQtTypeCheck() const expectedValues.append(QVariant()); /* xs:dayTimeDuration */ expectedValues.append(QVariant()); /* xs:yearMonthDuration */ - expectedValues.append(QVariant(double(3e3))); /* xs:float */ - expectedValues.append(QVariant(double(4e4))); /* xs:double */ - expectedValues.append(QVariant(double(2))); /* xs:decimal */ + if(sizeof(qreal) == sizeof(float)) {//ARM casts to Float not to double + expectedValues.append(QVariant(float(3e3))); /* xs:float */ + expectedValues.append(QVariant(float(4e4))); /* xs:double */ + expectedValues.append(QVariant(float(2))); /* xs:decimal */ + } else { + expectedValues.append(QVariant(double(3e3))); /* xs:float */ + expectedValues.append(QVariant(double(4e4))); /* xs:double */ + expectedValues.append(QVariant(double(2))); /* xs:decimal */ + } /* xs:integer and its sub-types. */ expectedValues.append(QVariant(qlonglong(16))); @@ -1347,10 +1353,17 @@ void tst_QXmlQuery::basicQtToXQueryTypeCheck() const QVERIFY(!item.isNull()); QVERIFY(item.isAtomicValue()); - QCOMPARE(item.toAtomicValue().toString(), - QLatin1String("4 true 3 654 7 41414141 C 2000-10-11Z 2001-09-10T01:02:03 " - "A QString http://example.com/ 5 6 true true true true true true true true true true " - "true true true")); + if(sizeof(qreal) == sizeof(float)) //ARM casts to Float not to double + QCOMPARE(item.toAtomicValue().toString(), + QLatin1String("4 true 3 654 7 41414141 C 2000-10-11Z 2001-09-10T01:02:03 " + "A QString http://example.com/ 5 6 true false false true true true true true true true " + "true true true")); + else + QCOMPARE(item.toAtomicValue().toString(), + QLatin1String("4 true 3 654 7 41414141 C 2000-10-11Z 2001-09-10T01:02:03 " + "A QString http://example.com/ 5 6 true true true true true true true true true true " + "true true true")); + } void tst_QXmlQuery::bindNode() const |