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 //===----------------------------------------------------------------------===//
11 // size_type capacity() const;
16 #include "test_macros.h"
17 #include "min_allocator.h"
18 #include "asan_testing.h"
24 assert(v
.capacity() == 0);
25 assert(is_contiguous_container_asan_correct(v
));
28 std::vector
<int> v(100);
29 assert(v
.capacity() == 100);
31 assert(v
.capacity() > 101);
32 assert(is_contiguous_container_asan_correct(v
));
34 #if TEST_STD_VER >= 11
36 std::vector
<int, min_allocator
<int>> v
;
37 assert(v
.capacity() == 0);
38 assert(is_contiguous_container_asan_correct(v
));
41 std::vector
<int, min_allocator
<int>> v(100);
42 assert(v
.capacity() == 100);
44 assert(v
.capacity() > 101);
45 assert(is_contiguous_container_asan_correct(v
));