summaryrefslogtreecommitdiff
path: root/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp')
-rw-r--r--tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index f2ab57a175..d7d6b88436 100644
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -253,16 +253,16 @@ void tst_QParallelAnimationGroup::setCurrentTime()
void tst_QParallelAnimationGroup::clearGroup()
{
QParallelAnimationGroup group;
+ static const int animationCount = 10;
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < animationCount; ++i) {
new QParallelAnimationGroup(&group);
}
- QCOMPARE(group.animationCount(), 10);
+ QCOMPARE(group.animationCount(), animationCount);
- int count = group.animationCount();
- QPointer<QAbstractAnimation> *children = new QPointer<QAbstractAnimation>[count];
- for (int i = 0; i < count; ++i) {
+ QPointer<QAbstractAnimation> children[animationCount];
+ for (int i = 0; i < animationCount; ++i) {
QVERIFY(group.animationAt(i) != 0);
children[i] = group.animationAt(i);
}
@@ -270,10 +270,8 @@ void tst_QParallelAnimationGroup::clearGroup()
group.clearAnimations();
QCOMPARE(group.animationCount(), 0);
QCOMPARE(group.currentTime(), 0);
- for (int i = 0; i < count; ++i)
- QCOMPARE(children[i], QPointer<QAbstractAnimation>());
-
- delete[] children;
+ for (int i = 0; i < animationCount; ++i)
+ QVERIFY(children[i].isNull());
}
void tst_QParallelAnimationGroup::propagateGroupUpdateToChildren()
@@ -807,15 +805,15 @@ void tst_QParallelAnimationGroup::autoAdd()
QParallelAnimationGroup group;
QCOMPARE(group.duration(), 0);
TestAnimation2 *test = new TestAnimation2(250, &group); // 0, duration = 250;
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(test->duration(), 250);
QCOMPARE(group.duration(), 250);
test = new TestAnimation2(750, &group); // 1
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(group.duration(), 750);
test = new TestAnimation2(500, &group); // 2
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(group.duration(), 750);
delete group.animationAt(1); // remove the one with duration = 750