diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-10-04 06:44:32 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-10-04 06:48:29 (GMT) |
commit | f25391e52af3eef68abfa3941fc48da0c52bb010 (patch) | |
tree | 0b8f02830dc0b81b144867c33253823ecc60ca2f /tests/auto/declarative/qdeclarativepathview | |
parent | da45259dbfa05c4f3b6c8c0472a65851692060e4 (diff) | |
download | Qt-f25391e52af3eef68abfa3941fc48da0c52bb010.zip Qt-f25391e52af3eef68abfa3941fc48da0c52bb010.tar.gz Qt-f25391e52af3eef68abfa3941fc48da0c52bb010.tar.bz2 |
Improve test coverage for declarative module.
Add additional autotests, and remove unreachable functions.
Diffstat (limited to 'tests/auto/declarative/qdeclarativepathview')
3 files changed, 55 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml new file mode 100644 index 0000000..08b0d2a --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathQuad { + y: 120 + x: 80 + controlY: 330 + controlX: 100 + } + PathLine { + y: 160 + x: 20 + } + PathCubic { + y: 120 + x: 160 + control1Y: 0 + control1X: 100 + control2Y: 000 + control2X: 200 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml new file mode 100644 index 0000000..328e3cd --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathLine { + y: 160 + x: 20 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 3b5d438..65007a6 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -85,6 +85,7 @@ private slots: void pathUpdateOnStartChanged(); void package(); void emptyModel(); + void closed(); private: QDeclarativeView *createView(); @@ -786,6 +787,26 @@ void tst_QDeclarativePathView::emptyModel() delete canvas; } +void tst_QDeclarativePathView::closed() +{ + QDeclarativeEngine engine; + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/openPath.qml")); + QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), false); + delete obj; + } + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/closedPath.qml")); + QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), true); + delete obj; + } +} QDeclarativeView *tst_QDeclarativePathView::createView() { |