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_allocator.h"
17 #include "min_allocator.h"
19 #include "test_macros.h"
25 S::allocator_type::throw_after
= 0;
26 #ifndef TEST_HAS_NO_EXCEPTIONS
30 while (s
.size() < s
.capacity())
31 s
.push_back(typename
S::value_type());
32 assert(s
.size() == s
.capacity());
34 #ifndef TEST_HAS_NO_EXCEPTIONS
40 S::allocator_type::throw_after
= INT_MAX
;
46 typedef std::basic_string
<char, std::char_traits
<char>, test_allocator
<char> > S
;
56 #if TEST_STD_VER >= 11
58 typedef std::basic_string
<char, std::char_traits
<char>, min_allocator
<char>> S
;
60 assert(s
.capacity() > 0);