diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-04-21 09:49:05 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-04-21 09:49:05 (GMT) |
commit | ea8bc5be8cea04da86b8df53cbde22b71f532585 (patch) | |
tree | eb31072de4c64a23e33854b2e53395ebbf4a36af /tests/auto/qstatemachine | |
parent | 74773151efa5cd71b39350911525402bed5d2f87 (diff) | |
download | Qt-ea8bc5be8cea04da86b8df53cbde22b71f532585.zip Qt-ea8bc5be8cea04da86b8df53cbde22b71f532585.tar.gz Qt-ea8bc5be8cea04da86b8df53cbde22b71f532585.tar.bz2 |
compile
Diffstat (limited to 'tests/auto/qstatemachine')
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index c906d53..085d16b 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -45,7 +45,7 @@ #include "qstatemachine.h" #include "qstate.h" -#include "qtransition.h" +#include "qactiontransition.h" #include "qhistorystate.h" #include "qkeyeventtransition.h" #include "qmouseeventtransition.h" @@ -194,11 +194,11 @@ void tst_QStateMachine::cleanup() qInstallMsgHandler(s_oldHandler); } -class EventTransition : public QTransition +class EventTransition : public QActionTransition { public: EventTransition(QEvent::Type type, QAbstractState *target, QState *parent = 0) - : QTransition(QList<QAbstractState*>() << target, parent), m_type(type) {} + : QActionTransition(QList<QAbstractState*>() << target, parent), m_type(type) {} protected: virtual bool eventTest(QEvent *e) const { return (e->type() == m_type); @@ -245,21 +245,21 @@ void tst_QStateMachine::transitionEntersParent() QState *greatGrandParent = new QState(); greatGrandParent->setObjectName("grandParent"); - greatGrandParent->setPropertyOnEntry(entryController, "greatGrandParentEntered", true); + greatGrandParent->assignProperty(entryController, "greatGrandParentEntered", true); machine.addState(greatGrandParent); machine.setInitialState(greatGrandParent); QState *grandParent = new QState(greatGrandParent); grandParent->setObjectName("grandParent"); - grandParent->setPropertyOnEntry(entryController, "grandParentEntered", true); + grandParent->assignProperty(entryController, "grandParentEntered", true); QState *parent = new QState(grandParent); parent->setObjectName("parent"); - parent->setPropertyOnEntry(entryController, "parentEntered", true); + parent->assignProperty(entryController, "parentEntered", true); QState *state = new QState(parent); state->setObjectName("state"); - state->setPropertyOnEntry(entryController, "stateEntered", true); + state->assignProperty(entryController, "stateEntered", true); QState *initialStateOfGreatGrandParent = new QState(greatGrandParent); initialStateOfGreatGrandParent->setObjectName("initialStateOfGreatGrandParent"); @@ -666,21 +666,21 @@ void tst_QStateMachine::errorStateEntersParentFirst() QState *greatGrandParent = new QState(); greatGrandParent->setObjectName("greatGrandParent"); - greatGrandParent->setPropertyOnEntry(entryController, "greatGrandParentEntered", true); + greatGrandParent->assignProperty(entryController, "greatGrandParentEntered", true); machine.addState(greatGrandParent); machine.setInitialState(greatGrandParent); QState *grandParent = new QState(greatGrandParent); grandParent->setObjectName("grandParent"); - grandParent->setPropertyOnEntry(entryController, "grandParentEntered", true); + grandParent->assignProperty(entryController, "grandParentEntered", true); QState *parent = new QState(grandParent); parent->setObjectName("parent"); - parent->setPropertyOnEntry(entryController, "parentEntered", true); + parent->assignProperty(entryController, "parentEntered", true); QState *errorState = new QState(parent); errorState->setObjectName("errorState"); - errorState->setPropertyOnEntry(entryController, "errorStateEntered", true); + errorState->assignProperty(entryController, "errorStateEntered", true); machine.setErrorState(errorState); QState *initialStateOfGreatGrandParent = new QState(greatGrandParent); @@ -818,15 +818,15 @@ void tst_QStateMachine::brokenStateIsNeverEntered() machine.setInitialState(initialState); QState *errorState = new QState(machine.rootState()); - errorState->setPropertyOnEntry(entryController, "errorStateEntered", true); + errorState->assignProperty(entryController, "errorStateEntered", true); machine.setErrorState(errorState); QState *brokenState = new QState(machine.rootState()); - brokenState->setPropertyOnEntry(entryController, "brokenStateEntered", true); + brokenState->assignProperty(entryController, "brokenStateEntered", true); brokenState->setObjectName("brokenState"); QState *childState = new QState(brokenState); - childState->setPropertyOnEntry(entryController, "childStateEntered", true); + childState->assignProperty(entryController, "childStateEntered", true); initialState->addTransition(new EventTransition(QEvent::User, brokenState)); @@ -896,13 +896,13 @@ void tst_QStateMachine::restoreProperties() QState *S1 = new QState(); S1->setObjectName("S1"); - S1->setPropertyOnEntry(object, "a", 3); + S1->assignProperty(object, "a", 3); S1->setRestorePolicy(QState::RestoreProperties); machine.addState(S1); QState *S2 = new QState(); S2->setObjectName("S2"); - S2->setPropertyOnEntry(object, "b", 5); + S2->assignProperty(object, "b", 5); S2->setRestorePolicy(QState::RestoreProperties); machine.addState(S2); @@ -1702,10 +1702,10 @@ void tst_QStateMachine::transitionActions() QState *s1 = new QState(machine.rootState()); QFinalState *s2 = new QFinalState(machine.rootState()); - QTransition *trans = new EventTransition(QEvent::User, s2); + EventTransition *trans = new EventTransition(QEvent::User, s2); s1->addTransition(trans); QVERIFY(trans->actions().isEmpty()); - QTest::ignoreMessage(QtWarningMsg, "QTransition::addAction: cannot add null action"); + QTest::ignoreMessage(QtWarningMsg, "QActionTransition::addAction: cannot add null action"); trans->addAction(0); QVERIFY(trans->actions().isEmpty()); @@ -1756,10 +1756,10 @@ void tst_QStateMachine::defaultGlobalRestorePolicy() propertyHolder->setProperty("b", 2); QState *s1 = new QState(machine.rootState()); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); QState *s2 = new QState(machine.rootState()); - s2->setPropertyOnEntry(propertyHolder, "b", 4); + s2->assignProperty(propertyHolder, "b", 4); QState *s3 = new QState(machine.rootState()); @@ -1800,12 +1800,12 @@ void tst_QStateMachine::restorePolicyNotInherited() QState *s1 = new QState(parentState); s1->setObjectName("s1"); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); parentState->setInitialState(s1); QState *s2 = new QState(parentState); s2->setObjectName("s2"); - s2->setPropertyOnEntry(propertyHolder, "b", 4); + s2->assignProperty(propertyHolder, "b", 4); QState *s3 = new QState(parentState); s3->setObjectName("s3"); @@ -1844,10 +1844,10 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() propertyHolder->setProperty("b", 2); QState *s1 = new QState(machine.rootState()); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); QState *s2 = new QState(machine.rootState()); - s2->setPropertyOnEntry(propertyHolder, "b", 4); + s2->assignProperty(propertyHolder, "b", 4); QState *s3 = new QState(machine.rootState()); @@ -1884,13 +1884,13 @@ void tst_QStateMachine::setRestorePolicyToDoNotRestore() QState *S1 = new QState(); S1->setObjectName("S1"); - S1->setPropertyOnEntry(object, "a", 3); + S1->assignProperty(object, "a", 3); S1->setRestorePolicy(QState::DoNotRestoreProperties); machine.addState(S1); QState *S2 = new QState(); S2->setObjectName("S2"); - S2->setPropertyOnEntry(object, "b", 5); + S2->assignProperty(object, "b", 5); S2->setRestorePolicy(QState::DoNotRestoreProperties); machine.addState(S2); @@ -1957,13 +1957,13 @@ void tst_QStateMachine::restorePolicyOnChildState() QState *s1 = new QState(parentState); s1->setRestorePolicy(QState::RestoreProperties); s1->setObjectName("s1"); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); parentState->setInitialState(s1); QState *s2 = new QState(parentState); s2->setRestorePolicy(QState::RestoreProperties); s2->setObjectName("s2"); - s2->setPropertyOnEntry(propertyHolder, "b", 4); + s2->assignProperty(propertyHolder, "b", 4); QState *s3 = new QState(parentState); s3->setRestorePolicy(QState::RestoreProperties); @@ -2002,10 +2002,10 @@ void tst_QStateMachine::globalRestorePolicySetToRestore() propertyHolder->setProperty("b", 2); QState *s1 = new QState(machine.rootState()); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); QState *s2 = new QState(machine.rootState()); - s2->setPropertyOnEntry(propertyHolder, "b", 4); + s2->assignProperty(propertyHolder, "b", 4); QState *s3 = new QState(machine.rootState()); @@ -2041,19 +2041,19 @@ void tst_QStateMachine::mixedRestoreProperties() QState *s1 = new QState(machine.rootState()); s1->setRestorePolicy(QState::RestoreProperties); - s1->setPropertyOnEntry(propertyHolder, "a", 3); + s1->assignProperty(propertyHolder, "a", 3); QState *s2 = new QState(machine.rootState()); - s2->setPropertyOnEntry(propertyHolder, "a", 4); + s2->assignProperty(propertyHolder, "a", 4); QState *s3 = new QState(machine.rootState()); QState *s4 = new QState(machine.rootState()); - s4->setPropertyOnEntry(propertyHolder, "a", 5); + s4->assignProperty(propertyHolder, "a", 5); QState *s5 = new QState(machine.rootState()); s5->setRestorePolicy(QState::RestoreProperties); - s5->setPropertyOnEntry(propertyHolder, "a", 6); + s5->assignProperty(propertyHolder, "a", 6); s1->addTransition(new EventTransition(QEvent::User, s2)); s2->addTransition(new EventTransition(QEvent::User, s3)); |