From 289befd1bce5b47c48887d1fe23fb912b60a8e56 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 22 May 2009 14:42:59 +0200 Subject: add some edge case tests for QStateMachine::start() & stop() --- tests/auto/qstatemachine/tst_qstatemachine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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() -- cgit v0.12