diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-03 14:56:53 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-03 14:56:54 +0200 |
commit | 9868e6b2f14e146e486e127664789f2978fabed0 (patch) | |
tree | 335e4a8088c1302ba7602e3e79b3b64eb4ace623 /tests | |
parent | aad8f0bcad607544ede63e8154bcdc14f40fd632 (diff) | |
parent | 33afb890aefdfbeae6ccee3e91600388b3068108 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iec94e513079426e5d87bdd24753863038cee573e
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cmake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/auto/cmake/cmake.pro | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | 20 |
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 0ce9542b..f5135cbc 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -9,8 +9,6 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") -set(Qt5_MODULE_TEST_DEPENDS Script Widgets) - test_module_includes( Declarative QDeclarativeEngine ) diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro index bf2dbcb7..61e8de78 100644 --- a/tests/auto/cmake/cmake.pro +++ b/tests/auto/cmake/cmake.pro @@ -2,4 +2,6 @@ # Cause make to do nothing. TEMPLATE = subdirs +CMAKE_QT_MODULES_UNDER_TEST = declarative + CONFIG += ctest_testcase diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 00869268..6352d02b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -47,6 +47,7 @@ #include <private/qdeclarativeitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> +#include <QSignalSpy> class tst_qdeclarativeanimations : public QObject { @@ -82,6 +83,7 @@ private slots: void doubleRegistrationBug(); void alwaysRunToEndRestartBug(); void transitionAssignmentBug(); + void zeroDurationTwoCompletedEmittedBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -850,6 +852,24 @@ void tst_qdeclarativeanimations::transitionAssignmentBug() QCOMPARE(rect->property("nullObject").toBool(), false); } +void tst_qdeclarativeanimations::zeroDurationTwoCompletedEmittedBug() +{ + QDeclarativeRectangle rect; + QDeclarativePropertyAnimation animation; + animation.setTarget(&rect); + animation.setProperty("x"); + animation.setFrom(1); + animation.setTo(200); + animation.setDuration(0); + QVERIFY(animation.from() == 1); + QSignalSpy spy(&animation, SIGNAL(completed(void))); + animation.start(); + QVERIFY(!animation.isRunning()); + QCOMPARE(rect.x(), qreal(200)); + QCOMPARE(spy.size(), 1); +} + + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" |