|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72727 - sandbox/bloom_filter/trunk/libs/bloom_filter/test
From: cpp.cabrera_at_[hidden]
Date: 2011-06-24 04:27:11
Author: alejandro
Date: 2011-06-24 04:27:08 EDT (Fri, 24 Jun 2011)
New Revision: 72727
URL: http://svn.boost.org/trac/boost/changeset/72727
Log:
Added tests for range insert, range constructor, and initializer list constructor.
Text files modified:
sandbox/bloom_filter/trunk/libs/bloom_filter/test/regression.cpp | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/test/regression.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/test/regression.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/test/regression.cpp 2011-06-24 04:27:08 EDT (Fri, 24 Jun 2011)
@@ -30,6 +30,21 @@
bloom_filter<int, 8, BoostHashFunctions> bloom2;
}
+BOOST_AUTO_TEST_CASE(rangeConstructor) {
+ int elems[5] = {1,2,3,4,5};
+ bloom_filter<int, 8> bloom(elems, elems+5);
+
+ BOOST_CHECK_EQUAL(bloom.count(), 5ul);
+}
+
+#ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
+BOOST_AUTO_TEST_CASE(initListConstructor) {
+ bloom_filter<int, 8> bloom1 = {1,2,3,4,5};
+
+ BOOST_CHECK_EQUAL(bloom.count(), 5);
+}
+#endif
+
BOOST_AUTO_TEST_CASE(assignment)
{
bloom_filter<int, 8> bloom1;
@@ -140,6 +155,14 @@
}
}
+BOOST_AUTO_TEST_CASE(rangeInsert) {
+ int elems[5] = {1,2,3,4,5};
+ bloom_filter<size_t, 8> bloom;
+
+ bloom.insert(elems, elems+5);
+ BOOST_CHECK_EQUAL(bloom.count(), 5ul);
+}
+
BOOST_AUTO_TEST_CASE(clear) {
bloom_filter<size_t, 8> bloom;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk