[libcxx] r289359 - Fix copy/paste errors introduced in r289358

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 10 20:00:27 PST 2016


Author: ericwf
Date: Sat Dec 10 22:00:26 2016
New Revision: 289359

URL: http://llvm.org/viewvc/llvm-project?rev=289359&view=rev
Log:
Fix copy/paste errors introduced in r289358

Modified:
    libcxx/trunk/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.multimap/swap_member.pass.cpp

Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp?rev=289359&r1=289358&r2=289359&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp Sat Dec 10 22:00:26 2016
@@ -121,17 +121,17 @@ int main()
             V(11, 11),
             V(12, 12)
         };
-        M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
-        M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
+        M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
+        M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
         M m1_save = m1;
         M m2_save = m2;
         swap(m1, m2);
         assert(m1 == m2_save);
         assert(m2 == m1_save);
         assert(m1.key_comp() == C(2));
-        assert(m1.get_allocator() == A(1));
+        assert(m1.get_allocator().get_id() == 1);
         assert(m2.key_comp() == C(1));
-        assert(m2.get_allocator() == A(2));
+        assert(m2.get_allocator().get_id() == 2);
     }
     {
         typedef other_allocator<V> A;
@@ -155,17 +155,17 @@ int main()
             V(11, 11),
             V(12, 12)
         };
-        M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
-        M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
+        M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
+        M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
         M m1_save = m1;
         M m2_save = m2;
         swap(m1, m2);
         assert(m1 == m2_save);
         assert(m2 == m1_save);
         assert(m1.key_comp() == C(2));
-        assert(m1.get_allocator().get_id() == 1); // not swapped
+        assert(m1.get_allocator() == A(2));
         assert(m2.key_comp() == C(1));
-        assert(m2.get_allocator().get_id() == 2);
+        assert(m2.get_allocator() == A(1));
     }
 #if TEST_STD_VER >= 11
     {

Modified: libcxx/trunk/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/swap_member.pass.cpp?rev=289359&r1=289358&r2=289359&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/swap_member.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/swap_member.pass.cpp Sat Dec 10 22:00:26 2016
@@ -35,8 +35,8 @@ int main()
         typedef test_allocator<std::pair<const int, std::string> > Alloc;
         typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
         typedef std::pair<int, std::string> P;
-        C c1(0, Hash(1), Compare(1), Alloc(1));
-        C c2(0, Hash(2), Compare(2), Alloc(2));
+        C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+        C c2(0, Hash(2), Compare(2), Alloc(1, 2));
         c2.max_load_factor(2);
         c1.swap(c2);
 
@@ -75,8 +75,8 @@ int main()
             P(70, "seventy"),
             P(80, "eighty"),
         };
-        C c1(0, Hash(1), Compare(1), Alloc(1));
-        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
         c2.max_load_factor(2);
         c1.swap(c2);
 
@@ -121,8 +121,8 @@ int main()
             P(1, "four"),
             P(2, "four"),
         };
-        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
-        C c2(0, Hash(2), Compare(2), Alloc(2));
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+        C c2(0, Hash(2), Compare(2), Alloc(1, 2));
         c2.max_load_factor(2);
         c1.swap(c2);
 
@@ -176,8 +176,8 @@ int main()
             P(70, "seventy"),
             P(80, "eighty"),
         };
-        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
-        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
         c2.max_load_factor(2);
         c1.swap(c2);
 




More information about the cfe-commits mailing list