summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/math3d
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-30 15:15:12 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-31 08:29:15 +0000
commit3859b304e846b4ee8e77350945b6c63bbb487e13 (patch)
tree27b80f83147341f0927d5fcea08718ba97bf530d /tests/auto/gui/math3d
parent7b6be75796fd51b320ea3bf4dceb88c561ce29a6 (diff)
tests/auto/gui: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I624deb320c378c18a29b3707f48583d53bfd5186 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui/math3d')
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp48
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp20
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp74
3 files changed, 71 insertions, 71 deletions
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index e7659a25bd..463322ff2a 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -673,7 +673,7 @@ void tst_QMatrixNxN::compare2x2()
QMatrix2x2 m2(uniqueValues2);
QMatrix2x2 m3(transposedValues2);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -686,7 +686,7 @@ void tst_QMatrixNxN::compare3x3()
QMatrix3x3 m2(uniqueValues3);
QMatrix3x3 m3(transposedValues3);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -699,7 +699,7 @@ void tst_QMatrixNxN::compare4x4()
QMatrix4x4 m2(uniqueValues4);
QMatrix4x4 m3(transposedValues4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -712,7 +712,7 @@ void tst_QMatrixNxN::compare4x3()
QMatrix4x3 m2(uniqueValues4x3);
QMatrix4x3 m3(transposedValues3x4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -1858,7 +1858,7 @@ void tst_QMatrixNxN::inverted4x4()
if (invertible)
QVERIFY(m1.determinant() != 0.0f);
else
- QVERIFY(m1.determinant() == 0.0f);
+ QCOMPARE(m1.determinant(), 0.0f);
Matrix4 m1alt;
memcpy(m1alt.v, (const float *)m1Values, sizeof(m1alt.v));
@@ -1992,7 +1992,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m2b;
m2b.scale(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2051,7 +2051,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m4b(m3);
m4b.scale(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
// Test coverage when the special matrix type is unknown.
@@ -2138,7 +2138,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m2b;
m2b.translate(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2179,7 +2179,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m4b(m3);
m4b.translate(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
}
@@ -3073,7 +3073,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toAffine());
+ QCOMPARE(m1, m2.toAffine());
QMatrix m3;
m3.scale(1.5, -2.0);
@@ -3085,7 +3085,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toAffine());
+ QCOMPARE(m3, m4.toAffine());
QMatrix m5;
m5.rotate(45.0);
@@ -3120,7 +3120,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toTransform());
+ QCOMPARE(m1, m2.toTransform());
QTransform m3;
m3.scale(1.5, -2.0);
@@ -3132,7 +3132,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toTransform());
+ QCOMPARE(m3, m4.toTransform());
QTransform m5;
m5.rotate(45.0);
@@ -3206,16 +3206,16 @@ void tst_QMatrixNxN::mapRect()
QRect recti(qRound(x), qRound(y), qRound(width), qRound(height));
QMatrix4x4 m1;
- QVERIFY(m1.mapRect(rect) == rect);
- QVERIFY(m1.mapRect(recti) == recti);
+ QCOMPARE(m1.mapRect(rect), rect);
+ QCOMPARE(m1.mapRect(recti), recti);
QMatrix4x4 m2;
m2.translate(-100.5f, 64.0f);
QRectF translated = rect.translated(-100.5f, 64.0f);
QRect translatedi = QRect(qRound(recti.x() - 100.5f), recti.y() + 64,
recti.width(), recti.height());
- QVERIFY(m2.mapRect(rect) == translated);
- QVERIFY(m2.mapRect(recti) == translatedi);
+ QCOMPARE(m2.mapRect(rect), translated);
+ QCOMPARE(m2.mapRect(recti), translatedi);
QMatrix4x4 m3;
m3.scale(-100.5f, 64.0f);
@@ -3232,7 +3232,7 @@ void tst_QMatrixNxN::mapRect()
scaley -= scaleht;
}
QRectF scaled(scalex, scaley, scalewid, scaleht);
- QVERIFY(m3.mapRect(rect) == scaled);
+ QCOMPARE(m3.mapRect(rect), scaled);
scalex = recti.x() * -100.5f;
scaley = recti.y() * 64.0f;
scalewid = recti.width() * -100.5f;
@@ -3247,7 +3247,7 @@ void tst_QMatrixNxN::mapRect()
}
QRect scaledi(qRound(scalex), qRound(scaley),
qRound(scalewid), qRound(scaleht));
- QVERIFY(m3.mapRect(recti) == scaledi);
+ QCOMPARE(m3.mapRect(recti), scaledi);
QMatrix4x4 m4;
m4.translate(-100.5f, 64.0f);
@@ -3261,7 +3261,7 @@ void tst_QMatrixNxN::mapRect()
if (transy1 > transy2)
qSwap(transy1, transy2);
QRectF trans(transx1, transy1, transx2 - transx1, transy2 - transy1);
- QVERIFY(m4.mapRect(rect) == trans);
+ QCOMPARE(m4.mapRect(rect), trans);
transx1 = recti.x() * -2.5f - 100.5f;
transy1 = recti.y() * 4.0f + 64.0f;
transx2 = (recti.x() + recti.width()) * -2.5f - 100.5f;
@@ -3273,7 +3273,7 @@ void tst_QMatrixNxN::mapRect()
QRect transi(qRound(transx1), qRound(transy1),
qRound(transx2) - qRound(transx1),
qRound(transy2) - qRound(transy1));
- QVERIFY(m4.mapRect(recti) == transi);
+ QCOMPARE(m4.mapRect(recti), transi);
m4.rotate(45.0f, 0.0f, 0.0f, 1.0f);
@@ -3290,7 +3290,7 @@ void tst_QMatrixNxN::mapRect()
QRect mri = m4.mapRect(recti);
QRect tri = t4.mapRect(recti);
- QVERIFY(mri == tri);
+ QCOMPARE(mri, tri);
}
void tst_QMatrixNxN::mapVector_data()
@@ -3389,14 +3389,14 @@ void tst_QMatrixNxN::properties()
void tst_QMatrixNxN::metaTypes()
{
- QVERIFY(QMetaType::type("QMatrix4x4") == QMetaType::QMatrix4x4);
+ QCOMPARE(QMetaType::type("QMatrix4x4"), int(QMetaType::QMatrix4x4));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QMatrix4x4)),
QByteArray("QMatrix4x4"));
QVERIFY(QMetaType::isRegistered(QMetaType::QMatrix4x4));
- QVERIFY(qMetaTypeId<QMatrix4x4>() == QMetaType::QMatrix4x4);
+ QCOMPARE(qMetaTypeId<QMatrix4x4>(), int(QMetaType::QMatrix4x4));
}
QTEST_APPLESS_MAIN(tst_QMatrixNxN)
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index ec7af97f07..1fbad5b829 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -446,7 +446,7 @@ void tst_QQuaternion::compare()
QQuaternion v5(8, 1, 2, 3);
QQuaternion v6(3, 1, 2, 4);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -522,7 +522,7 @@ void tst_QQuaternion::add()
QQuaternion v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -560,7 +560,7 @@ void tst_QQuaternion::subtract()
QQuaternion v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -569,7 +569,7 @@ void tst_QQuaternion::subtract()
QQuaternion v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -704,7 +704,7 @@ void tst_QQuaternion::multiplyFactor()
QQuaternion v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -740,7 +740,7 @@ void tst_QQuaternion::divide()
QQuaternion v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -764,7 +764,7 @@ void tst_QQuaternion::negate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(-w1, -x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test quaternion conjugate calculations.
@@ -783,7 +783,7 @@ void tst_QQuaternion::conjugate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(w1, -x1, -y1, -z1);
- QVERIFY(v1.conjugate() == v2);
+ QCOMPARE(v1.conjugate(), v2);
}
// Test quaternion creation from an axis and an angle.
@@ -1325,14 +1325,14 @@ void tst_QQuaternion::properties()
void tst_QQuaternion::metaTypes()
{
- QVERIFY(QMetaType::type("QQuaternion") == QMetaType::QQuaternion);
+ QCOMPARE(QMetaType::type("QQuaternion"), int(QMetaType::QQuaternion));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QQuaternion)),
QByteArray("QQuaternion"));
QVERIFY(QMetaType::isRegistered(QMetaType::QQuaternion));
- QVERIFY(qMetaTypeId<QQuaternion>() == QMetaType::QQuaternion);
+ QCOMPARE(qMetaTypeId<QQuaternion>(), int(QMetaType::QQuaternion));
}
QTEST_APPLESS_MAIN(tst_QQuaternion)
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index d2e0bbe375..eeff2c3bae 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -885,7 +885,7 @@ void tst_QVectorND::compare2()
QVector2D v3(3, 2);
QVector2D v4(1, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
}
@@ -899,7 +899,7 @@ void tst_QVectorND::compare3()
QVector3D v4(1, 3, 4);
QVector3D v5(1, 2, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -915,7 +915,7 @@ void tst_QVectorND::compare4()
QVector4D v5(1, 2, 3, 8);
QVector4D v6(1, 2, 4, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -969,7 +969,7 @@ void tst_QVectorND::add2()
QVector2D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1033,7 +1033,7 @@ void tst_QVectorND::add3()
QVector3D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1109,7 +1109,7 @@ void tst_QVectorND::add4()
QVector4D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1141,14 +1141,14 @@ void tst_QVectorND::subtract2()
QVector2D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
QVector2D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1181,7 +1181,7 @@ void tst_QVectorND::subtract3()
QVector3D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1189,7 +1189,7 @@ void tst_QVectorND::subtract3()
QVector3D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1226,7 +1226,7 @@ void tst_QVectorND::subtract4()
QVector4D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1235,7 +1235,7 @@ void tst_QVectorND::subtract4()
QVector4D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1290,7 +1290,7 @@ void tst_QVectorND::multiply2()
QVector2D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1354,7 +1354,7 @@ void tst_QVectorND::multiply3()
QVector3D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1430,7 +1430,7 @@ void tst_QVectorND::multiply4()
QVector4D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1488,7 +1488,7 @@ void tst_QVectorND::multiplyFactor2()
QVector2D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1553,7 +1553,7 @@ void tst_QVectorND::multiplyFactor3()
QVector3D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1628,7 +1628,7 @@ void tst_QVectorND::multiplyFactor4()
QVector4D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1660,7 +1660,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1670,7 +1670,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1704,7 +1704,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1715,7 +1715,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1753,7 +1753,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1765,7 +1765,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1798,7 +1798,7 @@ void tst_QVectorND::divideFactor2()
QVector2D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1830,7 +1830,7 @@ void tst_QVectorND::divideFactor3()
QVector3D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1865,7 +1865,7 @@ void tst_QVectorND::divideFactor4()
QVector4D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1887,7 +1887,7 @@ void tst_QVectorND::negate2()
QVector2D v1(x1, y1);
QVector2D v2(-x1, -y1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 3D vectors.
@@ -1905,7 +1905,7 @@ void tst_QVectorND::negate3()
QVector3D v1(x1, y1, z1);
QVector3D v2(-x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 4D vectors.
@@ -1924,7 +1924,7 @@ void tst_QVectorND::negate4()
QVector4D v1(x1, y1, z1, w1);
QVector4D v2(-x1, -y1, -z1, -w1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test the computation of vector cross-products.
@@ -1976,7 +1976,7 @@ void tst_QVectorND::crossProduct()
QVector3D v3(x3, y3, z3);
QVector3D v4 = QVector3D::crossProduct(v1, v2);
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
// Compute the cross-product long-hand and check again.
float xres = y1 * z2 - z1 * y2;
@@ -2667,9 +2667,9 @@ void tst_QVectorND::properties()
void tst_QVectorND::metaTypes()
{
- QVERIFY(QMetaType::type("QVector2D") == QMetaType::QVector2D);
- QVERIFY(QMetaType::type("QVector3D") == QMetaType::QVector3D);
- QVERIFY(QMetaType::type("QVector4D") == QMetaType::QVector4D);
+ QCOMPARE(QMetaType::type("QVector2D"), int(QMetaType::QVector2D));
+ QCOMPARE(QMetaType::type("QVector3D"), int(QMetaType::QVector3D));
+ QCOMPARE(QMetaType::type("QVector4D"), int(QMetaType::QVector4D));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector2D)),
QByteArray("QVector2D"));
@@ -2682,9 +2682,9 @@ void tst_QVectorND::metaTypes()
QVERIFY(QMetaType::isRegistered(QMetaType::QVector3D));
QVERIFY(QMetaType::isRegistered(QMetaType::QVector4D));
- QVERIFY(qMetaTypeId<QVector2D>() == QMetaType::QVector2D);
- QVERIFY(qMetaTypeId<QVector3D>() == QMetaType::QVector3D);
- QVERIFY(qMetaTypeId<QVector4D>() == QMetaType::QVector4D);
+ QCOMPARE(qMetaTypeId<QVector2D>(), int(QMetaType::QVector2D));
+ QCOMPARE(qMetaTypeId<QVector3D>(), int(QMetaType::QVector3D));
+ QCOMPARE(qMetaTypeId<QVector4D>(), int(QMetaType::QVector4D));
}
QTEST_APPLESS_MAIN(tst_QVectorND)