summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/statemachine/qstate
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-31 12:50:51 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-31 06:59:11 +0100
commite92f9fc49e5534089f3a0ce8348fb30e5bc7ead6 (patch)
treeaec5f201d97e46686a0a0c03c7b9bf81b33c8a91 /tests/auto/corelib/statemachine/qstate
parenta13b24eac09fec5da41fec63c8db986e7121d1c6 (diff)
Remove obsolete code from qstate autotest.
This was originaly the only test function in this test, and should have been deleted when it was replaced by the other test functions. Change-Id: Idc71a5462fd4d19955f9b14389b877be16c62ab5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/statemachine/qstate')
-rw-r--r--tests/auto/corelib/statemachine/qstate/tst_qstate.cpp145
1 files changed, 0 insertions, 145 deletions
diff --git a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
index 5a9c8d9996..0aa3d650c0 100644
--- a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
+++ b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
@@ -71,9 +71,6 @@ public:
virtual ~tst_QState();
private slots:
-#if 0
- void test();
-#endif
void assignProperty();
void assignPropertyTwice();
void historyInitialState();
@@ -91,148 +88,6 @@ tst_QState::~tst_QState()
{
}
-#if 0
-void tst_QState::test()
-{
- QStateMachine machine;
- QState *s1 = new QState(&machine);
-
- QCOMPARE(s1->machine(), &machine);
- QCOMPARE(s1->parentState(), &machine);
- QCOMPARE(s1->initialState(), (QState*)0);
- QVERIFY(s1->childStates().isEmpty());
- QVERIFY(s1->transitions().isEmpty());
-
- QCOMPARE(s1->isFinal(), false);
- s1->setFinal(true);
- QCOMPARE(s1->isFinal(), true);
- s1->setFinal(false);
- QCOMPARE(s1->isFinal(), false);
-
- QCOMPARE(s1->isParallel(), false);
- s1->setParallel(true);
- QCOMPARE(s1->isParallel(), true);
- s1->setParallel(false);
- QCOMPARE(s1->isParallel(), false);
-
- QCOMPARE(s1->isAtomic(), true);
- QCOMPARE(s1->isCompound(), false);
- QCOMPARE(s1->isComplex(), false);
-
- QState *s11 = new QState(s1);
- QCOMPARE(s11->parentState(), s1);
- QCOMPARE(s11->isAtomic(), true);
- QCOMPARE(s11->isCompound(), false);
- QCOMPARE(s11->isComplex(), false);
- QCOMPARE(s11->machine(), s1->machine());
- QVERIFY(s11->isDescendantOf(s1));
-
- QCOMPARE(s1->initialState(), (QState*)0);
- QCOMPARE(s1->childStates().size(), 1);
- QCOMPARE(s1->childStates().at(0), s11);
-
- QCOMPARE(s1->isAtomic(), false);
- QCOMPARE(s1->isCompound(), true);
- QCOMPARE(s1->isComplex(), true);
-
- s1->setParallel(true);
- QCOMPARE(s1->isAtomic(), false);
- QCOMPARE(s1->isCompound(), false);
- QCOMPARE(s1->isComplex(), true);
-
- QState *s12 = new QState(s1);
- QCOMPARE(s12->parentState(), s1);
- QCOMPARE(s12->isAtomic(), true);
- QCOMPARE(s12->isCompound(), false);
- QCOMPARE(s12->isComplex(), false);
- QCOMPARE(s12->machine(), s1->machine());
- QVERIFY(s12->isDescendantOf(s1));
- QVERIFY(!s12->isDescendantOf(s11));
-
- QCOMPARE(s1->initialState(), (QState*)0);
- QCOMPARE(s1->childStates().size(), 2);
- QCOMPARE(s1->childStates().at(0), s11);
- QCOMPARE(s1->childStates().at(1), s12);
-
- QCOMPARE(s1->isAtomic(), false);
- QCOMPARE(s1->isCompound(), false);
- QCOMPARE(s1->isComplex(), true);
-
- s1->setParallel(false);
- QCOMPARE(s1->isAtomic(), false);
- QCOMPARE(s1->isCompound(), true);
- QCOMPARE(s1->isComplex(), true);
-
- s1->setInitialState(s11);
- QCOMPARE(s1->initialState(), s11);
-
- s1->setInitialState(0);
- QCOMPARE(s1->initialState(), (QState*)0);
-
- s1->setInitialState(s12);
- QCOMPARE(s1->initialState(), s12);
-
- QState *s13 = new QState();
- s1->setInitialState(s13);
- QCOMPARE(s13->parentState(), s1);
- QCOMPARE(s1->childStates().size(), 3);
- QCOMPARE(s1->childStates().at(0), s11);
- QCOMPARE(s1->childStates().at(1), s12);
- QCOMPARE(s1->childStates().at(2), s13);
- QVERIFY(s13->isDescendantOf(s1));
-
- QVERIFY(s12->childStates().isEmpty());
-
- QState *s121 = new QState(s12);
- QCOMPARE(s121->parentState(), s12);
- QCOMPARE(s121->isAtomic(), true);
- QCOMPARE(s121->isCompound(), false);
- QCOMPARE(s121->isComplex(), false);
- QCOMPARE(s121->machine(), s12->machine());
- QVERIFY(s121->isDescendantOf(s12));
- QVERIFY(s121->isDescendantOf(s1));
- QVERIFY(!s121->isDescendantOf(s11));
-
- QCOMPARE(s12->childStates().size(), 1);
- QCOMPARE(s12->childStates().at(0), (QState*)s121);
-
- QCOMPARE(s1->childStates().size(), 3);
- QCOMPARE(s1->childStates().at(0), s11);
- QCOMPARE(s1->childStates().at(1), s12);
- QCOMPARE(s1->childStates().at(2), s13);
-
- s11->addTransition(s12);
- QCOMPARE(s11->transitions().size(), 1);
- QCOMPARE(s11->transitions().at(0)->sourceState(), s11);
- QCOMPARE(s11->transitions().at(0)->targetStates().size(), 1);
- QCOMPARE(s11->transitions().at(0)->targetStates().at(0), s12);
- QCOMPARE(s11->transitions().at(0)->eventType(), QEvent::None);
-
- QState *s14 = new QState();
- s12->addTransition(QList<QState*>() << s13 << s14);
- QCOMPARE(s12->transitions().size(), 1);
- QCOMPARE(s12->transitions().at(0)->sourceState(), s12);
- QCOMPARE(s12->transitions().at(0)->targetStates().size(), 2);
- QCOMPARE(s12->transitions().at(0)->targetStates().at(0), s13);
- QCOMPARE(s12->transitions().at(0)->targetStates().at(1), s14);
- QCOMPARE(s12->transitions().at(0)->eventType(), QEvent::None);
-
- s13->addTransition(this, SIGNAL(destroyed()), s14);
- QCOMPARE(s13->transitions().size(), 1);
- QCOMPARE(s13->transitions().at(0)->sourceState(), s13);
- QCOMPARE(s13->transitions().at(0)->targetStates().size(), 1);
- QCOMPARE(s13->transitions().at(0)->targetStates().at(0), s14);
- QCOMPARE(s13->transitions().at(0)->eventType(), QEvent::Signal);
- QVERIFY(qobject_cast<QSignalTransition*>(s13->transitions().at(0)) != 0);
-
- delete s13->transitions().at(0);
- QCOMPARE(s13->transitions().size(), 0);
-
- s12->addTransition(this, SIGNAL(destroyed()), s11);
- QCOMPARE(s12->transitions().size(), 2);
-}
-#endif
-
class TestClass: public QObject
{
Q_OBJECT