diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
commit | 1a78a62555be32868418fe52f8e330c9d0f95d5a (patch) | |
tree | d3765a80e7d3b9640ec2e930743630cd6b9fce2b /libs/heap/test/pairing_heap_tests.cpp | |
download | boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2 boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip |
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'libs/heap/test/pairing_heap_tests.cpp')
-rw-r--r-- | libs/heap/test/pairing_heap_tests.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libs/heap/test/pairing_heap_tests.cpp b/libs/heap/test/pairing_heap_tests.cpp new file mode 100644 index 0000000000..bb7132d0df --- /dev/null +++ b/libs/heap/test/pairing_heap_tests.cpp @@ -0,0 +1,49 @@ +#define BOOST_TEST_MAIN +#include <boost/test/unit_test.hpp> + +#include <algorithm> + +#include <boost/heap/pairing_heap.hpp> + +#include "common_heap_tests.hpp" +#include "stable_heap_tests.hpp" +#include "mutable_heap_tests.hpp" +#include "merge_heap_tests.hpp" + +template <bool stable, bool constant_time_size> +void run_pairing_heap_test(void) +{ + typedef boost::heap::pairing_heap<int, boost::heap::stable<stable>, + boost::heap::compare<std::less<int> >, + boost::heap::allocator<std::allocator<int> >, + boost::heap::constant_time_size<constant_time_size> > pri_queue; + + BOOST_CONCEPT_ASSERT((boost::heap::MutablePriorityQueue<pri_queue>)); + BOOST_CONCEPT_ASSERT((boost::heap::MergablePriorityQueue<pri_queue>)); + + run_common_heap_tests<pri_queue>(); + run_iterator_heap_tests<pri_queue>(); + run_copyable_heap_tests<pri_queue>(); + run_moveable_heap_tests<pri_queue>(); + + run_merge_tests<pri_queue>(); + + run_mutable_heap_tests<pri_queue >(); + + run_ordered_iterator_tests<pri_queue>(); + + if (stable) { + typedef boost::heap::pairing_heap<q_tester, boost::heap::stable<stable>, + boost::heap::constant_time_size<constant_time_size> + > stable_pri_queue; + run_stable_heap_tests<stable_pri_queue>(); + } +} + +BOOST_AUTO_TEST_CASE( pairing_heap_test ) +{ + run_pairing_heap_test<false, false>(); + run_pairing_heap_test<false, true>(); + run_pairing_heap_test<true, false>(); + run_pairing_heap_test<true, true>(); +} |