[libcxx] r179632 - I believe this finishes up debug mode for list. The testing is a little weak, but I believe all of the functionality is there. Certainly enough for people to checkout and start beating up on.

Howard Hinnant hhinnant at apple.com
Tue Apr 16 14:42:36 PDT 2013


Author: hhinnant
Date: Tue Apr 16 16:42:36 2013
New Revision: 179632

URL: http://llvm.org/viewvc/llvm-project?rev=179632&view=rev
Log:
I believe this finishes up debug mode for list.  The testing is a little weak, but I believe all of the functionality is there.  Certainly enough for people to checkout and start beating up on.

Modified:
    libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list.pass.cpp
    libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp
    libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp
    libcxx/trunk/www/debug_mode.html

Modified: libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list.pass.cpp?rev=179632&r1=179631&r2=179632&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list.pass.cpp Tue Apr 16 16:42:36 2013
@@ -11,6 +11,10 @@
 
 // void splice(const_iterator position, list& x);
 
+#if _LIBCPP_DEBUG2 >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
 #include <list>
 #include <cassert>
 
@@ -397,4 +401,12 @@ int main()
         ++i;
         assert(*i == 6);
     }
+#if _LIBCPP_DEBUG2 >= 1
+    {
+        std::list<int> v1(3);
+        std::list<int> v2(3);
+        v1.splice(v2.begin(), v2);
+        assert(false);
+    }
+#endif
 }

Modified: libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp?rev=179632&r1=179631&r2=179632&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp Tue Apr 16 16:42:36 2013
@@ -11,6 +11,10 @@
 
 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);
 
+#if _LIBCPP_DEBUG2 >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
 #include <list>
 #include <cassert>
 
@@ -174,4 +178,12 @@ int main()
         ++i;
         assert(*i == 2);
     }
+#if _LIBCPP_DEBUG2 >= 1
+    {
+        std::list<int> v1(3);
+        std::list<int> v2(3);
+        v1.splice(v1.begin(), v2, v1.begin());
+        assert(false);
+    }
+#endif
 }

Modified: libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp?rev=179632&r1=179631&r2=179632&view=diff
==============================================================================
--- libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp (original)
+++ libcxx/trunk/test/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp Tue Apr 16 16:42:36 2013
@@ -11,6 +11,10 @@
 
 // void splice(const_iterator position, list& x, iterator first, iterator last);
 
+#if _LIBCPP_DEBUG2 >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
 #include <list>
 #include <cassert>
 
@@ -114,4 +118,12 @@ int main()
         i = l2.begin();
         assert(*i == 4);
     }
+#if _LIBCPP_DEBUG2 >= 1
+    {
+        std::list<int> v1(3);
+        std::list<int> v2(3);
+        v1.splice(v1.begin(), v2, v2.begin(), v1.end());
+        assert(false);
+    }
+#endif
 }

Modified: libcxx/trunk/www/debug_mode.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/debug_mode.html?rev=179632&r1=179631&r2=179632&view=diff
==============================================================================
--- libcxx/trunk/www/debug_mode.html (original)
+++ libcxx/trunk/www/debug_mode.html Tue Apr 16 16:42:36 2013
@@ -32,7 +32,7 @@ record which parts of libc++ have debug
 <code><list></code>
 </p>
 </td>
-<td><!-- ✓ --></td>
+<td align="center"> ✓ </td>
 </tr>
 
 <tr>





More information about the cfe-commits mailing list