From a3b425bd26b58d9943f40f5ee61203f93a9a680c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 24 Jul 2018 20:07:58 +0200 Subject: [PATCH] Math: properly test op-and-assign operators in Unit. --- src/Magnum/Math/Test/UnitTest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Magnum/Math/Test/UnitTest.cpp b/src/Magnum/Math/Test/UnitTest.cpp index 308bfa475..65be546d7 100644 --- a/src/Magnum/Math/Test/UnitTest.cpp +++ b/src/Magnum/Math/Test/UnitTest.cpp @@ -167,6 +167,13 @@ void UnitTest::addSubtract() { constexpr Sec e = c - a; CORRADE_COMPARE(d, c); CORRADE_COMPARE(e, b); + + Sec f = a; + f += b; + Sec g = c; + g -= a; + CORRADE_COMPARE(f, c); + CORRADE_COMPARE(g, b); } void UnitTest::multiplyDivide() { @@ -182,6 +189,13 @@ void UnitTest::multiplyDivide() { constexpr Float f = b/a; CORRADE_COMPARE(f, -1.5f); + + Sec g = a; + g *= -1.5f; + Sec h = b; + h /= -1.5f; + CORRADE_COMPARE(g, b); + CORRADE_COMPARE(h, a); } }}}