summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp')
-rw-r--r--libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp b/libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp
new file mode 100644
index 00000000000..0263ec43727
--- /dev/null
+++ b/libcxx/test/containers/sequences/vector.bool/capacity.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+// vector<bool>
+
+// size_type capacity() const;
+
+#include <vector>
+#include <cassert>
+
+int main()
+{
+ {
+ std::vector<bool> v;
+ assert(v.capacity() == 0);
+ }
+ {
+ std::vector<bool> v(100);
+ assert(v.capacity() >= 100);
+ v.push_back(0);
+ assert(v.capacity() >= 101);
+ }
+}
OpenPOWER on IntegriCloud