summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-06 03:29:03 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-06 03:29:03 (GMT)
commit61d479a412e43255bf0681bec1cfb599cb7be886 (patch)
tree5434b4bc052845e8d23aedd39e76b40e10d5f76b /tests/auto/declarative/qmltimer/tst_qmltimer.cpp
parent09da662ff8486a5d0e990e26e8a4e499dcf6d404 (diff)
downloadQt-61d479a412e43255bf0681bec1cfb599cb7be886.zip
Qt-61d479a412e43255bf0681bec1cfb599cb7be886.tar.gz
Qt-61d479a412e43255bf0681bec1cfb599cb7be886.tar.bz2
More Timer testing
Diffstat (limited to 'tests/auto/declarative/qmltimer/tst_qmltimer.cpp')
-rw-r--r--tests/auto/declarative/qmltimer/tst_qmltimer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
index 9c5dc30..cf54647 100644
--- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
+++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
@@ -91,6 +91,9 @@ void tst_qmltimer::notRepeating()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(timer->isRunning());
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(timer->interval(), 100);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -107,6 +110,7 @@ void tst_qmltimer::notRepeatingStart()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100 }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(!timer->isRunning());
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -138,6 +142,11 @@ void tst_qmltimer::repeat()
QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > oldCount);
+
+ oldCount = helper.count;
+ timer->stop();
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count == oldCount);
}
void tst_qmltimer::triggeredOnStart()
@@ -146,6 +155,7 @@ void tst_qmltimer::triggeredOnStart()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(timer->triggeredOnStart());
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));