diff options
author | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2020-08-18 18:41:32 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-20 14:58:35 +0200 |
commit | c1f8a72a43c7487e4ee6952c67269573664d2463 (patch) | |
tree | f384ac41174715e68e7ff7427f024a4b45ef9e9b /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | |
parent | 2879ab208f07d2fa01ea5c8b5de1ab8c182cb2da (diff) |
tst_qqmllanguage: Fix failure due to stricter equality of QVariant
add explicit conversion to QDate to handle strict comparison
Change-Id: I5e2ce46e13dc2b1580fc463f88d2cd8401371235
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 88f9a39ab8..b67ee148f4 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -1473,7 +1473,10 @@ void tst_qqmllanguage::dynamicProperties() QCOMPARE(object->property("stringProperty"), QVariant("Hello World!")); QCOMPARE(object->property("urlProperty"), QVariant(QUrl("main.qml"))); QCOMPARE(object->property("colorProperty"), QVariant(QColor("red"))); - QCOMPARE(object->property("dateProperty"), QVariant(QDate(1945, 9, 2))); + QVariant date = object->property("dateProperty"); + if (!date.convert(QMetaType::QDate)) + QFAIL("could not convert to date"); + QCOMPARE(date, QVariant(QDate(1945, 9, 2))); QCOMPARE(object->property("varProperty"), QVariant("Hello World!")); } |