|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72729 - sandbox/bloom_filter/trunk/libs/bloom_filter/test
From: cpp.cabrera_at_[hidden]
Date: 2011-06-24 04:27:34
Author: alejandro
Date: 2011-06-24 04:27:32 EDT (Fri, 24 Jun 2011)
New Revision: 72729
URL: http://svn.boost.org/trac/boost/changeset/72729
Log:
Added move assignment test.
Text files modified:
sandbox/bloom_filter/trunk/libs/bloom_filter/test/regression.cpp | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 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:32 EDT (Fri, 24 Jun 2011)
@@ -39,9 +39,27 @@
#ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
BOOST_AUTO_TEST_CASE(initListConstructor) {
- bloom_filter<int, 8> bloom1 = {1,2,3,4,5};
+ bloom_filter<int, 8> bloom = {1,2,3,4,5};
- BOOST_CHECK_EQUAL(bloom.count(), 5);
+ BOOST_CHECK_EQUAL(bloom.count(), 5ul);
+}
+#endif
+
+BOOST_AUTO_TEST_CASE(copyConstructor) {
+ int elems[5] = {1,2,3,4,5};
+ bloom_filter<int, 8> bloom1(elems, elems+5);
+ bloom_filter<int, 8> bloom2(bloom1);
+
+ BOOST_CHECK_EQUAL(bloom1.count(), bloom2.count());
+}
+
+#ifdef BOOST_HAS_RVALUE_REFS
+BOOST_AUTO_TEST_CASE(moveConstructor) {
+ int elems[5] = {1,2,3,4,5};
+ bloom_filter<int, 8> bloom1(elems, elems+5);
+ bloom_filter<int, 8> bloom2 = std::move(bloom1);
+
+ BOOST_CHECK_EQUAL(bloom2.count(), 5ul);
}
#endif
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