summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp')
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index 4d1d846eb8..fc8c1a3e5c 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -374,7 +374,7 @@ void tst_QEasingCurve::valueForProgress()
// in theory the baseline should't have an error of more than 0.00005 due to how its rounded,
// but due to FP imprecision, we have to adjust the error a bit more.
const qreal errorBound = 0.00006;
- for (int i = 0; i < at.count(); ++i) {
+ for (int i = 0; i < at.size(); ++i) {
const qreal ex = expected.at(i);
const qreal error = qAbs(ex - curve.valueForProgress(at.at(i)/qreal(100)));
QVERIFY(error <= errorBound);
@@ -574,18 +574,18 @@ void tst_QEasingCurve::bezierSpline_data()
static inline void setupBezierSpline(QEasingCurve *easingCurve, const QString &string)
{
- QStringList pointStr = string.split(QLatin1Char(' '));
+ const QStringList pointStr = string.split(QLatin1Char(' '));
QList<QPointF> points;
- foreach (const QString &str, pointStr) {
+ for (const QString &str : pointStr) {
QStringList coordStr = str.split(QLatin1Char(','));
QPointF point(coordStr.first().toDouble(), coordStr.last().toDouble());
points.append(point);
}
- QVERIFY(points.count() % 3 == 0);
+ QVERIFY(points.size() % 3 == 0);
- for (int i = 0; i < points.count() / 3; i++) {
+ for (int i = 0; i < points.size() / 3; i++) {
QPointF c1 = points.at(i * 3);
QPointF c2 = points.at(i * 3 + 1);
QPointF p1 = points.at(i * 3 + 2);
@@ -603,7 +603,7 @@ void tst_QEasingCurve::bezierSpline()
setupBezierSpline(&bezierEasingCurve, definition);
const qreal errorBound = 0.002;
- for (int i = 0; i < at.count(); ++i) {
+ for (int i = 0; i < at.size(); ++i) {
const qreal ex = expected.at(i);
const qreal value = bezierEasingCurve.valueForProgress(at.at(i)/qreal(100));
const qreal error = qAbs(ex - value);
@@ -642,11 +642,11 @@ void tst_QEasingCurve::tcbSpline_data()
static inline void setupTCBSpline(QEasingCurve *easingCurve, const QString &string)
{
- QStringList pointStr = string.split(QLatin1Char(' '));
+ const QStringList pointStr = string.split(QLatin1Char(' '));
- foreach (const QString &str, pointStr) {
+ for (const QString &str : pointStr) {
QStringList coordStr = str.split(QLatin1Char(','));
- Q_ASSERT(coordStr.count() == 5);
+ Q_ASSERT(coordStr.size() == 5);
QPointF point(coordStr.first().toDouble(), coordStr.at(1).toDouble());
qreal t = coordStr.at(2).toDouble();
qreal c = coordStr.at(3).toDouble();
@@ -665,7 +665,7 @@ void tst_QEasingCurve::tcbSpline()
setupTCBSpline(&tcbEasingCurve, definition);
const qreal errorBound = 0.002;
- for (int i = 0; i < at.count(); ++i) {
+ for (int i = 0; i < at.size(); ++i) {
const qreal ex = expected.at(i);
const qreal value = tcbEasingCurve.valueForProgress(at.at(i)/qreal(100));
const qreal error = qAbs(ex - value);