[libcxx] r334056 - Fix test failures after r334053.
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 5 17:13:49 PDT 2018
Author: ericwf
Date: Tue Jun 5 17:13:49 2018
New Revision: 334056
URL: http://llvm.org/viewvc/llvm-project?rev=334056&view=rev
Log:
Fix test failures after r334053.
Modified:
libcxx/trunk/test/std/containers/associative/map/map.cons/move.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
libcxx/trunk/test/std/containers/associative/set/set.cons/move.pass.cpp
libcxx/trunk/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp
libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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);
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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);
Modified: libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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);
Modified: libcxx/trunk/test/std/containers/associative/set/set.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/set/set.cons/move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/set/set.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/set/set.cons/move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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);
Modified: libcxx/trunk/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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> > >();
Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp?rev=334056&r1=334055&r2=334056&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp Tue Jun 5 17:13:49 2018
@@ -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};
More information about the cfe-commits
mailing list