From f64ab8e6b08cd0c552c780e1190b148fbc9bb69d Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 12 Aug 2015 17:52:54 -0700 Subject: [PATCH] add QCOMPARE_QUATS macro for easier tests --- tests/GLMTestUtils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/GLMTestUtils.h b/tests/GLMTestUtils.h index 7dbc4a840f..f353255cc1 100644 --- a/tests/GLMTestUtils.h +++ b/tests/GLMTestUtils.h @@ -59,4 +59,8 @@ inline QTextStream& operator<< (QTextStream& stream, const glm::mat4& matrix) { stream << "]\n\t"; // hacky as hell, but this should work... return stream; } + +#define QCOMPARE_QUATS(rotationA, rotationB, angle) \ + QVERIFY(fabsf(1.0f - fabsf(glm::dot(rotationA, rotationB))) < 2.0f * sinf(angle)) + #endif