From 5e2f8db651dbc696e2a7c6d4e89f93a63f82da48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 Feb 2013 21:49:39 +0100 Subject: [PATCH] Math: test also that DualComplex transformations are normalized. Fails for translation. --- src/Math/Test/DualComplexTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Math/Test/DualComplexTest.cpp b/src/Math/Test/DualComplexTest.cpp index dd3ab5968..180a444db 100644 --- a/src/Math/Test/DualComplexTest.cpp +++ b/src/Math/Test/DualComplexTest.cpp @@ -160,6 +160,7 @@ void DualComplexTest::invertedNormalized() { void DualComplexTest::rotation() { DualComplex a = DualComplex::rotation(Deg(120.0f)); + CORRADE_COMPARE(a.length(), 1.0f); CORRADE_COMPARE(a, DualComplex({-0.5f, 0.8660254f}, {0.0f, 0.0f})); CORRADE_COMPARE_AS(a.rotationAngle(), Deg(120.0f), Rad); } @@ -167,6 +168,7 @@ void DualComplexTest::rotation() { void DualComplexTest::translation() { Vector2 vec(1.5f, -3.5f); DualComplex a = DualComplex::translation(vec); + CORRADE_COMPARE(a.length(), 1.0f); CORRADE_COMPARE(a, DualComplex({}, {1.5f, -3.5f})); CORRADE_COMPARE(a.translation(), vec); }