From 0e78687e7d2179b2bee015f327973ef2c9765f31 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 20 Aug 2014 18:15:30 +0100 Subject: [PATCH] Fix test case: * Don't test incomplete types. * Use new BOOST_NO_CXX11_FINAL macro for checks. * Use soft checks when no compiler support is present. --- test/is_final_test.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/is_final_test.cpp b/test/is_final_test.cpp index 0bb46c2..40ad226 100644 --- a/test/is_final_test.cpp +++ b/test/is_final_test.cpp @@ -30,9 +30,18 @@ TT_TEST_BEGIN(is_final) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); -#if defined(BOOST_HAS_TYPE_TRAITS_INTRINSICS) +#if !defined(BOOST_NO_CXX11_FINAL) + // + // These are "soft" checks: since we cannot implement this trait + // ourselves and instead rely on the compiler. + // +# ifndef BOOST_IS_FINAL + BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_final::value, true, false); + BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_final::value, true, false); +# else BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, true); +# endif #else std::cout << "\n\n" @@ -58,7 +67,6 @@ TT_TEST_BEGIN(is_final) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); - BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_final::value, false); TT_TEST_END