Remove tests that require C++03 to pass

This commit is contained in:
Peter Dimov
2019-11-06 03:09:54 +02:00
parent 8ec9323003
commit a7c28f6117
4 changed files with 12 additions and 7 deletions

View File

@@ -47,8 +47,8 @@ lib mixed_cxxstd : mixed_cxxstd.cpp : <link>shared:<define>MIXED_CXXSTD_DYN_LINK
run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>shared : mixed_cxxstd_shared ; run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>shared : mixed_cxxstd_shared ;
run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>static : mixed_cxxstd_static ; run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>static : mixed_cxxstd_static ;
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>shared : mixed_cxxstd_shared_98 ; #run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>shared : mixed_cxxstd_shared_98 ;
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>static : mixed_cxxstd_static_98 ; #run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>static : mixed_cxxstd_static_98 ;
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>shared : mixed_cxxstd_shared_0x ; run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>shared : mixed_cxxstd_shared_0x ;
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>static : mixed_cxxstd_static_0x ; run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>static : mixed_cxxstd_static_0x ;
@@ -63,8 +63,8 @@ lib return_function : return_function.cpp : <link>shared:<define>RETURN_FUNCTION
run test_return_function.cpp return_function : : : <link>shared : return_function_shared ; run test_return_function.cpp return_function : : : <link>shared : return_function_shared ;
run test_return_function.cpp return_function : : : <link>static : return_function_static ; run test_return_function.cpp return_function : : : <link>static : return_function_static ;
run test_return_function.cpp return_function/<cxxstd>98 : : : <link>shared : return_function_shared_98 ; #run test_return_function.cpp return_function/<cxxstd>98 : : : <link>shared : return_function_shared_98 ;
run test_return_function.cpp return_function/<cxxstd>98 : : : <link>static : return_function_static_98 ; #run test_return_function.cpp return_function/<cxxstd>98 : : : <link>static : return_function_static_98 ;
run test_return_function.cpp return_function/<cxxstd>0x : : : <link>shared : return_function_shared_0x ; run test_return_function.cpp return_function/<cxxstd>0x : : : <link>shared : return_function_shared_0x ;
run test_return_function.cpp return_function/<cxxstd>0x : : : <link>static : return_function_static_0x ; run test_return_function.cpp return_function/<cxxstd>0x : : : <link>static : return_function_static_0x ;

View File

@@ -79,8 +79,10 @@ int main()
function2<int, int, int> f; function2<int, int, int> f;
f.assign( plus_int<disable_small_object_optimization>(), counting_allocator<int>() ); f.assign( plus_int<disable_small_object_optimization>(), counting_allocator<int>() );
f.clear(); f.clear();
#if BOOST_FUNCTION_ENABLE_CXX03
BOOST_TEST_EQ( alloc_count, 1 ); BOOST_TEST_EQ( alloc_count, 1 );
BOOST_TEST_EQ( dealloc_count, 1 ); BOOST_TEST_EQ( dealloc_count, 1 );
#endif
alloc_count = 0; alloc_count = 0;
dealloc_count = 0; dealloc_count = 0;
f.assign( plus_int<enable_small_object_optimization>(), counting_allocator<int>() ); f.assign( plus_int<enable_small_object_optimization>(), counting_allocator<int>() );
@@ -106,8 +108,10 @@ int main()
dealloc_count = 0; dealloc_count = 0;
fv.assign( DoNothing<disable_small_object_optimization>(), counting_allocator<int>() ); fv.assign( DoNothing<disable_small_object_optimization>(), counting_allocator<int>() );
fv.clear(); fv.clear();
#if BOOST_FUNCTION_ENABLE_CXX03
BOOST_TEST_EQ( alloc_count, 1 ); BOOST_TEST_EQ( alloc_count, 1 );
BOOST_TEST_EQ( dealloc_count, 1 ); BOOST_TEST_EQ( dealloc_count, 1 );
#endif
alloc_count = 0; alloc_count = 0;
dealloc_count = 0; dealloc_count = 0;
fv.assign( DoNothing<enable_small_object_optimization>(), counting_allocator<int>() ); fv.assign( DoNothing<enable_small_object_optimization>(), counting_allocator<int>() );

View File

@@ -96,7 +96,7 @@ static void target_test()
BOOST_CHECK(!f.target<int (*)()>()); BOOST_CHECK(!f.target<int (*)()>());
BOOST_CHECK(f.target<const Seventeen>()); BOOST_CHECK(f.target<const Seventeen>());
BOOST_CHECK(f.target<const Seventeen>() == &const_seventeen); BOOST_CHECK(f.target<const Seventeen>() == &const_seventeen);
BOOST_CHECK(f.target<const volatile Seventeen>()); // BOOST_CHECK(f.target<const volatile Seventeen>());
BOOST_CHECK(!f.target<Seventeen>()); BOOST_CHECK(!f.target<Seventeen>());
BOOST_CHECK(!f.target<volatile Seventeen>()); BOOST_CHECK(!f.target<volatile Seventeen>());
} }

View File

@@ -9,6 +9,7 @@
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/core/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/config/workaround.hpp>
#include <functional> #include <functional>
#include <string> #include <string>
#include <utility> #include <utility>
@@ -653,14 +654,14 @@ static void test_empty_ref()
f2(); f2();
BOOST_ERROR("Exception didn't throw for reference to empty function."); BOOST_ERROR("Exception didn't throw for reference to empty function.");
} }
catch(std::runtime_error const&) {} catch(boost::bad_function_call const&) {}
f1 = dummy; f1 = dummy;
try { try {
f2(); f2();
} }
catch(std::runtime_error const&) { catch(boost::bad_function_call const&) {
BOOST_ERROR("Error calling referenced function."); BOOST_ERROR("Error calling referenced function.");
} }
} }