summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-01-06 06:57:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-01-06 06:57:06 (GMT)
commit05b9137fe1974aa123ce6d9c16b733e1f77d8269 (patch)
tree6965ebdba00a655ee879bc969986cd24753c6823 /tests/auto
parent1ba3e41f09ea719249286fede5d3fe96621ccb61 (diff)
downloadQt-05b9137fe1974aa123ce6d9c16b733e1f77d8269.zip
Qt-05b9137fe1974aa123ce6d9c16b733e1f77d8269.tar.gz
Qt-05b9137fe1974aa123ce6d9c16b733e1f77d8269.tar.bz2
PathView crashed when the path is provided with undefined values.
Task-number: QTBUG-16356 Reviewed-by: Bea Lam
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml17
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp14
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
new file mode 100644
index 0000000..5a647cb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathView
+ width: 240; height: 200
+ path: Path {
+ startX: pathView.undef/2.0; startY: 0
+ PathLine { x: pathView.undef/2.0; y: 0 }
+ }
+
+ delegate: Text { text: value }
+ model: ListModel {
+ ListElement { value: "one" }
+ ListElement { value: "two" }
+ ListElement { value: "three" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 90b1056..bd8baab 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -88,6 +88,7 @@ private slots:
void closed();
void pathUpdate();
void visualDataModel();
+ void undefinedPath();
private:
QDeclarativeView *createView();
@@ -853,6 +854,19 @@ void tst_QDeclarativePathView::visualDataModel()
delete obj;
}
+void tst_QDeclarativePathView::undefinedPath()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/undefinedpath.qml"));
+
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->count(), 3);
+
+ delete obj;
+}
+
QDeclarativeView *tst_QDeclarativePathView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);