forked from boostorg/container
Simplify redundant tested variants in functional tests.
Move explicit instantiations from functional tests to "explicit_inst_xxx".
This commit is contained in:
+10
-44
@@ -21,20 +21,6 @@
|
||||
|
||||
using namespace boost::container;
|
||||
|
||||
namespace boost {
|
||||
namespace container {
|
||||
|
||||
//Explicit instantiation to detect compilation errors
|
||||
template class boost::container::slist
|
||||
< test::movable_and_copyable_int
|
||||
, test::simple_allocator<test::movable_and_copyable_int> >;
|
||||
|
||||
template class boost::container::slist
|
||||
< test::movable_and_copyable_int
|
||||
, node_allocator<test::movable_and_copyable_int> >;
|
||||
|
||||
}}
|
||||
|
||||
class recursive_slist
|
||||
{
|
||||
public:
|
||||
@@ -65,28 +51,6 @@ struct GetAllocatorCont
|
||||
};
|
||||
};
|
||||
|
||||
template<class VoidAllocator>
|
||||
int test_cont_variants()
|
||||
{
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<int>::type MyCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::movable_int>::type MyMoveCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::movable_and_copyable_int>::type MyCopyMoveCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::copyable_int>::type MyCopyCont;
|
||||
|
||||
if(test::list_test<MyCont, false>())
|
||||
return 1;
|
||||
if(test::list_test<MyMoveCont, false>())
|
||||
return 1;
|
||||
if(test::list_test<MyCopyMoveCont, false>())
|
||||
return 1;
|
||||
if(test::list_test<MyCopyMoveCont, false>())
|
||||
return 1;
|
||||
if(test::list_test<MyCopyCont, false>())
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool test_support_for_initializer_list()
|
||||
{
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
@@ -201,16 +165,18 @@ int main ()
|
||||
////////////////////////////////////
|
||||
// Testing allocator implementations
|
||||
////////////////////////////////////
|
||||
// std:allocator
|
||||
if(test_cont_variants< std::allocator<void> >()){
|
||||
std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl;
|
||||
if (test::list_test<slist<int, std::allocator<int> >, false>())
|
||||
return 1;
|
||||
}
|
||||
// boost::container::node_allocator
|
||||
if(test_cont_variants< node_allocator<void> >()){
|
||||
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
|
||||
if (test::list_test<slist<int>, false>())
|
||||
return 1;
|
||||
if (test::list_test<slist<int, node_allocator<int> >, false>())
|
||||
return 1;
|
||||
if (test::list_test<slist<test::movable_int>, false>())
|
||||
return 1;
|
||||
if (test::list_test<slist<test::movable_and_copyable_int>, false>())
|
||||
return 1;
|
||||
if (test::list_test<slist<test::copyable_int>, false>())
|
||||
return 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// Emplace testing
|
||||
|
||||
Reference in New Issue
Block a user