summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-17 08:42:15 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-17 08:42:15 (GMT)
commit583a306bb66601d4aa1ecc0429cc9e02aa6f9246 (patch)
tree2fc726f1e2ab73ae34cbced29d2499a29de64fbf
parentb38a1c034df8c807331bf57a0dbcbe05991130f8 (diff)
downloadQt-583a306bb66601d4aa1ecc0429cc9e02aa6f9246.zip
Qt-583a306bb66601d4aa1ecc0429cc9e02aa6f9246.tar.gz
Qt-583a306bb66601d4aa1ecc0429cc9e02aa6f9246.tar.bz2
add tests for QAbstractState::{entered,exited}() signals
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index 963b6b9..6404e15 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -1155,6 +1155,10 @@ void tst_QStateMachine::stateEntryAndExit()
QVERIFY(machine.configuration().isEmpty());
globalTick = 0;
QVERIFY(!machine.isRunning());
+ QSignalSpy s1EnteredSpy(s1, SIGNAL(entered()));
+ QSignalSpy s1ExitedSpy(s1, SIGNAL(exited()));
+ QSignalSpy s2EnteredSpy(s2, SIGNAL(entered()));
+ QSignalSpy s2ExitedSpy(s2, SIGNAL(exited()));
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
@@ -1180,6 +1184,11 @@ void tst_QStateMachine::stateEntryAndExit()
// s2 is exited
QCOMPARE(s2->events.at(1).first, 4);
QCOMPARE(s2->events.at(1).second, TestState::Exit);
+
+ QCOMPARE(s1EnteredSpy.count(), 1);
+ QCOMPARE(s1ExitedSpy.count(), 1);
+ QCOMPARE(s2EnteredSpy.count(), 1);
+ QCOMPARE(s2ExitedSpy.count(), 1);
}
// Two top-level states, one has two child states
{