summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-02 07:27:12 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-02 07:27:12 (GMT)
commit7aeefc1e5904517bbc8133c32340379e20a74aca (patch)
treebf34f583348318f554138da373b1f18647e089c8
parent6891a96bbc818f0bbfb1837d2912bdb24211572e (diff)
downloadQt-7aeefc1e5904517bbc8133c32340379e20a74aca.zip
Qt-7aeefc1e5904517bbc8133c32340379e20a74aca.tar.gz
Qt-7aeefc1e5904517bbc8133c32340379e20a74aca.tar.bz2
Check bug QT-2423
-rw-r--r--tests/auto/declarative/qmltimer/tst_qmltimer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
index d3b273c..9c5dc30 100644
--- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
+++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
@@ -53,6 +53,7 @@ private slots:
void notRepeating();
void notRepeatingStart();
void repeat();
+ void noTriggerIfNotRunning();
void triggeredOnStart();
void triggeredOnStartRepeat();
};
@@ -176,6 +177,22 @@ void tst_qmltimer::triggeredOnStartRepeat()
QVERIFY(helper.count > oldCount);
}
+void tst_qmltimer::noTriggerIfNotRunning()
+{
+ QmlEngine engine;
+ QmlComponent component(&engine, QByteArray(
+ "import Qt 4.6\n"
+ "Item { property bool ok: true\n"
+ "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
+ "Timer { interval: 10; running: true; onTriggered: t1.running=false }"
+ "}"
+ ), QUrl("file://"));
+ QObject *item = component.create();
+ QVERIFY(item != 0);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(item->property("ok").toBool(), true);
+}
+
QTEST_MAIN(tst_qmltimer)
#include "tst_qmltimer.moc"