aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp15
3 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 191a96f81d..c39766e22d 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -404,7 +404,6 @@ void tst_qdeclarativebehaviors::sameValue()
QCOMPARE(target->x(), qreal(100));
target->setProperty("x", 0);
- qDebug() << "x" << target->x();
QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
QTRY_VERIFY(target->x() == qreal(0)); //make sure Behavior has finished.
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
index 6512533b37..60c537b1ed 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
@@ -31,7 +31,7 @@ Rectangle {
}
PropertyChanges {
target: rectangle
- opacity: 0
+ visible: false
}
}
}
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index a59ca2607f..e13a6c4305 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qsgview.h>
#include <private/qsgstateoperations_p.h>
#include <private/qsganchors_p_p.h>
#include <private/qsgrectangle_p.h>
@@ -49,6 +50,7 @@
#include <private/qdeclarativestategroup_p.h>
#include <private/qsgitem_p.h>
#include <private/qdeclarativeproperty_p.h>
+#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -953,10 +955,11 @@ void tst_qdeclarativestates::anchorChangesCrash()
// QTBUG-12273
void tst_qdeclarativestates::anchorRewindBug()
{
- QDeclarativeEngine engine;
+ QSGView *view = new QSGView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchorRewindBug.qml"));
+ qApp->processEvents();
- QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug.qml");
- QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(view->rootObject());
QVERIFY(rect != 0);
QSGItem * column = rect->findChild<QSGItem*>("column");
@@ -971,7 +974,7 @@ void tst_qdeclarativestates::anchorRewindBug()
// and column's implicit resizing should still work
QVERIFY(!QSGItemPrivate::get(column)->heightValid);
QVERIFY(!QSGItemPrivate::get(column)->widthValid);
- QCOMPARE(column->height(), 100.0);
+ QTRY_COMPARE(column->height(), 100.0);
QSGItemPrivate::get(rect)->setState("");
@@ -979,9 +982,9 @@ void tst_qdeclarativestates::anchorRewindBug()
// and column's implicit resizing should still work
QVERIFY(!QSGItemPrivate::get(column)->heightValid);
QVERIFY(!QSGItemPrivate::get(column)->widthValid);
- QCOMPARE(column->height(), 200.0);
+ QTRY_COMPARE(column->height(), 200.0);
- delete rect;
+ delete view;
}
// QTBUG-11834