2006-03-19 22:24:06 +00:00
|
|
|
|
2009-03-09 20:56:23 +00:00
|
|
|
// Copyright 2006-2009 Daniel James.
|
2006-07-01 22:31:26 +00:00
|
|
|
// Distributed under 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)
|
2006-03-19 22:24:06 +00:00
|
|
|
|
|
|
|
// This test creates the containers with members that meet their minimum
|
|
|
|
// requirements. Makes sure everything compiles and is defined correctly.
|
|
|
|
|
2009-11-26 23:15:30 +00:00
|
|
|
#include "../helpers/prefix.hpp"
|
2006-03-19 22:24:06 +00:00
|
|
|
#include <boost/unordered_set.hpp>
|
2012-04-08 15:29:15 +00:00
|
|
|
#include "../helpers/postfix.hpp"
|
2006-03-19 22:24:06 +00:00
|
|
|
|
|
|
|
#include <iostream>
|
2008-03-24 17:03:15 +00:00
|
|
|
#include "../helpers/test.hpp"
|
2006-03-19 22:24:06 +00:00
|
|
|
#include "../objects/minimal.hpp"
|
|
|
|
#include "./compile_tests.hpp"
|
|
|
|
|
2008-06-15 17:03:37 +00:00
|
|
|
// Explicit instantiation to catch compile-time errors
|
2011-09-02 08:28:52 +00:00
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
template class boost::unordered_set<
|
|
|
|
int,
|
|
|
|
boost::hash<int>,
|
|
|
|
std::equal_to<int>,
|
|
|
|
test::minimal::allocator<int> >;
|
|
|
|
template class boost::unordered_multiset<
|
|
|
|
int,
|
|
|
|
boost::hash<int>,
|
|
|
|
std::equal_to<int>,
|
|
|
|
test::minimal::allocator<int> >;
|
2011-09-02 08:28:52 +00:00
|
|
|
|
2008-06-15 17:03:37 +00:00
|
|
|
template class boost::unordered_set<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> >;
|
|
|
|
template class boost::unordered_multiset<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> >;
|
|
|
|
|
2008-03-24 17:03:15 +00:00
|
|
|
UNORDERED_AUTO_TEST(test0)
|
2006-03-19 22:24:06 +00:00
|
|
|
{
|
2011-08-16 18:08:23 +00:00
|
|
|
test::minimal::constructor_param x;
|
|
|
|
|
|
|
|
test::minimal::assignable assignable(x);
|
2006-03-19 22:24:06 +00:00
|
|
|
|
|
|
|
std::cout<<"Test unordered_set.\n";
|
2011-08-11 21:17:57 +00:00
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
boost::unordered_set<int> int_set;
|
2011-08-11 21:17:57 +00:00
|
|
|
|
|
|
|
boost::unordered_set<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> int_set2;
|
|
|
|
|
2006-03-19 22:24:06 +00:00
|
|
|
boost::unordered_set<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> > set;
|
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
container_test(int_set, 0);
|
2011-08-11 21:17:57 +00:00
|
|
|
container_test(int_set2, 0);
|
2006-03-19 22:24:06 +00:00
|
|
|
container_test(set, assignable);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_multiset.\n";
|
2011-08-11 21:17:57 +00:00
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
boost::unordered_multiset<int> int_multiset;
|
2011-08-11 21:17:57 +00:00
|
|
|
|
|
|
|
boost::unordered_multiset<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> int_multiset2;
|
|
|
|
|
2006-03-19 22:24:06 +00:00
|
|
|
boost::unordered_multiset<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> > multiset;
|
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
container_test(int_multiset, 0);
|
2011-08-11 21:17:57 +00:00
|
|
|
container_test(int_multiset2, 0);
|
2006-03-19 22:24:06 +00:00
|
|
|
container_test(multiset, assignable);
|
2008-01-06 17:13:15 +00:00
|
|
|
}
|
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
UNORDERED_AUTO_TEST(equality_tests) {
|
2011-04-17 21:27:38 +00:00
|
|
|
typedef test::minimal::copy_constructible_equality_comparable value_type;
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
|
|
|
|
boost::unordered_set<int> int_set;
|
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
boost::unordered_set<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> int_set2;
|
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
boost::unordered_set<
|
2011-04-17 21:27:38 +00:00
|
|
|
test::minimal::copy_constructible_equality_comparable,
|
|
|
|
test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
|
|
|
|
test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
test::minimal::allocator<value_type> > set;
|
|
|
|
|
|
|
|
equality_test(int_set);
|
2011-08-11 21:17:57 +00:00
|
|
|
equality_test(int_set2);
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
equality_test(set);
|
|
|
|
|
|
|
|
boost::unordered_multiset<int> int_multiset;
|
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
boost::unordered_multiset<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> int_multiset2;
|
|
|
|
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
boost::unordered_multiset<
|
2011-04-17 21:27:38 +00:00
|
|
|
test::minimal::copy_constructible_equality_comparable,
|
|
|
|
test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
|
|
|
|
test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
test::minimal::allocator<value_type> > multiset;
|
|
|
|
|
|
|
|
equality_test(int_multiset);
|
2011-08-11 21:17:57 +00:00
|
|
|
equality_test(int_multiset2);
|
Merge in support for equality operators for the unordered containers and
hopefully better cross-platform support.
Merged revisions 44778-44835,44837-44918 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk
........
r44778 | danieljames | 2008-04-26 17:15:44 +0100 (Sat, 26 Apr 2008) | 2 lines
Remove a trailing comma.
........
r44779 | danieljames | 2008-04-26 17:23:51 +0100 (Sat, 26 Apr 2008) | 1 line
Merge in support for equality operators.
........
r44780 | danieljames | 2008-04-26 17:28:44 +0100 (Sat, 26 Apr 2008) | 1 line
Use my own list container to avoid working around STL container bugs.
........
r44833 | danieljames | 2008-04-28 08:03:43 +0100 (Mon, 28 Apr 2008) | 1 line
Better equality tests.
........
r44834 | danieljames | 2008-04-28 08:04:03 +0100 (Mon, 28 Apr 2008) | 1 line
Remove a superfluous check.
........
r44835 | danieljames | 2008-04-28 08:04:21 +0100 (Mon, 28 Apr 2008) | 1 line
Add equality reference documentation.
........
r44916 | danieljames | 2008-04-30 08:16:52 +0100 (Wed, 30 Apr 2008) | 1 line
New version of list.hpp
........
r44917 | danieljames | 2008-04-30 08:18:31 +0100 (Wed, 30 Apr 2008) | 1 line
Support compilers without ADL in the compile tests.
........
r44918 | danieljames | 2008-04-30 08:25:20 +0100 (Wed, 30 Apr 2008) | 7 lines
Change the typedef of buffered functions as it was confusing MSVC 6.5
get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).
........
[SVN r44919]
2008-04-30 07:57:04 +00:00
|
|
|
equality_test(multiset);
|
|
|
|
}
|
|
|
|
|
2008-03-24 17:03:15 +00:00
|
|
|
UNORDERED_AUTO_TEST(test1)
|
2008-01-06 17:13:15 +00:00
|
|
|
{
|
|
|
|
boost::hash<int> hash;
|
|
|
|
std::equal_to<int> equal_to;
|
|
|
|
int value = 0;
|
|
|
|
|
2011-10-05 19:45:14 +00:00
|
|
|
std::cout<<"Test unordered_set." << std::endl;
|
2008-01-06 17:13:15 +00:00
|
|
|
|
|
|
|
boost::unordered_set<int> set;
|
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
boost::unordered_set<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> set2;
|
|
|
|
|
2008-01-06 17:13:15 +00:00
|
|
|
unordered_unique_test(set, value);
|
|
|
|
unordered_set_test(set, value);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(set, value, value, hash, equal_to);
|
2008-01-06 17:13:15 +00:00
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
unordered_unique_test(set2, value);
|
|
|
|
unordered_set_test(set2, value);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(set2, value, value, hash, equal_to);
|
2011-08-11 21:17:57 +00:00
|
|
|
|
2011-10-05 19:45:14 +00:00
|
|
|
std::cout<<"Test unordered_multiset." << std::endl;
|
2008-01-06 17:13:15 +00:00
|
|
|
|
|
|
|
boost::unordered_multiset<int> multiset;
|
|
|
|
|
2011-08-11 21:17:57 +00:00
|
|
|
boost::unordered_multiset<int,
|
|
|
|
boost::hash<int>, std::equal_to<int>,
|
|
|
|
test::minimal::cxx11_allocator<int>
|
|
|
|
> multiset2;
|
|
|
|
|
2008-01-06 17:13:15 +00:00
|
|
|
unordered_equivalent_test(multiset, value);
|
|
|
|
unordered_set_test(multiset, value);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(multiset, value, value, hash, equal_to);
|
2011-08-11 21:17:57 +00:00
|
|
|
|
|
|
|
unordered_equivalent_test(multiset2, value);
|
|
|
|
unordered_set_test(multiset2, value);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(multiset2, value, value, hash, equal_to);
|
2008-01-06 17:13:15 +00:00
|
|
|
}
|
|
|
|
|
2008-03-24 17:03:15 +00:00
|
|
|
UNORDERED_AUTO_TEST(test2)
|
2008-01-06 17:13:15 +00:00
|
|
|
{
|
2011-08-16 18:08:23 +00:00
|
|
|
test::minimal::constructor_param x;
|
|
|
|
|
|
|
|
test::minimal::assignable assignable(x);
|
|
|
|
test::minimal::copy_constructible copy_constructible(x);
|
|
|
|
test::minimal::hash<test::minimal::assignable> hash(x);
|
|
|
|
test::minimal::equal_to<test::minimal::assignable> equal_to(x);
|
2008-01-06 17:13:15 +00:00
|
|
|
|
|
|
|
std::cout<<"Test unordered_set.\n";
|
|
|
|
|
|
|
|
boost::unordered_set<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> > set;
|
|
|
|
|
|
|
|
unordered_unique_test(set, assignable);
|
|
|
|
unordered_set_test(set, assignable);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(set, assignable, assignable, hash, equal_to);
|
2008-01-06 17:13:15 +00:00
|
|
|
|
|
|
|
std::cout<<"Test unordered_multiset.\n";
|
|
|
|
|
|
|
|
boost::unordered_multiset<
|
|
|
|
test::minimal::assignable,
|
|
|
|
test::minimal::hash<test::minimal::assignable>,
|
|
|
|
test::minimal::equal_to<test::minimal::assignable>,
|
|
|
|
test::minimal::allocator<test::minimal::assignable> > multiset;
|
|
|
|
|
|
|
|
unordered_equivalent_test(multiset, assignable);
|
|
|
|
unordered_set_test(multiset, assignable);
|
2011-08-16 22:17:11 +00:00
|
|
|
unordered_copyable_test(multiset, assignable, assignable, hash, equal_to);
|
|
|
|
}
|
|
|
|
|
|
|
|
UNORDERED_AUTO_TEST(movable1_tests)
|
|
|
|
{
|
|
|
|
test::minimal::constructor_param x;
|
|
|
|
|
|
|
|
test::minimal::movable1 movable1(x);
|
|
|
|
test::minimal::hash<test::minimal::movable1> hash(x);
|
|
|
|
test::minimal::equal_to<test::minimal::movable1> equal_to(x);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_set.\n";
|
|
|
|
|
|
|
|
boost::unordered_set<
|
|
|
|
test::minimal::movable1,
|
|
|
|
test::minimal::hash<test::minimal::movable1>,
|
|
|
|
test::minimal::equal_to<test::minimal::movable1>,
|
|
|
|
test::minimal::allocator<test::minimal::movable1> > set;
|
|
|
|
|
|
|
|
//unordered_unique_test(set, movable1);
|
|
|
|
unordered_set_test(set, movable1);
|
|
|
|
unordered_movable_test(set, movable1, movable1, hash, equal_to);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_multiset.\n";
|
|
|
|
|
|
|
|
boost::unordered_multiset<
|
|
|
|
test::minimal::movable1,
|
|
|
|
test::minimal::hash<test::minimal::movable1>,
|
|
|
|
test::minimal::equal_to<test::minimal::movable1>,
|
|
|
|
test::minimal::allocator<test::minimal::movable1> > multiset;
|
|
|
|
|
|
|
|
//unordered_equivalent_test(multiset, movable1);
|
|
|
|
unordered_set_test(multiset, movable1);
|
|
|
|
unordered_movable_test(multiset, movable1, movable1, hash, equal_to);
|
|
|
|
}
|
|
|
|
|
|
|
|
UNORDERED_AUTO_TEST(movable2_tests)
|
|
|
|
{
|
|
|
|
test::minimal::constructor_param x;
|
|
|
|
|
|
|
|
test::minimal::movable2 movable2(x);
|
|
|
|
test::minimal::hash<test::minimal::movable2> hash(x);
|
|
|
|
test::minimal::equal_to<test::minimal::movable2> equal_to(x);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_set.\n";
|
|
|
|
|
|
|
|
boost::unordered_set<
|
|
|
|
test::minimal::movable2,
|
|
|
|
test::minimal::hash<test::minimal::movable2>,
|
|
|
|
test::minimal::equal_to<test::minimal::movable2>,
|
|
|
|
test::minimal::allocator<test::minimal::movable2> > set;
|
|
|
|
|
|
|
|
//unordered_unique_test(set, movable2);
|
|
|
|
unordered_set_test(set, movable2);
|
|
|
|
unordered_movable_test(set, movable2, movable2, hash, equal_to);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_multiset.\n";
|
|
|
|
|
|
|
|
boost::unordered_multiset<
|
|
|
|
test::minimal::movable2,
|
|
|
|
test::minimal::hash<test::minimal::movable2>,
|
|
|
|
test::minimal::equal_to<test::minimal::movable2>,
|
|
|
|
test::minimal::allocator<test::minimal::movable2> > multiset;
|
|
|
|
|
|
|
|
//unordered_equivalent_test(multiset, movable2);
|
|
|
|
unordered_set_test(multiset, movable2);
|
|
|
|
unordered_movable_test(multiset, movable2, movable2, hash, equal_to);
|
2008-01-06 17:13:15 +00:00
|
|
|
}
|
|
|
|
|
2011-08-16 18:08:23 +00:00
|
|
|
UNORDERED_AUTO_TEST(destructible_tests)
|
|
|
|
{
|
|
|
|
test::minimal::constructor_param x;
|
|
|
|
|
|
|
|
test::minimal::destructible destructible(x);
|
|
|
|
test::minimal::hash<test::minimal::destructible> hash(x);
|
|
|
|
test::minimal::equal_to<test::minimal::destructible> equal_to(x);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_set.\n";
|
|
|
|
|
|
|
|
boost::unordered_set<
|
|
|
|
test::minimal::destructible,
|
|
|
|
test::minimal::hash<test::minimal::destructible>,
|
|
|
|
test::minimal::equal_to<test::minimal::destructible> > set;
|
|
|
|
|
|
|
|
unordered_destructible_test(set);
|
|
|
|
|
|
|
|
std::cout<<"Test unordered_multiset.\n";
|
|
|
|
|
|
|
|
boost::unordered_multiset<
|
|
|
|
test::minimal::destructible,
|
|
|
|
test::minimal::hash<test::minimal::destructible>,
|
|
|
|
test::minimal::equal_to<test::minimal::destructible> > multiset;
|
|
|
|
|
|
|
|
unordered_destructible_test(multiset);
|
|
|
|
}
|
|
|
|
|
2008-03-24 17:03:15 +00:00
|
|
|
RUN_TESTS()
|