diff options
Diffstat (limited to 'test/libcxx/experimental/containers/sequences/dynarray')
11 files changed, 52 insertions, 76 deletions
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp index d274bc030881e..c6a83cc61bdcb 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.cons // template <class Alloc> @@ -20,10 +21,8 @@ // ~dynarray(); - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -44,7 +43,7 @@ void check_allocator ( const dynarray<T> &dyn, const Allocator &alloc ) { template <class T, class Allocator> void test ( const std::initializer_list<T> &vals, const Allocator &alloc ) { typedef dynarray<T> dynA; - + dynA d1 ( vals, alloc ); assert ( d1.size () == vals.size() ); assert ( std::equal ( vals.begin (), vals.end (), d1.begin (), d1.end ())); @@ -55,7 +54,7 @@ void test ( const std::initializer_list<T> &vals, const Allocator &alloc ) { template <class T, class Allocator> void test ( const T &val, const Allocator &alloc1, const Allocator &alloc2 ) { typedef dynarray<T> dynA; - + dynA d1 ( 4, alloc1 ); assert ( d1.size () == 4 ); assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } )); @@ -68,19 +67,17 @@ void test ( const T &val, const Allocator &alloc1, const Allocator &alloc2 ) { dynA d3 ( d2, alloc2 ); assert ( d3.size () == 7 ); - assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } )); + assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } )); check_allocator ( d3, alloc2 ); } int main() { -// This test is waiting on the resolution of LWG issue #2235 +// This test is waiting on the resolution of LWG issue #2235 // typedef test_allocator<char> Alloc; // typedef std::basic_string<char, std::char_traits<char>, Alloc> nstr; -// +// // test ( nstr("fourteen"), Alloc(3), Alloc(4) ); // test ( { nstr("1"), nstr("1"), nstr("2"), nstr("3"), nstr("5"), nstr("8")}, Alloc(6)); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp index 738c0c72592e3..cd5c56c7ac51a 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp @@ -35,7 +35,7 @@ using std::experimental::dynarray; template <class T> void testInitList( const std::initializer_list<T> &vals ) { typedef dynarray<T> dynA; - + dynA d1 ( vals ); assert ( d1.size () == vals.size() ); assert ( std::equal ( vals.begin (), vals.end (), d1.begin (), d1.end ())); @@ -45,7 +45,7 @@ void testInitList( const std::initializer_list<T> &vals ) { template <class T> void test ( const T &val, bool DefaultValueIsIndeterminate = false) { typedef dynarray<T> dynA; - + dynA d1 ( 4 ); assert ( d1.size () == 4 ); if (!DefaultValueIsIndeterminate) { @@ -58,7 +58,7 @@ void test ( const T &val, bool DefaultValueIsIndeterminate = false) { dynA d3 ( d2 ); assert ( d3.size () == 7 ); - assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } )); + assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } )); } void test_bad_length () { @@ -76,12 +76,12 @@ int main() test<double> ( 14.0, true ); test<std::complex<double>> ( std::complex<double> ( 14, 0 )); test<std::string> ( "fourteen" ); - + testInitList( { 1, 1, 2, 3, 5, 8 } ); testInitList( { 1., 1., 2., 3., 5., 8. } ); testInitList( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), std::string("5"), std::string("8")} ); - + // Make sure we don't pick up the Allocator version here dynarray<long> d1 ( 20, 3 ); assert ( d1.size() == 20 ); diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp index 1bbd8cde92fe1..84c602925cb49 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp @@ -42,7 +42,7 @@ void dyn_test( dynarray<T> &dyn, bool CheckEquals = true) { } } - + template <class T> void test(const T &val, bool DefaultValueIsIndeterminate = false) { @@ -53,7 +53,7 @@ void test(const T &val, bool DefaultValueIsIndeterminate = false) { dynA d1(4); dyn_test(d1, CheckDefaultValues); dyn_test_const(d1, CheckDefaultValues); - + dynA d2 (7, val); dyn_test ( d2 ); dyn_test_const ( d2 ); diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp index c57887ddaf94c..376c94a6bcd8d 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp @@ -7,15 +7,14 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.data // void fill(const T& v); // const T* data() const noexcept; - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -29,11 +28,11 @@ using std::experimental::dynarray; template <class T> void test ( const T &val ) { typedef dynarray<T> dynA; - + dynA d1 ( 4 ); d1.fill ( val ); - assert ( std::all_of ( d1.begin (), d1.end (), - [&val]( const T &item ){ return item == val; } )); + assert ( std::all_of ( d1.begin (), d1.end (), + [&val]( const T &item ){ return item == val; } )); } int main() @@ -43,6 +42,4 @@ int main() test<std::complex<double>> ( std::complex<double> ( 14, 0 )); test<std::string> ( "fourteen" ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp index 8c0d085387166..a6825b68d0f17 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp @@ -7,15 +7,14 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // dynarray.overview // const_reference at(size_type n) const; // reference at(size_type n); - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -73,7 +72,7 @@ void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) { template <class T> void test ( std::initializer_list<T> vals ) { typedef dynarray<T> dynA; - + dynA d1 ( vals ); dyn_test ( d1, vals ); dyn_test_const ( d1, vals ); @@ -83,13 +82,11 @@ int main() { test ( { 1, 1, 2, 3, 5, 8 } ); test ( { 1., 1., 2., 3., 5., 8. } ); - test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), + test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), std::string("5"), std::string("8")} ); test<int> ( {} ); test<std::complex<double>> ( {} ); test<std::string> ( {} ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp index 695e1aa9f14ae..fe425b7e8c185 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.overview @@ -16,7 +17,7 @@ // iterator end() noexcept; // const_iterator end() const noexcept; // const_iterator cend() const noexcept; -// +// // reverse_iterator rbegin() noexcept; // const_reverse_iterator rbegin() const noexcept; // const_reverse_iterator crbegin() const noexcept; @@ -24,10 +25,8 @@ // const_reverse_iterator rend() const noexcept; // const_reverse_iterator crend() const noexcept; - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -86,11 +85,11 @@ void dyn_test ( dynarray<T> &dyn ) { template <class T> void test ( const T &val ) { typedef dynarray<T> dynA; - + dynA d1 ( 4 ); dyn_test ( d1 ); dyn_test_const ( d1 ); - + dynA d2 ( 7, val ); dyn_test ( d2 ); dyn_test_const ( d2 ); @@ -103,6 +102,4 @@ int main() test<std::complex<double>> ( std::complex<double> ( 14, 0 )); test<std::string> ( "fourteen" ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp index 6d28eef1b0578..95262aab1bdcc 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp @@ -7,16 +7,15 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.overview // size_type size() const noexcept; // size_type max_size() const noexcept; -// bool empty() const noexcept; +// bool empty() const noexcept; #include <__config> -#if _LIBCPP_STD_VER > 11 - #include <experimental/dynarray> #include <cassert> @@ -36,7 +35,7 @@ void dyn_test ( const dynarray<T> &dyn, size_t sz ) { template <class T> void test ( std::initializer_list<T> vals ) { typedef dynarray<T> dynA; - + dynA d1 ( vals ); dyn_test ( d1, vals.size ()); } @@ -45,13 +44,11 @@ int main() { test ( { 1, 1, 2, 3, 5, 8 } ); test ( { 1., 1., 2., 3., 5., 8. } ); - test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), + test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), std::string("5"), std::string("8")} ); test<int> ( {} ); test<std::complex<double>> ( {} ); test<std::string> ( {} ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp index 2af862a5530fb..4f1d0978dd11f 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp @@ -58,7 +58,7 @@ void test ( const T &val, bool DefaultValueIsIndeterminate = false) { dynA d1 ( 4 ); dyn_test ( d1, CheckDefaultValues ); dyn_test_const ( d1, CheckDefaultValues ); - + dynA d2 ( 7, val ); dyn_test ( d2 ); dyn_test_const ( d2 ); diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp index 7317a2023cb1e..4bcb229ebce02 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.overview // const_reference at(size_type n) const; // reference at(size_type n); - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -49,7 +48,7 @@ void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) { template <class T> void test ( std::initializer_list<T> vals ) { typedef dynarray<T> dynA; - + dynA d1 ( vals ); dyn_test ( d1, vals ); dyn_test_const ( d1, vals ); @@ -59,13 +58,11 @@ int main() { test ( { 1, 1, 2, 3, 5, 8 } ); test ( { 1., 1., 2., 3., 5., 8. } ); - test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), + test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"), std::string("5"), std::string("8")} ); test<int> ( {} ); test<std::complex<double>> ( {} ); test<std::string> ( {} ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp index 9b8240d4cd82f..48da6d885773f 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp @@ -7,15 +7,14 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.data // template <class Type, class Alloc> // struct uses_allocator<dynarray<Type>, Alloc> : true_type { }; - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include "test_allocator.h" @@ -26,6 +25,4 @@ int main() { static_assert ( std::uses_allocator<dynarray<int>, test_allocator<int>>::value, "" ); } -#else -int main() {} -#endif + diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp index 93f3b18f192f5..c0e0180930e9b 100644 --- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp +++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp @@ -7,18 +7,17 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // dynarray.zero // dynarray shall provide support for the special case of construction with a size of zero. -// In the case that the size is zero, begin() == end() == unique value. -// The return value of data() is unspecified. +// In the case that the size is zero, begin() == end() == unique value. +// The return value of data() is unspecified. // The effect of calling front() or back() for a zero-sized dynarray is undefined. - -#include <__config> -#if _LIBCPP_STD_VER > 11 +#include <__config> #include <experimental/dynarray> #include <cassert> @@ -32,7 +31,7 @@ using std::experimental::dynarray; template <class T> void test ( ) { typedef dynarray<T> dynA; - + dynA d1 ( 0 ); assert ( d1.size() == 0 ); assert ( d1.begin() == d1.end ()); @@ -45,6 +44,4 @@ int main() test<std::complex<double>> (); test<std::string> (); } -#else -int main() {} -#endif + |