//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // deque(size_type n, const value_type& v); #include #include #include #include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" template void test(unsigned n, const T& x) { typedef std::deque C; typedef typename C::const_iterator const_iterator; C d(n, x); assert(d.size() == n); assert(static_cast(distance(d.begin(), d.end())) == d.size()); for (const_iterator i = d.begin(), e = d.end(); i != e; ++i) assert(*i == x); } int main(int, char**) { test >(0, 5); test >(1, 10); test >(10, 11); test >(1023, -11); test >(1024, 25); test >(1025, 0); test >(2047, 110); test >(2048, -500); test >(2049, 654); test >(4095, 78); test >(4096, 1165); test >(4097, 157); LIBCPP_ONLY(test >(4095, 90)); #if TEST_STD_VER >= 11 test >(4095, 90); #endif return 0; }