summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-05-22 12:42:59 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-05-22 12:43:58 (GMT)
commit289befd1bce5b47c48887d1fe23fb912b60a8e56 (patch)
treefbeb7958b99650fce0db06ed1df38a2c6ce51f44 /tests
parentdf77e086585ad9f0fe5c7778643a76e5634ac7cd (diff)
downloadQt-289befd1bce5b47c48887d1fe23fb912b60a8e56.zip
Qt-289befd1bce5b47c48887d1fe23fb912b60a8e56.tar.gz
Qt-289befd1bce5b47c48887d1fe23fb912b60a8e56.tar.bz2
add some edge case tests for QStateMachine::start() & stop()
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index 40c01bd..8354d03 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -2092,6 +2092,9 @@ void tst_QStateMachine::startAndStop()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(s1));
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::start(): already running");
+ machine.start();
+
machine.stop();
QTRY_COMPARE(machine.isRunning(), false);
QTRY_COMPARE(stoppedSpy.count(), 1);
@@ -2100,6 +2103,11 @@ void tst_QStateMachine::startAndStop()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(s1));
+
+ machine.start();
+ machine.stop();
+ QTRY_COMPARE(startedSpy.count(), 2);
+ QCOMPARE(stoppedSpy.count(), 2);
}
void tst_QStateMachine::targetStateWithNoParent()