1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // deque(size_type n, const value_type& v);
18 #include "test_allocator.h"
19 #include "min_allocator.h"
21 template <class T, class Allocator>
23 test(unsigned n, const T& x)
25 typedef std::deque<T, Allocator> C;
26 typedef typename C::const_iterator const_iterator;
28 assert(d.size() == n);
29 assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
30 for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
36 test<int, std::allocator<int> >(0, 5);
37 test<int, std::allocator<int> >(1, 10);
38 test<int, std::allocator<int> >(10, 11);
39 test<int, std::allocator<int> >(1023, -11);
40 test<int, std::allocator<int> >(1024, 25);
41 test<int, std::allocator<int> >(1025, 0);
42 test<int, std::allocator<int> >(2047, 110);
43 test<int, std::allocator<int> >(2048, -500);
44 test<int, std::allocator<int> >(2049, 654);
45 test<int, std::allocator<int> >(4095, 78);
46 test<int, std::allocator<int> >(4096, 1165);
47 test<int, std::allocator<int> >(4097, 157);
48 LIBCPP_ONLY(test<int, limited_allocator<int, 4096> >(4095, 90));
49 #if TEST_STD_VER >= 11
50 test<int, min_allocator<int> >(4095, 90);