Fix test failures after r334053.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,7 +35,7 @@ int main()
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
@@ -65,7 +65,7 @@ int main()
|
||||
assert(*next(m.begin()) == V(2, 1));
|
||||
assert(*next(m.begin(), 2) == V(3, 1));
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
|
||||
@@ -35,7 +35,7 @@ int main()
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
@@ -71,7 +71,7 @@ int main()
|
||||
assert(*next(m.begin(), 7) == V(3, 1.5));
|
||||
assert(*next(m.begin(), 8) == V(3, 2));
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
|
||||
@@ -35,7 +35,7 @@ int main()
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
@@ -72,7 +72,7 @@ int main()
|
||||
assert(*next(m.begin(), 7) == 3);
|
||||
assert(*next(m.begin(), 8) == 3);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
|
||||
@@ -35,7 +35,7 @@ int main()
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
@@ -66,7 +66,7 @@ int main()
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
||||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// allocator shall not exit via an exception.
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <forward_list>
|
||||
#include <set>
|
||||
@@ -67,6 +68,14 @@ int main() {
|
||||
test<std::vector<bool, test_allocator<bool> > >();
|
||||
test<std::list<int, test_allocator<int> > >();
|
||||
test<std::forward_list<int, test_allocator<int> > >();
|
||||
|
||||
// libc++ stores two allocators in deque
|
||||
#ifdef _LIBCPP_VERSION
|
||||
int stored_allocators = 2;
|
||||
#else
|
||||
int stored_allocators = 1;
|
||||
#endif
|
||||
test<std::deque<int, test_allocator<int> > >(stored_allocators);
|
||||
}
|
||||
{ // test associative containers
|
||||
test<std::set<int, std::less<int>, test_allocator<int> > >();
|
||||
|
||||
@@ -32,10 +32,12 @@ int main()
|
||||
std::deque<MoveOnly, A> c2(A(2));
|
||||
for (int* p = ab; p < an; ++p)
|
||||
c2.push_back(MoveOnly(*p));
|
||||
A old_a = c1.get_allocator();
|
||||
std::deque<MoveOnly, A> c3 = std::move(c1);
|
||||
assert(c2 == c3);
|
||||
assert(c1.size() == 0);
|
||||
assert(c3.get_allocator() == c1.get_allocator());
|
||||
assert(c3.get_allocator() == old_a);
|
||||
assert(c1.get_allocator() == A(test_alloc_base::moved_value));
|
||||
}
|
||||
{
|
||||
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
|
||||
|
||||
Reference in New Issue
Block a user