2017-03-07 10:26:24 -05:00
|
|
|
#ifndef UNIT_TESTS_RANGE_TOOLS_HPP
|
|
|
|
#define UNIT_TESTS_RANGE_TOOLS_HPP
|
|
|
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
2022-06-30 09:32:12 -04:00
|
|
|
#define REQUIRE_SIZE_RANGE(range, ref) BOOST_REQUIRE_EQUAL((range).size(), ref)
|
2017-03-07 10:26:24 -05:00
|
|
|
#define CHECK_EQUAL_RANGE(range, ...) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
const auto &lhs = range; \
|
|
|
|
const auto &rhs = {__VA_ARGS__}; \
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); \
|
|
|
|
} while (0)
|
2020-11-14 13:02:56 -05:00
|
|
|
#define CHECK_EQUAL_COLLECTIONS(coll_lhs, coll_rhs) \
|
2017-03-07 10:26:24 -05:00
|
|
|
do \
|
|
|
|
{ \
|
2020-11-14 13:02:56 -05:00
|
|
|
const auto &lhs = coll_lhs; \
|
|
|
|
const auto &rhs = coll_rhs; \
|
2017-03-07 10:26:24 -05:00
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#endif // UNIT_TESTS_RANGE_TOOLS_HPP
|