From 7cb79b145e069bdc1aedf1a104bcad609078f6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Mar 2013 21:13:27 +0100 Subject: [PATCH] Math: test Constants constexpr. --- src/Math/Test/ConstantsTest.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Math/Test/ConstantsTest.cpp b/src/Math/Test/ConstantsTest.cpp index 98211496b..eef26316f 100644 --- a/src/Math/Test/ConstantsTest.cpp +++ b/src/Math/Test/ConstantsTest.cpp @@ -41,11 +41,15 @@ ConstantsTest::ConstantsTest() { } void ConstantsTest::constants() { - CORRADE_COMPARE(Math::pow<2>(Constants::sqrt2()), 2.0f); - CORRADE_COMPARE(Math::pow<2>(Constants::sqrt3()), 3.0f); - - CORRADE_COMPARE(Math::pow<2>(Constants::sqrt2()), 2.0); - CORRADE_COMPARE(Math::pow<2>(Constants::sqrt3()), 3.0); + constexpr Float a = Constants::sqrt2(); + constexpr Float b = Constants::sqrt3(); + CORRADE_COMPARE(Math::pow<2>(a), 2.0f); + CORRADE_COMPARE(Math::pow<2>(b), 3.0f); + + constexpr Double c = Constants::sqrt2(); + constexpr Double d = Constants::sqrt3(); + CORRADE_COMPARE(Math::pow<2>(c), 2.0); + CORRADE_COMPARE(Math::pow<2>(d), 3.0); } }}}