aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/animation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/animation')
-rw-r--r--tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp17
-rw-r--r--tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp9
-rw-r--r--tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp15
3 files changed, 18 insertions, 23 deletions
diff --git a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
index 6bd8c2a2e0..ceb8cc707f 100644
--- a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
@@ -266,14 +266,15 @@ void tst_QAnimationGroupJob::addChildTwice()
subGroup = new QAbstractAnimationJob;
parent->appendAnimation(subGroup);
parent->appendAnimation(subGroup);
- QVERIFY(parent->firstChild());
- QVERIFY(!parent->firstChild()->nextSibling());
- QVERIFY(!parent->firstChild()->previousSibling());
+ QVERIFY(!parent->children()->isEmpty());
+ QCOMPARE(parent->children()->count(), 1);
+ QVERIFY(!parent->children()->next(parent->children()->first()));
+ QVERIFY(!parent->children()->prev(parent->children()->last()));
parent->clear();
QCOMPARE(parent->currentAnimation(), nullptr);
- QVERIFY(!parent->firstChild());
+ QVERIFY(parent->children()->isEmpty());
// adding the same item twice to a group will remove the item from its current position
// and append it to the end
@@ -282,13 +283,13 @@ void tst_QAnimationGroupJob::addChildTwice()
subGroup2 = new QAbstractAnimationJob;
parent->appendAnimation(subGroup2);
- QCOMPARE(parent->firstChild(), subGroup);
- QCOMPARE(parent->lastChild(), subGroup2);
+ QCOMPARE(parent->children()->first(), subGroup);
+ QCOMPARE(parent->children()->last(), subGroup2);
parent->appendAnimation(subGroup);
- QCOMPARE(parent->firstChild(), subGroup2);
- QCOMPARE(parent->lastChild(), subGroup);
+ QCOMPARE(parent->children()->first(), subGroup2);
+ QCOMPARE(parent->children()->last(), subGroup);
delete parent;
}
diff --git a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
index 8c4c461813..a22c94e4c4 100644
--- a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
@@ -321,14 +321,11 @@ void tst_QParallelAnimationGroupJob::clearGroup()
group.appendAnimation(new QParallelAnimationGroupJob);
}
- int count = 0;
- for (QAbstractAnimationJob *anim = group.firstChild(); anim; anim = anim->nextSibling())
- ++count;
- QCOMPARE(count, animationCount);
+ QCOMPARE(group.children()->count(), animationCount);
group.clear();
- QVERIFY(!group.firstChild() && !group.lastChild());
+ QVERIFY(group.children()->isEmpty());
QCOMPARE(group.currentLoopTime(), 0);
}
@@ -435,7 +432,7 @@ void tst_QParallelAnimationGroupJob::deleteChildrenWithRunningGroup()
QTRY_VERIFY(group.currentLoopTime() > 0);
delete anim1;
- QVERIFY(!group.firstChild());
+ QVERIFY(group.children()->isEmpty());
QCOMPARE(group.duration(), 0);
QCOMPARE(group.state(), QAnimationGroupJob::Stopped);
QCOMPARE(group.currentLoopTime(), 0); //that's the invariant
diff --git a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
index 2712ccde67..e8872ebc58 100644
--- a/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp
@@ -933,14 +933,11 @@ void tst_QSequentialAnimationGroupJob::clearGroup()
subGroup->appendAnimation(new QPauseAnimationJob(10));
}
- int count = 0;
- for (QAbstractAnimationJob *anim = group.firstChild(); anim; anim = anim->nextSibling())
- ++count;
- QCOMPARE(count, animationCount);
+ QCOMPARE(group.children()->count(), animationCount);
group.clear();
- QVERIFY(!group.firstChild() && !group.lastChild());
+ QVERIFY(group.children()->isEmpty());
QCOMPARE(group.currentLoopTime(), 0);
}
@@ -1131,7 +1128,7 @@ void tst_QSequentialAnimationGroupJob::deleteChildrenWithRunningGroup()
QTRY_VERIFY(group.currentLoopTime() > 0);
delete anim1;
- QVERIFY(!group.firstChild());
+ QVERIFY(group.children()->isEmpty());
QCOMPARE(group.duration(), 0);
QCOMPARE(group.state(), QAnimationGroupJob::Stopped);
QCOMPARE(group.currentLoopTime(), 0); //that's the invariant
@@ -1568,12 +1565,12 @@ void tst_QSequentialAnimationGroupJob::clear()
TestAnimation *anim2 = new TestAnimation;
group.appendAnimation(anim2);
- QCOMPARE(group.firstChild(), anim1);
- QCOMPARE(group.lastChild(), anim2);
+ QCOMPARE(group.children()->first(), anim1);
+ QCOMPARE(group.children()->last(), anim2);
group.start();
QTest::qWait(anim1->duration() + 100);
- QTRY_VERIFY(!group.firstChild());
+ QTRY_VERIFY(group.children()->isEmpty());
QCOMPARE(group.state(), QAbstractAnimationJob::Stopped);
QCOMPARE(group.currentLoopTime(), 0);