diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-17 12:38:09 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-17 12:44:33 (GMT) |
commit | f10441ab65d6204f23735e7cffbab5ac81663e91 (patch) | |
tree | 8b7469b72dda25036fe8933608609cf611b0edf8 /tests/auto/qparallelanimationgroup | |
parent | aff5e7a05e598f8196da4fe39dd0d193426d36e8 (diff) | |
download | Qt-f10441ab65d6204f23735e7cffbab5ac81663e91.zip Qt-f10441ab65d6204f23735e7cffbab5ac81663e91.tar.gz Qt-f10441ab65d6204f23735e7cffbab5ac81663e91.tar.bz2 |
Autotest: fixed compile issues on hp compiler
Diffstat (limited to 'tests/auto/qparallelanimationgroup')
-rw-r--r-- | tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index 9f66fe0..d7d6b88 100644 --- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -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 |