Hi,
I’m working in the safe_float library and while working on it I defined a partial specialisation of numeric_limits for safe_float.
I wanted the safe_float<T> to mimic the T numeric_limits in most of the values and just change a few, but nothing complex, one liners only.
Then, I created a test for validating those methods/attributes mimicking the internal T are equal to those on T, as follows:
//types to be tested
using test_types=boost::mpl::list<
float, double, long double
;
using namespace boost::safe_float;
BOOST_AUTO_TEST_CASE_TEMPLATE( safe_float_numeric_limits_basic_fp_types, FPT, test_types){
BOOST_CHECK_EQUAL(std::numeric_limits::is_specialized, std::numeric_limits<FPT>::is_specialized);
}
The test does not even compile:
Undefined symbols for architecture x86_64:
"std::__1::numeric_limits >::is_specialized", referenced from:
safe_float_numeric_limits_suite::safe_float_numeric_limits_basic_fp_types<double>::test_method() in numeric_limits_test.o
After looking at the numeric_limits specialisation for a while, I tried changing the test as follows:
if (std::numeric_limits::is_specialized == std::numeric_limits<FPT>::is_specialized){
BOOST_CHECK(true);
} else {
BOOST_CHECK(false);
}
And as follows:
BOOST_CHECK(std::numeric_limits::is_specialized == std::numeric_limits<FPT>::is_specialized);
Both alternatives work.
Is there something wrong with BOOST_CHECK_EQUAL?
I’m using version 1.47.0
Best regards,
Damian