summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp')
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp48
1 files changed, 24 insertions, 24 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)