aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquicklistmodel
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-06-22 09:23:26 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-22 06:54:59 +0200
commit55faad4873a9409bb1b33a10da7329d13a95aff9 (patch)
treeb08f5b801079e49ddc9d6a5839eeb14a1e238a0f /tests/auto/qml/qquicklistmodel
parent033bf75d99c281d4a133fada297b7b141a0af555 (diff)
Handle enum values of -1 correctly.
This was already handled correctly most places; now the remaining cases (using an enum in ListModel, and assigning an enum to an integer property) should also work correctly. Task-number: QTBUG-21679 Change-Id: Ibff13f0b94da94b18e2e3bae4aa6ba44e0fa944b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qquicklistmodel')
-rw-r--r--tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp b/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp
index 4c4aa4801f..89e88869e3 100644
--- a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp
+++ b/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp
@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquicktext_p.h>
+#include <QtQuick/private/qquickanimation_p.h>
#include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qquicklistmodel_p.h>
#include <QtQml/private/qqmlexpression_p.h>
@@ -228,6 +229,11 @@ void tst_qquicklistmodel::static_types_data()
<< QVariant(double(Qt::AlignBottom))
<< QString();
+ QTest::newRow("negative enum")
+ << "ListElement { foo: Animation.Infinite }"
+ << QVariant(double(QQuickAbstractAnimation::Infinite))
+ << QString();
+
QTest::newRow("role error")
<< "ListElement { foo: 1 } ListElement { foo: 'string' }"
<< QVariant()