summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/support')
-rw-r--r--libcxx/test/support/allocators.h24
-rw-r--r--libcxx/test/support/min_allocator.h28
-rw-r--r--libcxx/test/support/test_allocator.h2
3 files changed, 30 insertions, 24 deletions
diff --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h
index 5372c073054..b7aba12e21f 100644
--- a/libcxx/test/support/allocators.h
+++ b/libcxx/test/support/allocators.h
@@ -13,6 +13,8 @@
#include <type_traits>
#include <utility>
+#include "test_macros.h"
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class T>
@@ -20,7 +22,7 @@ class A1
{
int id_;
public:
- explicit A1(int id = 0) : id_(id) {}
+ explicit A1(int id = 0) TEST_NOEXCEPT : id_(id) {}
typedef T value_type;
@@ -31,13 +33,13 @@ public:
static bool allocate_called;
static std::pair<T*, std::size_t> deallocate_called;
- A1(const A1& a) : id_(a.id()) {copy_called = true;}
- A1(A1&& a) : id_(a.id()) {move_called = true;}
+ A1(const A1& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
+ A1(A1&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
template <class U>
- A1(const A1<U>& a) : id_(a.id()) {copy_called = true;}
+ A1(const A1<U>& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
template <class U>
- A1(A1<U>&& a) : id_(a.id()) {move_called = true;}
+ A1(A1<U>&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
T* allocate(std::size_t n)
{
@@ -77,7 +79,7 @@ class A2
{
int id_;
public:
- explicit A2(int id = 0) : id_(id) {}
+ explicit A2(int id = 0) TEST_NOEXCEPT : id_(id) {}
typedef T value_type;
@@ -92,8 +94,8 @@ public:
static bool move_called;
static bool allocate_called;
- A2(const A2& a) : id_(a.id()) {copy_called = true;}
- A2(A2&& a) : id_(a.id()) {move_called = true;}
+ A2(const A2& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
+ A2(A2&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
T* allocate(std::size_t n, const void* hint)
{
@@ -125,7 +127,7 @@ class A3
{
int id_;
public:
- explicit A3(int id = 0) : id_(id) {}
+ explicit A3(int id = 0) TEST_NOEXCEPT : id_(id) {}
typedef T value_type;
@@ -139,8 +141,8 @@ public:
static bool constructed;
static bool destroy_called;
- A3(const A3& a) : id_(a.id()) {copy_called = true;}
- A3(A3&& a) : id_(a.id()) {move_called = true;}
+ A3(const A3& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
+ A3(A3&& a) TEST_NOEXCEPT: id_(a.id()) {move_called = true;}
template <class U, class ...Args>
void construct(U* p, Args&& ...args)
diff --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h
index b643636e178..5e3ae5d2a13 100644
--- a/libcxx/test/support/min_allocator.h
+++ b/libcxx/test/support/min_allocator.h
@@ -12,16 +12,18 @@
#include <cstddef>
+#include "test_macros.h"
+
template <class T>
class bare_allocator
{
public:
typedef T value_type;
- bare_allocator() {}
+ bare_allocator() TEST_NOEXCEPT {}
template <class U>
- bare_allocator(bare_allocator<U>) {}
+ bare_allocator(bare_allocator<U>) TEST_NOEXCEPT {}
T* allocate(std::size_t n)
{
@@ -53,10 +55,10 @@ class min_pointer<const void>
{
const void* ptr_;
public:
- min_pointer() noexcept = default;
- min_pointer(std::nullptr_t) : ptr_(nullptr) {}
+ min_pointer() TEST_NOEXCEPT = default;
+ min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {}
template <class T>
- min_pointer(min_pointer<T> p) : ptr_(p.ptr_) {}
+ min_pointer(min_pointer<T> p) TEST_NOEXCEPT : ptr_(p.ptr_) {}
explicit operator bool() const {return ptr_ != nullptr;}
@@ -70,15 +72,15 @@ class min_pointer<void>
{
void* ptr_;
public:
- min_pointer() noexcept = default;
- min_pointer(std::nullptr_t) : ptr_(nullptr) {}
+ min_pointer() TEST_NOEXCEPT = default;
+ min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {}
template <class T,
class = typename std::enable_if
<
!std::is_const<T>::value
>::type
>
- min_pointer(min_pointer<T> p) : ptr_(p.ptr_) {}
+ min_pointer(min_pointer<T> p) TEST_NOEXCEPT : ptr_(p.ptr_) {}
explicit operator bool() const {return ptr_ != nullptr;}
@@ -92,11 +94,11 @@ class min_pointer
{
T* ptr_;
- explicit min_pointer(T* p) : ptr_(p) {}
+ explicit min_pointer(T* p) TEST_NOEXCEPT : ptr_(p) {}
public:
- min_pointer() noexcept = default;
- min_pointer(std::nullptr_t) : ptr_(nullptr) {}
- explicit min_pointer(min_pointer<void> p) : ptr_(static_cast<T*>(p.ptr_)) {}
+ min_pointer() TEST_NOEXCEPT = default;
+ min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {}
+ explicit min_pointer(min_pointer<void> p) TEST_NOEXCEPT : ptr_(static_cast<T*>(p.ptr_)) {}
explicit operator bool() const {return ptr_ != nullptr;}
@@ -164,7 +166,7 @@ class min_pointer<const T>
explicit min_pointer(const T* p) : ptr_(p) {}
public:
- min_pointer() noexcept = default;
+ min_pointer() TEST_NOEXCEPT = default;
min_pointer(std::nullptr_t) : ptr_(nullptr) {}
min_pointer(min_pointer<T> p) : ptr_(p.ptr_) {}
explicit min_pointer(min_pointer<const void> p) : ptr_(static_cast<const T*>(p.ptr_)) {}
diff --git a/libcxx/test/support/test_allocator.h b/libcxx/test/support/test_allocator.h
index 683fac239f2..03bd3905606 100644
--- a/libcxx/test/support/test_allocator.h
+++ b/libcxx/test/support/test_allocator.h
@@ -17,6 +17,8 @@
#include <climits>
#include <cassert>
+#include "test_macros.h"
+
class test_alloc_base
{
protected:
OpenPOWER on IntegriCloud