1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 // void resize(size_type sz);
17 #include "test_macros.h"
18 #include "min_allocator.h"
23 std::vector
<bool> v(100);
25 assert(v
.size() == 50);
26 assert(v
.capacity() >= 100);
28 assert(v
.size() == 200);
29 assert(v
.capacity() >= 200);
31 v
.resize(300); // check the case when resizing and we already have room
32 assert(v
.size() == 300);
33 assert(v
.capacity() >= 400);
35 #if TEST_STD_VER >= 11
37 std::vector
<bool, min_allocator
<bool>> v(100);
39 assert(v
.size() == 50);
40 assert(v
.capacity() >= 100);
42 assert(v
.size() == 200);
43 assert(v
.capacity() >= 200);
45 v
.resize(300); // check the case when resizing and we already have room
46 assert(v
.size() == 300);
47 assert(v
.capacity() >= 400);