Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72841 - sandbox/bloom_filter/trunk/libs/bloom_filter/test
From: cpp.cabrera_at_[hidden]
Date: 2011-07-02 04:03:05


Author: alejandro
Date: 2011-07-02 04:03:03 EDT (Sat, 02 Jul 2011)
New Revision: 72841
URL: http://svn.boost.org/trac/boost/changeset/72841

Log:
Added operator== and operator!= tests for basic Bloom filter.
Text files modified:
   sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom-pass.cpp | 21 +++++++++++++++++++++
   1 files changed, 21 insertions(+), 0 deletions(-)

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom-pass.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom-pass.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom-pass.cpp 2011-07-02 04:03:03 EDT (Sat, 02 Jul 2011)
@@ -270,3 +270,24 @@
   BOOST_CHECK_EQUAL(bloom2.count(), 2ul);
 }
 
+BOOST_AUTO_TEST_CASE(equalityOperator) {
+ bloom_filter<int, 8> bloom1;
+ bloom_filter<int, 8> bloom2;
+
+ BOOST_CHECK_EQUAL(bloom1 == bloom2, true);
+ bloom1.insert(1);
+ BOOST_CHECK_EQUAL(bloom1 == bloom2, false);
+ bloom2.insert(1);
+ BOOST_CHECK_EQUAL(bloom1 == bloom2, true);
+}
+
+BOOST_AUTO_TEST_CASE(inequalityOperator) {
+ bloom_filter<int, 8> bloom1;
+ bloom_filter<int, 8> bloom2;
+
+ BOOST_CHECK_EQUAL(bloom1 != bloom2, false);
+ bloom1.insert(1);
+ BOOST_CHECK_EQUAL(bloom1 != bloom2, true);
+ bloom2.insert(1);
+ BOOST_CHECK_EQUAL(bloom1 != bloom2, false);
+}


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