diff options
Diffstat (limited to 'tests/auto/qstatemachine')
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 9 |
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 { |