diff options
Diffstat (limited to 'libs/geometry/test/util/select_most_precise.cpp')
-rw-r--r-- | libs/geometry/test/util/select_most_precise.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/libs/geometry/test/util/select_most_precise.cpp b/libs/geometry/test/util/select_most_precise.cpp index 11b066fa3..3ec2dec73 100644 --- a/libs/geometry/test/util/select_most_precise.cpp +++ b/libs/geometry/test/util/select_most_precise.cpp @@ -24,8 +24,15 @@ template <typename T1, typename T2, typename ExpectedType> void test() { typedef typename bg::select_most_precise<T1, T2>::type type; - - BOOST_CHECK((boost::is_same<type, ExpectedType>::type::value)); + bool is_same = boost::is_same<type, ExpectedType>::type::value; + + BOOST_CHECK_MESSAGE(is_same, + "The most precise of types " << + "T1: {" << typeid(T1).name() << " | s: " << sizeof(T1) << "}" << + " and " << + "T2: {" << typeid(T2).name() << " | s: " << sizeof(T2) << "}" << + " does not match " << + "ExpectedType: {" << typeid(ExpectedType).name() << " | s: " << sizeof(ExpectedType) << "}"); } int test_main(int, char* []) @@ -49,11 +56,13 @@ int test_main(int, char* []) test<float, int, float>(); test<int, float, float>(); -#ifndef _MSC_VER - // This cannot be done for MSVC because double/long double is the same - test<double, long double, long double>(); - test<long double, double, long double>(); -#endif + if ( sizeof(long double) > sizeof(double) ) + { + // This cannot be done for MSVC because double/long double is the same + // This is also true for Android + test<double, long double, long double>(); + test<long double, double, long double>(); + } // with any other non-integer/float class test<int, user_defined, user_defined>(); |