mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 22:14:28 +02:00
Stop using Boost.Assign in tests as it currently doesn't work on all the compilers I want to support. A pity, but I was already making very limited use of it because of older compilers.
[SVN r27917]
This commit is contained in:
@@ -9,7 +9,6 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/assign/list_inserter.hpp>
|
|
||||||
|
|
||||||
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||||
{
|
{
|
||||||
@@ -21,13 +20,15 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
|||||||
|
|
||||||
for(int i = 0; i < 5; ++i) {
|
for(int i = 0; i < 5; ++i) {
|
||||||
for(int j = 0; j < i; ++j)
|
for(int j = 0; j < i; ++j)
|
||||||
boost::assign::insert(containers[i])(0,0);
|
containers[i].insert(std::make_pair(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::assign::insert(containers[6])(1,0);
|
containers[6].insert(std::make_pair(1,0));
|
||||||
boost::assign::insert(containers[7])(1,0)(1,0);
|
containers[7].insert(std::make_pair(1,0));
|
||||||
boost::assign::insert(containers[8])(-1,1);
|
containers[7].insert(std::make_pair(1,0));
|
||||||
boost::assign::insert(containers[9])(-1,3)(-1,3);
|
containers[8].insert(std::make_pair(-1,1));
|
||||||
|
containers[9].insert(std::make_pair(-1,3));
|
||||||
|
containers[9].insert(std::make_pair(-1,3));
|
||||||
|
|
||||||
boost::hash<T> hasher;
|
boost::hash<T> hasher;
|
||||||
|
|
||||||
|
@@ -39,11 +39,12 @@ void numeric_test()
|
|||||||
|
|
||||||
// A hash function can legally fail these tests, but it'll not be a good
|
// A hash function can legally fail these tests, but it'll not be a good
|
||||||
// sign.
|
// sign.
|
||||||
BOOST_CHECK_EQUAL((T(1) != T(-1)), (x1(T(1)) != x2(T(-1))));
|
if(T(1) != T(-1))
|
||||||
BOOST_CHECK_EQUAL((T(1) != T(2)), (x1(T(1)) != x2(T(2))));
|
BOOST_CHECK(x1(T(1)) != x2(T(-1)));
|
||||||
BOOST_CHECK_EQUAL(
|
if(T(1) != T(2))
|
||||||
((limits::max)() != (limits::max)() - 1),
|
BOOST_CHECK(x1(T(1)) != x2(T(2)));
|
||||||
(x1((limits::max)()) != x2((limits::max)() - 1)));
|
if((limits::max)() != (limits::max)() - 1)
|
||||||
|
BOOST_CHECK(x1((limits::max)()) != x2((limits::max)() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUMERIC_TEST(type, name) \
|
#define NUMERIC_TEST(type, name) \
|
||||||
|
@@ -9,29 +9,30 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/assign/list_inserter.hpp>
|
|
||||||
|
|
||||||
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||||
{
|
{
|
||||||
template <class T>
|
template <class T>
|
||||||
void integer_tests(T* = 0)
|
void integer_tests(T* = 0)
|
||||||
{
|
{
|
||||||
using namespace boost::assign;
|
|
||||||
|
|
||||||
const int number_of_containers = 11;
|
const int number_of_containers = 11;
|
||||||
T containers[number_of_containers];
|
T containers[number_of_containers];
|
||||||
|
|
||||||
for(int i = 0; i < 5; ++i) {
|
for(int i = 0; i < 5; ++i) {
|
||||||
for(int j = 0; j < i; ++j)
|
for(int j = 0; j < i; ++j)
|
||||||
boost::assign::push_back(containers[i])(0);
|
containers[i].push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::assign::push_back(containers[5])(1);
|
containers[5].push_back(1);
|
||||||
boost::assign::push_back(containers[6])(1)(1);
|
containers[6].push_back(1);
|
||||||
boost::assign::push_back(containers[7])(-1);
|
containers[6].push_back(1);
|
||||||
boost::assign::push_back(containers[8])(-1)(-1);
|
containers[7].push_back(-1);
|
||||||
boost::assign::push_back(containers[9])(1)(-1);
|
containers[8].push_back(-1);
|
||||||
boost::assign::push_back(containers[10])(-1)(1);
|
containers[8].push_back(-1);
|
||||||
|
containers[9].push_back(1);
|
||||||
|
containers[9].push_back(-1);
|
||||||
|
containers[10].push_back(-1);
|
||||||
|
containers[10].push_back(1);
|
||||||
|
|
||||||
boost::hash<T> hasher;
|
boost::hash<T> hasher;
|
||||||
|
|
||||||
|
@@ -9,28 +9,28 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/assign/list_inserter.hpp>
|
|
||||||
|
|
||||||
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||||
{
|
{
|
||||||
template <class T>
|
template <class T>
|
||||||
void integer_tests(T* = 0)
|
void integer_tests(T* = 0)
|
||||||
{
|
{
|
||||||
using namespace boost::assign;
|
|
||||||
|
|
||||||
const int number_of_containers = 11;
|
const int number_of_containers = 11;
|
||||||
T containers[number_of_containers];
|
T containers[number_of_containers];
|
||||||
|
|
||||||
for(int i = 0; i < 5; ++i) {
|
for(int i = 0; i < 5; ++i) {
|
||||||
for(int j = 0; j < i; ++j)
|
for(int j = 0; j < i; ++j)
|
||||||
boost::assign::insert(containers[i])(0);
|
containers[i].insert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::assign::insert(containers[6])(1);
|
containers[6].insert(1);
|
||||||
boost::assign::insert(containers[7])(1)(1);
|
containers[7].insert(1);
|
||||||
boost::assign::insert(containers[8])(-1);
|
containers[7].insert(1);
|
||||||
boost::assign::insert(containers[9])(-1)(-1);
|
containers[8].insert(-1);
|
||||||
boost::assign::insert(containers[10])(-1)(1);
|
containers[9].insert(-1);
|
||||||
|
containers[9].insert(-1);
|
||||||
|
containers[10].insert(-1);
|
||||||
|
containers[10].insert(1);
|
||||||
|
|
||||||
boost::hash<T> hasher;
|
boost::hash<T> hasher;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user