diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
commit | 5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch) | |
tree | afde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp | |
parent | f11e8eab527fba316c64112f6e05de1a79693a3e (diff) | |
download | bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip |
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp')
-rw-r--r-- | libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp b/libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp deleted file mode 100644 index d274bc03088..00000000000 --- a/libcxx/test/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp +++ /dev/null @@ -1,86 +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. -// -//===----------------------------------------------------------------------===// - -// dynarray.cons - -// template <class Alloc> -// dynarray(size_type c, const Alloc& alloc); -// template <class Alloc> -// dynarray(size_type c, const T& v, const Alloc& alloc); -// template <class Alloc> -// dynarray(const dynarray& d, const Alloc& alloc); -// template <class Alloc> -// dynarray(initializer_list<T>, const Alloc& alloc); - -// ~dynarray(); - - -#include <__config> - -#if _LIBCPP_STD_VER > 11 - -#include <experimental/dynarray> -#include <cassert> - -#include <algorithm> -#include <complex> -#include <string> -#include "test_allocator.h" - -using std::experimental::dynarray; - -template <class T, class Allocator> -void check_allocator ( const dynarray<T> &dyn, const Allocator &alloc ) { - for ( int i = 0; i < dyn.size (); ++i ) - assert ( dyn[i].get_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 ())); - check_allocator ( d1, 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(); } )); - check_allocator ( d1, alloc1 ); - - dynA d2 ( 7, val, alloc1 ); - assert ( d2.size () == 7 ); - assert ( std::all_of ( d2.begin (), d2.end (), [&val]( const T &item ){ return item == val; } )); - check_allocator ( d2, alloc1 ); - - dynA d3 ( d2, alloc2 ); - assert ( d3.size () == 7 ); - 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 -// 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 |