Cleanup _LIBCPP_DEBUG tests in std::list. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Call back() on empty container.
|
// Call back() on empty container.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,11 +20,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
C c(1);
|
C c(1);
|
||||||
@@ -33,24 +29,4 @@ int main()
|
|||||||
c.clear();
|
c.clear();
|
||||||
assert(c.back() == 0);
|
assert(c.back() == 0);
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Call back() on empty const container.
|
// Call back() on empty const container.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,32 +20,11 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
const C c;
|
const C c;
|
||||||
assert(c.back() == 0);
|
assert(c.back() == 0);
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Call front() on empty const container.
|
// Call front() on empty const container.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,32 +20,11 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
const C c;
|
const C c;
|
||||||
assert(c.front() == 0);
|
assert(c.front() == 0);
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Call front() on empty container.
|
// Call front() on empty container.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,11 +20,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
C c(1);
|
C c(1);
|
||||||
@@ -33,24 +29,4 @@ int main()
|
|||||||
c.clear();
|
c.clear();
|
||||||
assert(c.front() == 0);
|
assert(c.front() == 0);
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Decrement iterator prior to begin.
|
// Decrement iterator prior to begin.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,11 +20,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
C c(1);
|
C c(1);
|
||||||
@@ -34,25 +30,4 @@ int main()
|
|||||||
assert(i == c.begin());
|
assert(i == c.begin());
|
||||||
--i;
|
--i;
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Increment iterator past end.
|
// Increment iterator past end.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,11 +20,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
C c(1);
|
C c(1);
|
||||||
@@ -34,25 +30,4 @@ int main()
|
|||||||
assert(i == c.end());
|
assert(i == c.end());
|
||||||
++i;
|
++i;
|
||||||
assert(false);
|
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
|
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
// Dereference non-dereferenceable iterator.
|
// Dereference non-dereferenceable iterator.
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,34 +20,12 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "min_allocator.h"
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef int T;
|
typedef int T;
|
||||||
typedef std::list<T> C;
|
typedef std::list<T> C;
|
||||||
C c(1);
|
C c(1);
|
||||||
C::iterator i = c.end();
|
C::iterator i = c.end();
|
||||||
T j = *i;
|
T j = *i;
|
||||||
assert(false);
|
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
|
|
||||||
@@ -7,13 +7,14 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
// UNSUPPORTED: libcpp-no-exceptions
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// Operations on "NULL" iterators
|
// Operations on "NULL" iterators
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
#define _LIBCPP_DEBUG 1
|
||||||
|
|
||||||
#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
|
#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -56,11 +57,3 @@ int main()
|
|||||||
assert(lib_asserts == 4);
|
assert(lib_asserts == 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -7,17 +7,17 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// template <class... Args> void emplace(const_iterator p, Args&&... args);
|
// 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 <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
class A
|
class A
|
||||||
@@ -37,7 +37,6 @@ public:
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<A> c;
|
std::list<A> c;
|
||||||
c.emplace(c.cbegin(), 2, 3.5);
|
c.emplace(c.cbegin(), 2, 3.5);
|
||||||
@@ -51,17 +50,6 @@ int main()
|
|||||||
assert(c.back().geti() == 3);
|
assert(c.back().geti() == 3);
|
||||||
assert(c.back().getd() == 4.5);
|
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;
|
std::list<A, min_allocator<A>> c;
|
||||||
c.emplace(c.cbegin(), 2, 3.5);
|
c.emplace(c.cbegin(), 2, 3.5);
|
||||||
@@ -75,14 +63,5 @@ int main()
|
|||||||
assert(c.back().geti() == 3);
|
assert(c.back().geti() == 3);
|
||||||
assert(c.back().getd() == 4.5);
|
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
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,12 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// iterator insert(const_iterator position, value_type&& x);
|
// 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 <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@@ -23,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly> l1;
|
std::list<MoveOnly> l1;
|
||||||
l1.insert(l1.cend(), MoveOnly(1));
|
l1.insert(l1.cend(), MoveOnly(1));
|
||||||
@@ -34,17 +31,6 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(2));
|
assert(l1.front() == MoveOnly(2));
|
||||||
assert(l1.back() == MoveOnly(1));
|
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;
|
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
||||||
l1.insert(l1.cend(), MoveOnly(1));
|
l1.insert(l1.cend(), MoveOnly(1));
|
||||||
@@ -55,14 +41,4 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(2));
|
assert(l1.front() == MoveOnly(2));
|
||||||
assert(l1.back() == MoveOnly(1));
|
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
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,10 @@
|
|||||||
|
|
||||||
// void pop_back();
|
// void pop_back();
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG >= 1
|
|
||||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@@ -31,10 +28,6 @@ int main()
|
|||||||
assert(c == std::list<int>(a, a+1));
|
assert(c == std::list<int>(a, a+1));
|
||||||
c.pop_back();
|
c.pop_back();
|
||||||
assert(c.empty());
|
assert(c.empty());
|
||||||
#if _LIBCPP_DEBUG >= 1
|
|
||||||
c.pop_back();
|
|
||||||
assert(false);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
@@ -46,10 +39,6 @@ int main()
|
|||||||
assert((c == std::list<int, min_allocator<int>>(a, a+1)));
|
assert((c == std::list<int, min_allocator<int>>(a, a+1)));
|
||||||
c.pop_back();
|
c.pop_back();
|
||||||
assert(c.empty());
|
assert(c.empty());
|
||||||
#if _LIBCPP_DEBUG >= 1
|
|
||||||
c.pop_back();
|
|
||||||
assert(false);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user