summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-10-04 16:33:11 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-10-11 11:20:58 +0200
commitf71daf857cd3fb6666294bce4ee61363a216d0e4 (patch)
treed512e0f3cd2181351387a671699a49285af3c31f
parenta6b430337cd9e9a4b0e7c7165bb372f6c4ed8798 (diff)
Fix tst_QQuaternion's duplicate test tags
Having the same test tag for two rows of a data table makes the report less useful. We also intend to forbid doing that. Change-Id: I67ec32514b6550f4f97610a2140f1383d0d85b23 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 350be3da6a..6be46b9ee2 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -575,7 +575,7 @@ void tst_QQuaternion::multiply_data()
for (float x = -1.0f; x <= 1.0f; x += 0.5f)
for (float y = -1.0f; y <= 1.0f; y += 0.5f)
for (float z = -1.0f; z <= 1.0f; z += 0.5f) {
- QTest::newRow("exhaustive")
+ QTest::addRow("exhaustive: (%.1f, %.1f, %.1f), %.1f", x, y, z, w)
<< x << y << z << w
<< z << w << y << x;
}
@@ -962,28 +962,6 @@ void tst_QQuaternion::rotationTo()
QVERIFY(myFuzzyCompare(vec2, from));
}
-static QByteArray testnameForAxis(const QVector3D &axis)
-{
- QByteArray testname;
- if (axis == QVector3D()) {
- testname = "null";
- } else {
- if (axis.x()) {
- testname += axis.x() < 0 ? '-' : '+';
- testname += 'X';
- }
- if (axis.y()) {
- testname += axis.y() < 0 ? '-' : '+';
- testname += 'Y';
- }
- if (axis.z()) {
- testname += axis.z() < 0 ? '-' : '+';
- testname += 'Z';
- }
- }
- return testname;
-}
-
// Test quaternion convertion to and from orthonormal axes.
void tst_QQuaternion::fromDirection_data()
{
@@ -1006,7 +984,10 @@ void tst_QQuaternion::fromDirection_data()
QVector3D xAxis, yAxis, zAxis;
q.getAxes(&xAxis, &yAxis, &zAxis);
- QTest::newRow("dir: " + testnameForAxis(zAxis) + ", up: " + testnameForAxis(yAxis))
+ QTest::addRow("ortho dirs: (%.1f,%.1f,%.1f), (%.1f,%.1f,%.1f), (%.1f,%.1f,%.1f)",
+ xAxis.x(), xAxis.y(), xAxis.z(),
+ yAxis.x(), yAxis.y(), yAxis.z(),
+ zAxis.x(), zAxis.y(), zAxis.z())
<< zAxis * 10.0f << yAxis * 10.0f;
}
@@ -1025,7 +1006,10 @@ void tst_QQuaternion::fromDirection_data()
QVector3D xAxis, yAxis, zAxis;
q.getAxes(&xAxis, &yAxis, &zAxis);
- QTest::newRow("dir: " + testnameForAxis(zAxis) + ", up: null")
+ QTest::addRow("bad dirs: (%.1f,%.1f,%.1f), (%.1f,%.1f,%.1f), (%.1f,%.1f,%.1f)",
+ xAxis.x(), xAxis.y(), xAxis.z(),
+ yAxis.x(), yAxis.y(), yAxis.z(),
+ zAxis.x(), zAxis.y(), zAxis.z())
<< zAxis * 10.0f << QVector3D();
}
}