[libcxx] r273393 - Cleanup _LIBCPP_DEBUG tests in std::list. More to come.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 01:01:28 PDT 2016


Author: ericwf
Date: Wed Jun 22 03:01:27 2016
New Revision: 273393

URL: http://llvm.org/viewvc/llvm-project?rev=273393&view=rev
Log:
Cleanup _LIBCPP_DEBUG tests in std::list. More to come.

Added:
    libcxx/trunk/test/libcxx/containers/sequences/list/db_back.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_cback.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_cfront.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_front.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
    libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
Removed:
    libcxx/trunk/test/std/containers/sequences/list/db_back.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_cback.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_cfront.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_front.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_iterators_6.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_iterators_7.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_iterators_8.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/db_iterators_9.pass.cpp
Modified:
    libcxx/trunk/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_back.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_back.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_back.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_back.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Call back() on empty container.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    C c(1);
+    assert(c.back() == 0);
+    c.clear();
+    assert(c.back() == 0);
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_cback.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_cback.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_cback.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_cback.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Call back() on empty const container.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    const C c;
+    assert(c.back() == 0);
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_cfront.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_cfront.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_cfront.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_cfront.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Call front() on empty const container.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    const C c;
+    assert(c.front() == 0);
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_front.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_front.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_front.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_front.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Call front() on empty container.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    C c(1);
+    assert(c.front() == 0);
+    c.clear();
+    assert(c.front() == 0);
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Decrement iterator prior to begin.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    --i;
+    assert(i == c.begin());
+    --i;
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Increment iterator past end.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Dereference non-dereferenceable iterator.
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    typedef int T;
+    typedef std::list<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    T j = *i;
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// UNSUPPORTED: libcpp-no-exceptions
+
+// <list>
+
+// Operations on "NULL" iterators
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
+
+#include <list>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+struct S { int val; };
+
+int main()
+{
+    {
+    unsigned lib_asserts;
+
+    typedef S T;
+    typedef std::list<T> C;
+    C::iterator i{};
+    C::const_iterator ci{};
+
+    lib_asserts = 0;
+    try { ++i; }  catch (int) { ++lib_asserts; }
+    try { i++; }  catch (int) { ++lib_asserts; }
+    try { ++ci; } catch (int) { ++lib_asserts; }
+    try { ci++; } catch (int) { ++lib_asserts; }
+    assert(lib_asserts == 4);
+
+    lib_asserts = 0;
+    try { --i; }  catch (int) { ++lib_asserts; }
+    try { i--; }  catch (int) { ++lib_asserts; }
+    try { --ci; } catch (int) { ++lib_asserts; }
+    try { ci--; } catch (int) { ++lib_asserts; }
+    assert(lib_asserts == 4);
+
+    lib_asserts = 0;
+    try { *i; }             catch (int) { ++lib_asserts; }
+    try { *ci; }            catch (int) { ++lib_asserts; }
+    try { (void)  i->val; } catch (int) { ++lib_asserts; }
+    try { (void) ci->val; } catch (int) { ++lib_asserts; }
+    assert(lib_asserts == 4);
+    }
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <list>
+
+// template <class... Args> void emplace(const_iterator p, Args&&... args);
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cstdlib>
+#include <cassert>
+
+class A
+{
+    int i_;
+    double d_;
+
+    A(const A&);
+    A& operator=(const A&);
+public:
+    A(int i, double d)
+        : i_(i), d_(d) {}
+
+    int geti() const {return i_;}
+    double getd() const {return d_;}
+};
+
+int main()
+{
+    std::list<A> c1;
+    std::list<A> c2;
+    std::list<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
+    assert(false);
+}

Added: libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// iterator insert(const_iterator position, value_type&& x);
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cstdlib>
+#include <cassert>
+
+int main()
+{
+    std::list<int> v1(3);
+    std::list<int> v2(3);
+    v1.insert(v2.begin(), 4);
+    assert(false);
+}
\ No newline at end of file

Added: libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp?rev=273393&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp Wed Jun 22 03:01:27 2016
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// void pop_back();
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <list>
+#include <cstdlib>
+#include <cassert>
+
+int main()
+{
+    int a[] = {1, 2, 3};
+    std::list<int> c(a, a+3);
+    c.pop_back();
+    assert(c == std::list<int>(a, a+2));
+    c.pop_back();
+    assert(c == std::list<int>(a, a+1));
+    c.pop_back();
+    assert(c.empty());
+    c.pop_back(); // operation under test
+    assert(false);
+}

Removed: libcxx/trunk/test/std/containers/sequences/list/db_back.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_back.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_back.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_back.pass.cpp (removed)
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call back() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    C c(1);
-    assert(c.back() == 0);
-    c.clear();
-    assert(c.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    C c(1);
-    assert(c.back() == 0);
-    c.clear();
-    assert(c.back() == 0);
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_cback.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_cback.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_cback.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_cback.pass.cpp (removed)
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call back() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    const C c;
-    assert(c.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    const C c;
-    assert(c.back() == 0);
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_cfront.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_cfront.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_cfront.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_cfront.pass.cpp (removed)
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call front() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    const C c;
-    assert(c.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    const C c;
-    assert(c.front() == 0);
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_front.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_front.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_front.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_front.pass.cpp (removed)
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call front() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    C c(1);
-    assert(c.front() == 0);
-    c.clear();
-    assert(c.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    C c(1);
-    assert(c.front() == 0);
-    c.clear();
-    assert(c.front() == 0);
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_iterators_6.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_iterators_6.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_iterators_6.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_iterators_6.pass.cpp (removed)
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Decrement iterator prior to begin.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_iterators_7.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_iterators_7.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_iterators_7.pass.cpp (removed)
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Increment iterator past end.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_iterators_8.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_iterators_8.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_iterators_8.pass.cpp (removed)
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Dereference non-dereferenceable iterator.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
-    {
-    typedef int T;
-    typedef std::list<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    T j = *i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::list<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    T j = *i;
-    assert(false);
-    }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Removed: libcxx/trunk/test/std/containers/sequences/list/db_iterators_9.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/db_iterators_9.pass.cpp?rev=273392&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/db_iterators_9.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/db_iterators_9.pass.cpp (removed)
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <list>
-
-// Operations on "NULL" iterators
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-struct S { int val; };
-
-int main()
-{
-    {
-    unsigned lib_asserts;
-
-    typedef S T;
-    typedef std::list<T> C;
-    C::iterator i{};
-    C::const_iterator ci{};
-
-    lib_asserts = 0;
-    try { ++i; }  catch (int) { ++lib_asserts; }
-    try { i++; }  catch (int) { ++lib_asserts; }
-    try { ++ci; } catch (int) { ++lib_asserts; }
-    try { ci++; } catch (int) { ++lib_asserts; }
-    assert(lib_asserts == 4);
-
-    lib_asserts = 0;
-    try { --i; }  catch (int) { ++lib_asserts; }
-    try { i--; }  catch (int) { ++lib_asserts; }
-    try { --ci; } catch (int) { ++lib_asserts; }
-    try { ci--; } catch (int) { ++lib_asserts; }
-    assert(lib_asserts == 4);
-
-    lib_asserts = 0;
-    try { *i; }             catch (int) { ++lib_asserts; }
-    try { *ci; }            catch (int) { ++lib_asserts; }
-    try { (void)  i->val; } catch (int) { ++lib_asserts; }
-    try { (void) ci->val; } catch (int) { ++lib_asserts; }
-    assert(lib_asserts == 4);
-    }
-}
-
-#else
-
-int main()
-{
-}
-
-#endif

Modified: libcxx/trunk/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp?rev=273393&r1=273392&r2=273393&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp Wed Jun 22 03:01:27 2016
@@ -7,17 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <list>
 
 // template <class... Args> void emplace(const_iterator p, Args&&... args);
 
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
 
 #include <list>
 #include <cassert>
 
+#include "test_macros.h"
 #include "min_allocator.h"
 
 class A
@@ -37,7 +37,6 @@ public:
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<A> c;
     c.emplace(c.cbegin(), 2, 3.5);
@@ -51,17 +50,6 @@ int main()
     assert(c.back().geti() == 3);
     assert(c.back().getd() == 4.5);
     }
-#if _LIBCPP_DEBUG >= 1
-    {
-        std::list<A> c1;
-        std::list<A> c2;
-        std::list<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
-        assert(false);
-    }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<A, min_allocator<A>> c;
     c.emplace(c.cbegin(), 2, 3.5);
@@ -75,14 +63,5 @@ int main()
     assert(c.back().geti() == 3);
     assert(c.back().getd() == 4.5);
     }
-#if _LIBCPP_DEBUG >= 1
-    {
-        std::list<A, min_allocator<A>> c1;
-        std::list<A, min_allocator<A>> c2;
-        std::list<A, min_allocator<A>>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
-        assert(false);
-    }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif
+
 }

Modified: libcxx/trunk/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp?rev=273393&r1=273392&r2=273393&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp Wed Jun 22 03:01:27 2016
@@ -7,14 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <list>
 
 // iterator insert(const_iterator position, value_type&& x);
 
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <list>
 #include <cassert>
 
@@ -23,7 +21,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<MoveOnly> l1;
     l1.insert(l1.cend(), MoveOnly(1));
@@ -34,17 +31,6 @@ int main()
     assert(l1.front() == MoveOnly(2));
     assert(l1.back() == MoveOnly(1));
     }
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
-    {
-        std::list<int> v1(3);
-        std::list<int> v2(3);
-        v1.insert(v2.begin(), 4);
-        assert(false);
-    }
-#endif
-#if TEST_STD_VER >= 11
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<MoveOnly, min_allocator<MoveOnly>> l1;
     l1.insert(l1.cend(), MoveOnly(1));
@@ -55,14 +41,4 @@ int main()
     assert(l1.front() == MoveOnly(2));
     assert(l1.back() == MoveOnly(1));
     }
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
-    {
-        std::list<int, min_allocator<int>> v1(3);
-        std::list<int, min_allocator<int>> v2(3);
-        v1.insert(v2.begin(), 4);
-        assert(false);
-    }
-#endif
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp?rev=273393&r1=273392&r2=273393&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp Wed Jun 22 03:01:27 2016
@@ -11,13 +11,10 @@
 
 // void pop_back();
 
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <list>
 #include <cassert>
 
+#include "test_macros.h"
 #include "min_allocator.h"
 
 int main()
@@ -31,10 +28,6 @@ int main()
     assert(c == std::list<int>(a, a+1));
     c.pop_back();
     assert(c.empty());
-#if _LIBCPP_DEBUG >= 1
-        c.pop_back();
-        assert(false);
-#endif
     }
 #if TEST_STD_VER >= 11
     {
@@ -46,10 +39,6 @@ int main()
     assert((c == std::list<int, min_allocator<int>>(a, a+1)));
     c.pop_back();
     assert(c.empty());
-#if _LIBCPP_DEBUG >= 1
-        c.pop_back();
-        assert(false);
-#endif
     }
 #endif
 }




More information about the cfe-commits mailing list