aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/vector_bool.cc
diff options
context:
space:
mode:
authorpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-01 00:48:21 +0000
committerpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-01 00:48:21 +0000
commitc0a96dff888ac7a54f13639e446cc9eb5af589be (patch)
tree3463f5cdade6477c666690f72199ae3be32993f4 /libstdc++-v3/testsuite/23_containers/vector_bool.cc
parent5f7b9df841aafadecb9956b3f42d3e2be8044bee (diff)
2002-05-31 Marcus Meissner <meissner@suse.de>
* include/bits/stl_bvector.h: Use UL suffix for unsigned longs. * testsuite/23_containers/vector_bool.cc (test02): New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/vector_bool.cc')
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_bool.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/vector_bool.cc b/libstdc++-v3/testsuite/23_containers/vector_bool.cc
index 820bbaca54f..17d63d1f854 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_bool.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_bool.cc
@@ -29,8 +29,32 @@ void test01()
++i;
}
+// libstdc++/6886
+void test02()
+{
+ typedef std::vector<bool> bvec;
+ int i, num = 0;
+ bvec v;
+
+ v.resize(66);
+
+ for (i = 0 ; i < 66 ; ++i)
+ v[i] = 0;
+
+ v[1] = 1;
+ v[33] = 1;
+ v[49] = 1;
+ v[65] = 1;
+
+ for (bvec::iterator j = v.begin() ; j != v.end() ; j++)
+ if (bool(*j)) ++num;
+
+ VERIFY( num == 4 );
+}
+
int main()
{
test01();
+ test02();
return 0;
}