>From 7f360acab212c6c55fca0640191355755bb683d2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 May 2017 01:31:48 +0200 Subject: [PATCH] Fix tn_range_test compilation with gcc6 Avoid comparing booleans with 1 or -1, this results in errors like the following: error: comparison of constant '1' with boolean expression is always false [-Werror=bool-compare] --- tn_range_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tn_range_test.cpp b/tn_range_test.cpp index 5d115a4..ed1ed7a 100644 --- a/tn_range_test.cpp +++ b/tn_range_test.cpp @@ -137,7 +137,7 @@ void tn_range_test::test_auxiliary_functions(char const* file, int line) T const minT = std::numeric_limits::lowest(); INVOKE_BOOST_TEST(!is_strictly_between_extrema(maxT), file, line); - if(1 < maxT) + if(T(1) < maxT) { INVOKE_BOOST_TEST( is_strictly_between_extrema(1), file, line); } @@ -152,8 +152,8 @@ void tn_range_test::test_auxiliary_functions(char const* file, int line) if(minT < 0) { - INVOKE_BOOST_TEST_EQUAL(-1, signum(T(-1)), file, line); - INVOKE_BOOST_TEST_EQUAL(-1, signum(minT), file, line); + INVOKE_BOOST_TEST_EQUAL(T(-1), signum(T(-1)), file, line); + INVOKE_BOOST_TEST_EQUAL(T(-1), signum(minT), file, line); INVOKE_BOOST_TEST_EQUAL(true , is_exact_integer(T(-1)), file, line); } -- 2.8.0.rc1