From 7aeefc1e5904517bbc8133c32340379e20a74aca Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 2 Nov 2009 17:27:12 +1000 Subject: Check bug QT-2423 --- tests/auto/declarative/qmltimer/tst_qmltimer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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" -- cgit v0.12