diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-06-22 08:01:27 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-06-22 08:01:27 +0000 |
commit | 3624fedb688eeb9e431f33b06f3b03a1b8c6bd31 (patch) | |
tree | 4a150f394ed07fb0daf4c41d3fb6c21a668e603c /libcxx/test/std/containers | |
parent | e357c0ad3b23900d7ba24a9688ee073c46f467ed (diff) | |
download | bcm5719-llvm-3624fedb688eeb9e431f33b06f3b03a1b8c6bd31.tar.gz bcm5719-llvm-3624fedb688eeb9e431f33b06f3b03a1b8c6bd31.zip |
Cleanup _LIBCPP_DEBUG tests in std::list. More to come.
llvm-svn: 273393
Diffstat (limited to 'libcxx/test/std/containers')
11 files changed, 7 insertions, 515 deletions
diff --git a/libcxx/test/std/containers/sequences/list/db_back.pass.cpp b/libcxx/test/std/containers/sequences/list/db_back.pass.cpp deleted file mode 100644 index a72aa319406..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_back.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_cback.pass.cpp b/libcxx/test/std/containers/sequences/list/db_cback.pass.cpp deleted file mode 100644 index b3596f39a38..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_cback.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_cfront.pass.cpp b/libcxx/test/std/containers/sequences/list/db_cfront.pass.cpp deleted file mode 100644 index 2aa866bed6e..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_cfront.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_front.pass.cpp b/libcxx/test/std/containers/sequences/list/db_front.pass.cpp deleted file mode 100644 index 560e49c5e20..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_front.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_iterators_6.pass.cpp b/libcxx/test/std/containers/sequences/list/db_iterators_6.pass.cpp deleted file mode 100644 index a97279d4358..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_iterators_6.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_iterators_7.pass.cpp b/libcxx/test/std/containers/sequences/list/db_iterators_7.pass.cpp deleted file mode 100644 index 0f653f01403..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_iterators_7.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_iterators_8.pass.cpp b/libcxx/test/std/containers/sequences/list/db_iterators_8.pass.cpp deleted file mode 100644 index bec473cc49f..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_iterators_8.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/db_iterators_9.pass.cpp b/libcxx/test/std/containers/sequences/list/db_iterators_9.pass.cpp deleted file mode 100644 index 4e3abf335ce..00000000000 --- a/libcxx/test/std/containers/sequences/list/db_iterators_9.pass.cpp +++ /dev/null @@ -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 diff --git a/libcxx/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp index f3d2b86e723..e8d46941252 100644 --- a/libcxx/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp @@ -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 + } diff --git a/libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp index c4fd129d95b..5d579fcd202 100644 --- a/libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp @@ -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 } diff --git a/libcxx/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp b/libcxx/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp index 3eadbb43e9d..c5b0277c6ef 100644 --- a/libcxx/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp @@ -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 } |