summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2013-03-13 15:10:08 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-28 16:41:14 (GMT)
commitafd6ea5c3b7658be3ca42e120d492c3451d83754 (patch)
tree52095b5b5f53a5b4c8453288942ce8fd6dd830b7 /tests
parent7f1197a689deae502129148be94b63c246962b8f (diff)
downloadQt-afd6ea5c3b7658be3ca42e120d492c3451d83754.zip
Qt-afd6ea5c3b7658be3ca42e120d492c3451d83754.tar.gz
Qt-afd6ea5c3b7658be3ca42e120d492c3451d83754.tar.bz2
Fixed some declarative auto tests
This is a backport from qt5/qtquick1 (commit aad8f0b) Change-Id: Ia3eacce5ccd50827526203a9992ddef81a9f0c41 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp94
3 files changed, 49 insertions, 49 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index c4d1af5..8b24b90 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -327,7 +327,7 @@ void tst_qdeclarativeimage::mirror()
p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
break;
case QDeclarativeImage::PreserveAspectFit:
- p_e.drawPixmap(QRect(25, 0, width / (width/height), height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
+ p_e.drawPixmap(QRect(25, 0, height, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
break;
case QDeclarativeImage::PreserveAspectCrop:
{
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 0b2c25e..9799f26 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -988,7 +988,7 @@ void tst_qdeclarativelistmodel::property_changes()
expr.setExpression(script_change);
expr.evaluate();
- QVERIFY2(!expr.hasError(), QTest::toString(expr.error()));
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
// test the object returned by get() emits the correct signals
QCOMPARE(connectionsObject->property("gotSignal").toBool(), itemsChanged);
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 03d1977..b8a7ae4 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -402,34 +402,34 @@ void tst_QDeclarativePathView::insertModel_data()
// We have 8 items, with currentIndex == 4
QTest::newRow("insert after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << 5. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << qreal(5.) << 4;
QTest::newRow("insert before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << 4. << 5;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << qreal(4.) << 5;
QTest::newRow("insert multiple after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << 6. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << qreal(6.) << 4;
QTest::newRow("insert multiple before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << 4. << 6;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << qreal(4.) << 6;
QTest::newRow("insert at end")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 8 << 1 << 5. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 8 << 1 << qreal(5.) << 4;
QTest::newRow("insert at beginning")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 4. << 5;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << qreal(4.) << 5;
QTest::newRow("insert at current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << 4. << 5;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << qreal(4.) << 5;
QTest::newRow("no range - insert after current")
- << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << 5. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << qreal(5.) << 4;
QTest::newRow("no range - insert before current")
- << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << 4. << 5;
+ << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << qreal(4.) << 5;
QTest::newRow("no range - insert multiple after current")
- << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << 6. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << qreal(6.) << 4;
QTest::newRow("no range - insert multiple before current")
- << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << 4. << 6;
+ << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << qreal(4.) << 6;
QTest::newRow("no range - insert at end")
- << int(QDeclarativePathView::NoHighlightRange) << 8 << 1 << 5. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 8 << 1 << qreal(5.) << 4;
QTest::newRow("no range - insert at beginning")
- << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 4. << 5;
+ << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << qreal(4.) << 5;
QTest::newRow("no range - insert at current")
- << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << 4. << 5;
+ << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << qreal(4.) << 5;
}
void tst_QDeclarativePathView::insertModel()
@@ -537,38 +537,38 @@ void tst_QDeclarativePathView::removeModel_data()
// We have 8 items, with currentIndex == 4
QTest::newRow("remove after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << 3. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << qreal(3.) << 4;
QTest::newRow("remove before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << 4. << 3;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << qreal(4.) << 3;
QTest::newRow("remove multiple after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << 2. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << qreal(2.) << 4;
QTest::newRow("remove multiple before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << 4. << 2;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << qreal(4.) << 2;
QTest::newRow("remove last")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 1 << 3. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 1 << qreal(3.) << 4;
QTest::newRow("remove first")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 4. << 3;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << qreal(4.) << 3;
QTest::newRow("remove current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << 3. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << qreal(3.) << 4;
QTest::newRow("remove all")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 8 << 0. << 0;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 8 << qreal(0.) << 0;
QTest::newRow("no range - remove after current")
- << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << 3. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << qreal(3.) << 4;
QTest::newRow("no range - remove before current")
- << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << 4. << 3;
+ << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << qreal(4.) << 3;
QTest::newRow("no range - remove multiple after current")
- << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << 2. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << qreal(2.) << 4;
QTest::newRow("no range - remove multiple before current")
- << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << 4. << 2;
+ << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << qreal(4.) << 2;
QTest::newRow("no range - remove last")
- << int(QDeclarativePathView::NoHighlightRange) << 7 << 1 << 3. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 7 << 1 << qreal(3.) << 4;
QTest::newRow("no range - remove first")
- << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 4. << 3;
+ << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << qreal(4.) << 3;
QTest::newRow("no range - remove current offset")
- << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << 4. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << qreal(4.) << 4;
QTest::newRow("no range - remove all")
- << int(QDeclarativePathView::NoHighlightRange) << 0 << 8 << 0. << 0;
+ << int(QDeclarativePathView::NoHighlightRange) << 0 << 8 << qreal(0.) << 0;
}
void tst_QDeclarativePathView::removeModel()
@@ -627,40 +627,40 @@ void tst_QDeclarativePathView::moveModel_data()
// We have 8 items, with currentIndex == 4
QTest::newRow("move after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 1 << 4. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 1 << qreal(4.) << 4;
QTest::newRow("move before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 3 << 1 << 4. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 3 << 1 << qreal(4.) << 4;
QTest::newRow("move before current to after")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 6 << 1 << 5. << 3;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 6 << 1 << qreal(5.) << 3;
QTest::newRow("move multiple after current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 2 << 4. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 2 << qreal(4.) << 4;
QTest::newRow("move multiple before current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 2 << 4. << 4;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 2 << qreal(4.) << 4;
QTest::newRow("move before current to end")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 7 << 1 << 5. << 3;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 7 << 1 << qreal(5.) << 3;
QTest::newRow("move last to beginning")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 0 << 1 << 3. << 5;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 0 << 1 << qreal(3.) << 5;
QTest::newRow("move current")
- << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 6 << 1 << 2. << 6;
+ << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 6 << 1 << qreal(2.) << 6;
QTest::newRow("no range - move after current")
- << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 1 << 4. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 1 << qreal(4.) << 4;
QTest::newRow("no range - move before current")
- << int(QDeclarativePathView::NoHighlightRange) << 2 << 3 << 1 << 4. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 2 << 3 << 1 << qreal(4.) << 4;
QTest::newRow("no range - move before current to after")
- << int(QDeclarativePathView::NoHighlightRange) << 2 << 6 << 1 << 5. << 3;
+ << int(QDeclarativePathView::NoHighlightRange) << 2 << 6 << 1 << qreal(5.) << 3;
QTest::newRow("no range - move multiple after current")
- << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 2 << 4. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 2 << qreal(4.) << 4;
QTest::newRow("no range - move multiple before current")
- << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 2 << 4. << 4;
+ << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 2 << qreal(4.) << 4;
QTest::newRow("no range - move before current to end")
- << int(QDeclarativePathView::NoHighlightRange) << 2 << 7 << 1 << 5. << 3;
+ << int(QDeclarativePathView::NoHighlightRange) << 2 << 7 << 1 << qreal(5.) << 3;
QTest::newRow("no range - move last to beginning")
- << int(QDeclarativePathView::NoHighlightRange) << 7 << 0 << 1 << 3. << 5;
+ << int(QDeclarativePathView::NoHighlightRange) << 7 << 0 << 1 << qreal(3.) << 5;
QTest::newRow("no range - move current")
- << int(QDeclarativePathView::NoHighlightRange) << 4 << 6 << 1 << 4. << 6;
+ << int(QDeclarativePathView::NoHighlightRange) << 4 << 6 << 1 << qreal(4.) << 6;
QTest::newRow("no range - move multiple incl. current")
- << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 5 << 4. << 5;
+ << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 5 << qreal(4.) << 5;
}
void tst_QDeclarativePathView::moveModel()