|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53746 - sandbox/bloom_filter/trunk/libs/bloom_filter/test
From: mikhailberis_at_[hidden]
Date: 2009-06-08 07:56:47
Author: mikhailberis
Date: 2009-06-08 07:56:47 EDT (Mon, 08 Jun 2009)
New Revision: 53746
URL: http://svn.boost.org/trac/boost/changeset/53746
Log:
Updating test suite.
Added:
sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter_test.cpp (contents, props changed)
- copied, changed from r53743, /sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp
Removed:
sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp
Text files modified:
sandbox/bloom_filter/trunk/libs/bloom_filter/test/Jamfile.v2 | 8 ++++++--
sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter_test.cpp | 3 ++-
2 files changed, 8 insertions(+), 3 deletions(-)
Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/test/Jamfile.v2
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/test/Jamfile.v2 (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/test/Jamfile.v2 2009-06-08 07:56:47 EDT (Mon, 08 Jun 2009)
@@ -1,5 +1,9 @@
-project :
- [ run bloom_filter ]
+import testing ;
+
+{
+ test-suite "bloom_filter"
+ : [ run bloom_filter_test.cpp ]
;
+}
Deleted: sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp 2009-06-08 07:56:47 EDT (Mon, 08 Jun 2009)
+++ (empty file)
@@ -1,50 +0,0 @@
-// Copyright 2009 (c) Dean Michael Berris <mikhailberis_at_[hidden]>
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <bitset>
-#include <cassert>
-#include <iostream>
-#include "bloom_filter.hpp"
-
-#define FILTER_SIZE 256
-
-size_t hash1(uint32_t id) {
- return ((id << 4) | (id >> 4)) % FILTER_SIZE;
-}
-
-size_t hash2(uint32_t id) {
- return (id * id) % FILTER_SIZE;
-}
-
-size_t hash3(uint32_t id) {
- return (id * 97) % FILTER_SIZE;
-}
-
-using std::bitset;
-using std::cout;
-using std::endl;
-using boost::array;
-using boost::function;
-using boost::bloom_filter;
-
-int main(int argc, char * argv[]) {
- array<function<size_t(uint32_t)>, 3> functions;
- functions[0] = hash1;
- functions[1] = hash2;
- functions[2] = hash3;
- typedef bloom_filter<uint32_t, FILTER_SIZE, 3> filter_type;
- filter_type filter(functions);
- filter_type filter_copy = filter;
- for(uint32_t i = 0; i < 10; ++i) filter.insert(i);
- for(uint32_t i = 0; i < 10; ++i) assert(filter.contains(i));
- filter_type::bitset_type bit_set = filter.state();
- for(uint32_t i = 0; i < filter_type::size ; ++i)
- cout << (bit_set[i] ? '1' : '0');
- cout << endl;
- // assignment test
- filter_copy = filter;
- return EXIT_SUCCESS;
-}
-
Copied: sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter_test.cpp (from r53743, /sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp)
==============================================================================
--- /sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/test/bloom_filter_test.cpp 2009-06-08 07:56:47 EDT (Mon, 08 Jun 2009)
@@ -6,7 +6,8 @@
#include <bitset>
#include <cassert>
#include <iostream>
-#include "bloom_filter.hpp"
+#include <boost/bloom_filter.hpp>
+#include <boost/detail/lightweight_test.hpp>
#define FILTER_SIZE 256
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