/*============================================================================= Copyright (c) 2010 Tim Blechmann Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #define BOOST_TEST_MAIN #ifdef BOOST_HEAP_INCLUDE_TESTS #include #else #include #endif #include #include #include "common_heap_tests.hpp" #include "stable_heap_tests.hpp" #include "mutable_heap_tests.hpp" #include "merge_heap_tests.hpp" template void run_d_ary_heap_test(void) { typedef boost::heap::d_ary_heap, boost::heap::stable, boost::heap::compare >, boost::heap::allocator > > pri_queue; BOOST_CONCEPT_ASSERT((boost::heap::PriorityQueue)); run_concept_check(); run_common_heap_tests(); run_iterator_heap_tests(); run_copyable_heap_tests(); run_moveable_heap_tests(); run_reserve_heap_tests(); run_merge_tests(); run_ordered_iterator_tests(); if (stable) { typedef boost::heap::d_ary_heap, boost::heap::stable > stable_pri_queue; run_stable_heap_tests(); } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) cmpthings ord; boost::heap::d_ary_heap, boost::heap::compare, boost::heap::stable > vpq(ord); vpq.emplace(5, 6, 7); #endif } BOOST_AUTO_TEST_CASE( d_ary_heap_test ) { run_d_ary_heap_test<2, false>(); run_d_ary_heap_test<3, false>(); run_d_ary_heap_test<4, false>(); run_d_ary_heap_test<5, false>(); } BOOST_AUTO_TEST_CASE( d_ary_heap_stable_test ) { run_d_ary_heap_test<2, true>(); run_d_ary_heap_test<3, true>(); run_d_ary_heap_test<4, true>(); run_d_ary_heap_test<5, true>(); } template void run_d_ary_heap_mutable_test(void) { typedef boost::heap::d_ary_heap, boost::heap::arity, boost::heap::stable > pri_queue; BOOST_CONCEPT_ASSERT((boost::heap::MutablePriorityQueue)); run_common_heap_tests(); run_moveable_heap_tests(); run_reserve_heap_tests(); run_mutable_heap_tests(); run_merge_tests(); run_ordered_iterator_tests(); if (stable) { typedef boost::heap::d_ary_heap, boost::heap::arity, boost::heap::stable > stable_pri_queue; run_stable_heap_tests(); } } BOOST_AUTO_TEST_CASE( d_ary_heap_mutable_test ) { run_d_ary_heap_mutable_test<2, false>(); run_d_ary_heap_mutable_test<3, false>(); run_d_ary_heap_mutable_test<4, false>(); run_d_ary_heap_mutable_test<5, false>(); } BOOST_AUTO_TEST_CASE( d_ary_heap_mutable_stable_test ) { run_d_ary_heap_mutable_test<2, true>(); run_d_ary_heap_mutable_test<3, true>(); run_d_ary_heap_mutable_test<4, true>(); run_d_ary_heap_mutable_test<5, true>(); } BOOST_AUTO_TEST_CASE( d_ary_heap_compare_lookup_test ) { typedef boost::heap::d_ary_heap, boost::heap::compare, boost::heap::allocator > > pri_queue; run_common_heap_tests(); } BOOST_AUTO_TEST_CASE( d_ary_heap_leak_test ) { typedef boost::heap::d_ary_heap, boost::heap::arity<2> > pri_queue; run_leak_check_test(); }