X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=tests%2Ftest-hdr%2Fmap%2Fhdr_refinable_hashmap_list.cpp;fp=tests%2Ftest-hdr%2Fmap%2Fhdr_refinable_hashmap_list.cpp;h=0000000000000000000000000000000000000000;hp=5dbfc4b5526a5ac5952ad1d300b92d1d77baf6b8;hb=3584c62b9f894a8e63d39b9ea90b012fa85bba78;hpb=b0c34f01f53c50aac53bbffc5582a64d983337d6 diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp deleted file mode 100644 index 5dbfc4b5..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::list sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second )); - } - }; - } - - void StripedMapHdrTest::Refinable_list() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } -} // namespace map