summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-09-23 03:45:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-09-23 03:45:42 (GMT)
commit00dbc026d3b7f079920c9eeb8f2773d6c5d83fa3 (patch)
tree51b9b07001183ff5b0fe62617a79d25a795f00a9
parent1289b9468b5895279c82703c1dd6dea080c8a0ca (diff)
downloadQt-00dbc026d3b7f079920c9eeb8f2773d6c5d83fa3.zip
Qt-00dbc026d3b7f079920c9eeb8f2773d6c5d83fa3.tar.gz
Qt-00dbc026d3b7f079920c9eeb8f2773d6c5d83fa3.tar.bz2
Failing autotest for Repeater bug
-rw-r--r--tests/auto/declarative/repeater/data/repeater.qml6
-rw-r--r--tests/auto/declarative/repeater/repeater.pro1
-rw-r--r--tests/auto/declarative/repeater/tst_repeater.cpp30
3 files changed, 32 insertions, 5 deletions
diff --git a/tests/auto/declarative/repeater/data/repeater.qml b/tests/auto/declarative/repeater/data/repeater.qml
index 57ba9dc..7d83230 100644
--- a/tests/auto/declarative/repeater/data/repeater.qml
+++ b/tests/auto/declarative/repeater/data/repeater.qml
@@ -6,6 +6,9 @@ Rectangle {
width: 240
height: 320
color: "white"
+ Text {
+ text: "Zero"
+ }
Repeater {
id: repeater
objectName: "repeater"
@@ -19,4 +22,7 @@ Rectangle {
}
}
}
+ Text {
+ text: "Last"
+ }
}
diff --git a/tests/auto/declarative/repeater/repeater.pro b/tests/auto/declarative/repeater/repeater.pro
index 0ecd7ee..1d30b7b 100644
--- a/tests/auto/declarative/repeater/repeater.pro
+++ b/tests/auto/declarative/repeater/repeater.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_repeater.cpp
+macx:CONFIG -= app_bundle
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp
index 5fce70e..1bb746b 100644
--- a/tests/auto/declarative/repeater/tst_repeater.cpp
+++ b/tests/auto/declarative/repeater/tst_repeater.cpp
@@ -24,6 +24,11 @@ tst_QFxRepeater::tst_QFxRepeater()
{
}
+/*
+The Repeater element creates children at its own position in its parent's
+stacking order. In this test we insert a repeater between two other Text
+elements to test this.
+*/
void tst_QFxRepeater::stringList()
{
QmlView *canvas = createView(SRCDIR "/data/repeater.qml");
@@ -46,12 +51,27 @@ void tst_QFxRepeater::stringList()
QFxItem *container = findItem<QFxItem>(canvas->root(), "container");
QVERIFY(container != 0);
- QCOMPARE(container->childItems().count(), data.count() + 1);
+ QCOMPARE(container->childItems().count(), data.count() + 3);
+
+ for (int i = 0; i < container->childItems().count(); ++i) {
+
+ if (i == 0) {
+ QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), QLatin1String("Zero"));
+ } else if (i == 1) {
+ // The repeater itself
+ continue;
+ } else if (i == container->childItems().count() - 1) {
+ QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), QLatin1String("Last"));
+ } else {
+ QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), data.at(i-2));
+ }
- for (int i = 1; i < container->childItems().count(); ++i) {
- QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i));
- QVERIFY(name != 0);
- QCOMPARE(name->text(), data.at(i-1));
}
delete canvas;