summaryrefslogtreecommitdiff
path: root/test/std/iterators/iterator.container
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
commit51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch)
tree91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/iterators/iterator.container
parentbb5e33f003797b67974a8893f7f2930fc51b8210 (diff)
Notes
Diffstat (limited to 'test/std/iterators/iterator.container')
-rw-r--r--test/std/iterators/iterator.container/data.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/empty.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/size.pass.cpp10
3 files changed, 18 insertions, 12 deletions
diff --git a/test/std/iterators/iterator.container/data.pass.cpp b/test/std/iterators/iterator.container/data.pass.cpp
index 3d1fa33358db..a7a17480235a 100644
--- a/test/std/iterators/iterator.container/data.pass.cpp
+++ b/test/std/iterators/iterator.container/data.pass.cpp
@@ -13,7 +13,9 @@
// template <class T, size_t N> constexpr T* data(T (&array)[N]) noexcept; // C++17
// template <class E> constexpr const E* data(initializer_list<E> il) noexcept; // C++17
-#if __cplusplus <= 201402L
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
int main () {}
#else
@@ -40,7 +42,7 @@ void test_container( C& c )
{
assert ( std::data(c) == c.data());
}
-
+
template<typename T>
void test_container( std::initializer_list<T>& c)
{
@@ -58,7 +60,7 @@ int main()
std::vector<int> v; v.push_back(1);
std::array<int, 1> a; a[0] = 3;
std::initializer_list<int> il = { 4 };
-
+
test_container ( v );
test_container ( a );
test_container ( il );
@@ -66,7 +68,7 @@ int main()
test_const_container ( v );
test_const_container ( a );
test_const_container ( il );
-
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}
diff --git a/test/std/iterators/iterator.container/empty.pass.cpp b/test/std/iterators/iterator.container/empty.pass.cpp
index f26cb98e1aed..f9b8b94a89f9 100644
--- a/test/std/iterators/iterator.container/empty.pass.cpp
+++ b/test/std/iterators/iterator.container/empty.pass.cpp
@@ -12,7 +12,9 @@
// template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept; // C++17
// template <class E> constexpr bool empty(initializer_list<E> il) noexcept; // C++17
-#if __cplusplus <= 201402L
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
int main () {}
#else
@@ -40,7 +42,7 @@ void test_container( C& c )
{
assert ( std::empty(c) == c.empty());
}
-
+
template<typename T>
void test_container( std::initializer_list<T>& c )
{
@@ -59,7 +61,7 @@ int main()
std::list<int> l; l.push_back(2);
std::array<int, 1> a; a[0] = 3;
std::initializer_list<int> il = { 4 };
-
+
test_container ( v );
test_container ( l );
test_container ( a );
@@ -69,7 +71,7 @@ int main()
test_const_container ( l );
test_const_container ( a );
test_const_container ( il );
-
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}
diff --git a/test/std/iterators/iterator.container/size.pass.cpp b/test/std/iterators/iterator.container/size.pass.cpp
index 705fb40e1926..87b0ef897072 100644
--- a/test/std/iterators/iterator.container/size.pass.cpp
+++ b/test/std/iterators/iterator.container/size.pass.cpp
@@ -11,7 +11,9 @@
// template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17
// template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17
-#if __cplusplus <= 201402L
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
int main () {}
#else
@@ -39,7 +41,7 @@ void test_container( C& c)
{
assert ( std::size(c) == c.size());
}
-
+
template<typename T>
void test_container( std::initializer_list<T>& c )
{
@@ -58,7 +60,7 @@ int main()
std::list<int> l; l.push_back(2);
std::array<int, 1> a; a[0] = 3;
std::initializer_list<int> il = { 4 };
-
+
test_container ( v );
test_container ( l );
test_container ( a );
@@ -68,7 +70,7 @@ int main()
test_const_container ( l );
test_const_container ( a );
test_const_container ( il );
-
+
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
}