mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 05:54:28 +02:00
Use algo_equal to reduce test dependencies
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "check_equal_containers.hpp"
|
||||
#include "movable_int.hpp"
|
||||
|
||||
#include <boost/algorithm/cxx14/equal.hpp>
|
||||
#include <boost/container/detail/algorithm.hpp> //algo_equal(), algo_lexicographical_compare
|
||||
|
||||
#define BOOST_CONTAINER_DEVECTOR_ALLOC_STATS
|
||||
#include <boost/container/devector.hpp>
|
||||
@@ -1136,17 +1136,17 @@ template <class Devector> void test_begin_end()
|
||||
{
|
||||
Devector actual; get_range<Devector>(10, actual);
|
||||
|
||||
BOOST_TEST(boost::algorithm::equal(expected.begin(), expected.end(), actual.begin(), actual.end()));
|
||||
BOOST_TEST(boost::algorithm::equal(expected.rbegin(), expected.rend(), actual.rbegin(), actual.rend()));
|
||||
BOOST_TEST(boost::algorithm::equal(expected.cbegin(), expected.cend(), actual.cbegin(), actual.cend()));
|
||||
BOOST_TEST(boost::algorithm::equal(expected.crbegin(), expected.crend(), actual.crbegin(), actual.crend()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.begin(), expected.end(), actual.begin(), actual.end()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.rbegin(), expected.rend(), actual.rbegin(), actual.rend()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.cbegin(), expected.cend(), actual.cbegin(), actual.cend()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.crbegin(), expected.crend(), actual.crbegin(), actual.crend()));
|
||||
}
|
||||
|
||||
{
|
||||
Devector cactual; get_range<Devector>(10, cactual);
|
||||
|
||||
BOOST_TEST(boost::algorithm::equal(expected.begin(), expected.end(), cactual.begin(), cactual.end()));
|
||||
BOOST_TEST(boost::algorithm::equal(expected.rbegin(), expected.rend(), cactual.rbegin(), cactual.rend()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.begin(), expected.end(), cactual.begin(), cactual.end()));
|
||||
BOOST_TEST(::boost::container::algo_equal(expected.rbegin(), expected.rend(), cactual.rbegin(), cactual.rend()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#define BOOST_CONTAINER_TEST_TEST_UTIL_HPP
|
||||
|
||||
#include "test_elem.hpp"
|
||||
#include <boost/container/detail/algorithm.hpp> //algo_equal(), algo_lexicographical_compare
|
||||
|
||||
// get_range
|
||||
|
||||
@@ -86,8 +87,7 @@ void print_range(std::ostream& out, Array (&range)[N])
|
||||
template <typename C1, typename C2, unsigned N>
|
||||
void test_equal_range(const C1& a, const C2 (&b)[N])
|
||||
{
|
||||
bool equals = boost::algorithm::equal
|
||||
(a.begin(), a.end(), b, b+N);
|
||||
bool equals = ::boost::container::algo_equal(a.begin(), a.end(), b, b+N);
|
||||
|
||||
BOOST_TEST(equals);
|
||||
|
||||
@@ -104,7 +104,7 @@ void test_equal_range(const C1& a, const C2 (&b)[N])
|
||||
template <typename C1, typename C2>
|
||||
void test_equal_range(const C1& a, const C2&b)
|
||||
{
|
||||
bool equals = boost::algorithm::equal
|
||||
bool equals = boost::container::algo_equal
|
||||
(a.begin(), a.end(), b.begin(), b.end());
|
||||
|
||||
BOOST_TEST(equals);
|
||||
|
Reference in New Issue
Block a user