diff options
Diffstat (limited to 'libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp')
-rw-r--r-- | libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp b/libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp index 450fc907fb5..4b91711dfc3 100644 --- a/libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp +++ b/libcxx/test/containers/sequences/vector/vector.capacity/reserve.pass.cpp @@ -14,6 +14,7 @@ #include <vector> #include <cassert> #include "../../../stack_allocator.h" +#include "../../../min_allocator.h" int main() { @@ -42,4 +43,21 @@ int main() assert(v.size() == 100); assert(v.capacity() == 150); } +#if __cplusplus >= 201103L + { + std::vector<int, min_allocator<int>> v; + v.reserve(10); + assert(v.capacity() >= 10); + } + { + std::vector<int, min_allocator<int>> v(100); + assert(v.capacity() == 100); + v.reserve(50); + assert(v.size() == 100); + assert(v.capacity() == 100); + v.reserve(150); + assert(v.size() == 100); + assert(v.capacity() == 150); + } +#endif } |