Attempt to workaround VACPP, CRAY and ancient GCC bugs in lexical_cast tests

[SVN r81162]
This commit is contained in:
Antony Polukhin
2012-11-03 16:20:43 +00:00
parent c484325310
commit 5c3159cd1c
4 changed files with 19 additions and 1 deletions

View File

@@ -243,9 +243,15 @@ void test_conversion_to_bool()
BOOST_CHECK_EQUAL(false, lexical_cast<bool>(0));
BOOST_CHECK_THROW(lexical_cast<bool>(123), bad_lexical_cast);
BOOST_CHECK_EQUAL(true, lexical_cast<bool>(1.0));
BOOST_CHECK_THROW(lexical_cast<bool>(-123), bad_lexical_cast);
BOOST_CHECK_EQUAL(false, lexical_cast<bool>(0.0));
BOOST_CHECK_THROW(lexical_cast<bool>(1234), bad_lexical_cast);
#if !defined(_CRAYC)
// Looks like a bug in CRAY compiler (throws bad_lexical_cast)
// TODO: localize the bug and report it to developers.
BOOST_CHECK_EQUAL(true, lexical_cast<bool>(true));
BOOST_CHECK_EQUAL(false, lexical_cast<bool>(false));
#endif
BOOST_CHECK_EQUAL(true, lexical_cast<bool>("1"));
BOOST_CHECK_EQUAL(false, lexical_cast<bool>("0"));
BOOST_CHECK_THROW(lexical_cast<bool>(""), bad_lexical_cast);
@@ -602,7 +608,7 @@ void test_char32_conversions()
#endif
template <class To, class From, class Func>
To try_cast_by_ptr(const From& from, const Func& f) {
To try_cast_by_ptr(const From& from, Func f) {
return f(from);
};

View File

@@ -505,7 +505,11 @@ void test_conversion_from_to_double()
}
void test_conversion_from_to_long_double()
{
// We do not run tests on compilers with bugs
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
test_conversion_from_to_float<long double>();
#endif
BOOST_CHECK(true);
}

View File

@@ -186,7 +186,11 @@ void test_inf_nan_double()
void test_inf_nan_long_double()
{
// We do not run tests on compilers with bugs
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
test_inf_nan_templated<long double >();
#endif
BOOST_CHECK(true);
}
unit_test::test_suite *init_unit_test_suite(int, char *[])

View File

@@ -86,7 +86,11 @@ void test_round_conversion_double()
void test_round_conversion_long_double()
{
// We do not run tests on compilers with bugs
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
test_round_conversion<long double>();
test_msvc_magic_values<long double>();
#endif
BOOST_CHECK(true);
}