From 583a306bb66601d4aa1ecc0429cc9e02aa6f9246 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 10:42:15 +0200 Subject: add tests for QAbstractState::{entered,exited}() signals --- tests/auto/qstatemachine/tst_qstatemachine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- cgit v0.12