From 8b3e065d52153b208b44c2fd25b868f5cce4c5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 20 Jul 2012 16:57:09 +0200 Subject: [PATCH] Don't use == when comparing floating point values. --- src/Math/Test/MatrixTest.cpp | 2 +- src/Math/Test/VectorTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/Test/MatrixTest.cpp b/src/Math/Test/MatrixTest.cpp index 7f2552089..a88245f86 100644 --- a/src/Math/Test/MatrixTest.cpp +++ b/src/Math/Test/MatrixTest.cpp @@ -110,7 +110,7 @@ void MatrixTest::data() { m[1][2] = 1.5f; - QVERIFY(m[2][1] == 1.0f); + QCOMPARE(m[2][1], 1.0f); QVERIFY(m[3] == vector); Matrix4 expected( diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index 23fecc55f..3bebbd863 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -69,7 +69,7 @@ void VectorTest::copy() { } void VectorTest::dot() { - QVERIFY(Vector4::dot({1.0f, 0.5f, 0.75f, 1.5f}, {2.0f, 4.0f, 1.0f, 7.0f}) == 15.25f); + QCOMPARE(Vector4::dot({1.0f, 0.5f, 0.75f, 1.5f}, {2.0f, 4.0f, 1.0f, 7.0f}), 15.25f); } void VectorTest::multiplyDivide() {