summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-21 13:47:37 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-21 13:48:15 (GMT)
commitea7830a2551f1c68e5dbc53ee9a5ce3a8fcbe872 (patch)
tree73e7cbb0a748d06647249b42d8c082ea8e43c7b5
parent641ba0bb2c144a4bef25982d90ac49d9af354202 (diff)
downloadQt-ea7830a2551f1c68e5dbc53ee9a5ce3a8fcbe872.zip
Qt-ea7830a2551f1c68e5dbc53ee9a5ce3a8fcbe872.tar.gz
Qt-ea7830a2551f1c68e5dbc53ee9a5ce3a8fcbe872.tar.bz2
Fix memleaks in the autotests
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index bafd848..44fc998 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -285,8 +285,11 @@ void tst_QStateMachine::transitionFromRootState()
QStateMachine machine;
QState *root = machine.rootState();
QState *s1 = new QState(root);
+ EventTransition *trans = new EventTransition(QEvent::User, s1);
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: cannot add transition from root state");
- root->addTransition(new EventTransition(QEvent::User, s1));
+ root->addTransition(trans);
+ QCOMPARE(trans->sourceState(), (QState*)0);
+ delete trans;
}
void tst_QStateMachine::transitionEntersParent()
@@ -3113,6 +3116,8 @@ void tst_QStateMachine::specificTargetValueOfAnimation()
QVERIFY(machine.configuration().contains(s3));
QCOMPARE(object->property("foo").toDouble(), 2.0);
QCOMPARE(anim->endValue().toDouble(), 10.0);
+
+ delete anim;
}
void tst_QStateMachine::addDefaultAnimation()
@@ -3145,6 +3150,8 @@ void tst_QStateMachine::addDefaultAnimation()
QVERIFY(machine.configuration().contains(s3));
QCOMPARE(object->property("foo").toDouble(), 2.0);
+
+ delete object;
}
void tst_QStateMachine::addDefaultAnimationWithUnusedAnimation()
@@ -3224,6 +3231,9 @@ void tst_QStateMachine::removeDefaultAnimation()
machine.removeDefaultAnimation(anim2);
QCOMPARE(machine.defaultAnimations().size(), 0);
+
+ delete anim;
+ delete anim2;
}
void tst_QStateMachine::overrideDefaultAnimationWithSpecific()
@@ -3264,6 +3274,9 @@ void tst_QStateMachine::overrideDefaultAnimationWithSpecific()
QVERIFY(machine.configuration().contains(s3));
QCOMPARE(counter.counter, 2); // specific animation started and stopped
+
+ delete defaultAnimation;
+ delete moreSpecificAnimation;
}
/*