[libcxx] r272620 - Fix vector<bool> tests that were using ints. Patch from STL at microsoft.com

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 19:53:04 PDT 2016


Author: ericwf
Date: Mon Jun 13 21:53:04 2016
New Revision: 272620

URL: http://llvm.org/viewvc/llvm-project?rev=272620&view=rev
Log:
Fix vector<bool> tests that were using ints. Patch from STL at microsoft.com

Modified:
    libcxx/trunk/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/copy.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp?rev=272620&r1=272619&r2=272620&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp Mon Jun 13 21:53:04 2016
@@ -19,14 +19,14 @@
 int main()
 {
     {
-        std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
+        std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
         l2 = l;
         assert(l2 == l);
         assert(l2.get_allocator() == test_allocator<bool>(3));
     }
     {
-        std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
+        std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
         std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
         l2 = l;
         assert(l2 == l);
@@ -34,7 +34,7 @@ int main()
     }
 #if __cplusplus >= 201103L
     {
-        std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
+        std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
         std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
         l2 = l;
         assert(l2 == l);

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp?rev=272620&r1=272619&r2=272620&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp Mon Jun 13 21:53:04 2016
@@ -31,8 +31,8 @@ test(typename C::size_type n, const type
 
 int main()
 {
-    test<std::vector<bool> >(50, 3);
+    test<std::vector<bool> >(50, true);
 #if TEST_STD_VER >= 11
-    test<std::vector<bool, min_allocator<bool>> >(50, 3);
+    test<std::vector<bool, min_allocator<bool>> >(50, true);
 #endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp?rev=272620&r1=272619&r2=272620&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp Mon Jun 13 21:53:04 2016
@@ -33,8 +33,8 @@ test(typename C::size_type n, const type
 
 int main()
 {
-    test<std::vector<bool> >(50, 3, std::allocator<bool>());
+    test<std::vector<bool> >(50, true, std::allocator<bool>());
 #if TEST_STD_VER >= 11
-    test<std::vector<bool, min_allocator<bool>> >(50, 3, min_allocator<bool>());
+    test<std::vector<bool, min_allocator<bool>> >(50, true, min_allocator<bool>());
 #endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/copy.pass.cpp?rev=272620&r1=272619&r2=272620&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/copy.pass.cpp Mon Jun 13 21:53:04 2016
@@ -38,14 +38,14 @@ int main()
         test(std::vector<bool>(a, an));
     }
     {
-        std::vector<bool, test_allocator<bool> > v(3, 2, test_allocator<bool>(5));
+        std::vector<bool, test_allocator<bool> > v(3, true, test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > v2 = v;
         assert(v2 == v);
         assert(v2.get_allocator() == v.get_allocator());
     }
 #if TEST_STD_VER >= 11
     {
-        std::vector<bool, other_allocator<bool> > v(3, 2, other_allocator<bool>(5));
+        std::vector<bool, other_allocator<bool> > v(3, true, other_allocator<bool>(5));
         std::vector<bool, other_allocator<bool> > v2 = v;
         assert(v2 == v);
         assert(v2.get_allocator() == other_allocator<bool>(-2));
@@ -56,7 +56,7 @@ int main()
         test(std::vector<bool, min_allocator<bool>>(a, an));
     }
     {
-        std::vector<bool, min_allocator<bool> > v(3, 2, min_allocator<bool>());
+        std::vector<bool, min_allocator<bool> > v(3, true, min_allocator<bool>());
         std::vector<bool, min_allocator<bool> > v2 = v;
         assert(v2 == v);
         assert(v2.get_allocator() == v.get_allocator());

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp?rev=272620&r1=272619&r2=272620&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp Mon Jun 13 21:53:04 2016
@@ -32,30 +32,30 @@ test(const C& x, const typename C::alloc
 int main()
 {
     {
-        int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
-        int* an = a + sizeof(a)/sizeof(a[0]);
+        bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
+        bool* an = a + sizeof(a)/sizeof(a[0]);
         test(std::vector<bool>(a, an), std::allocator<bool>());
     }
     {
-        std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
+        std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
         assert(l2 == l);
         assert(l2.get_allocator() == test_allocator<bool>(3));
     }
     {
-        std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
+        std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
         std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
         assert(l2 == l);
         assert(l2.get_allocator() == other_allocator<bool>(3));
     }
 #if TEST_STD_VER >= 11
     {
-        int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
-        int* an = a + sizeof(a)/sizeof(a[0]);
+        bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
+        bool* an = a + sizeof(a)/sizeof(a[0]);
         test(std::vector<bool, min_allocator<bool>>(a, an), min_allocator<bool>());
     }
     {
-        std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
+        std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
         std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
         assert(l2 == l);
         assert(l2.get_allocator() == min_allocator<bool>());




More information about the cfe-commits mailing list