X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=tests%2Ftest-hdr%2Fset%2Fhdr_striped_hashset_boost_flat_set.cpp;fp=tests%2Ftest-hdr%2Fset%2Fhdr_striped_hashset_boost_flat_set.cpp;h=0000000000000000000000000000000000000000;hp=77b5d4578d63d7cc260da20fa2232b560859ab6c;hb=cc36eb6fd0970a8ea7c8bfa3ebdf6b6dbd7739ac;hpb=d5a609092b48d81c8a751f4df55b48aa3cfa80bb diff --git a/tests/test-hdr/set/hdr_striped_hashset_boost_flat_set.cpp b/tests/test-hdr/set/hdr_striped_hashset_boost_flat_set.cpp deleted file mode 100644 index 77b5d457..00000000 --- a/tests/test-hdr/set/hdr_striped_hashset_boost_flat_set.cpp +++ /dev/null @@ -1,199 +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 "set/hdr_striped_set.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace set { - void StripedSetHdrTest::Striped_boost_flat_set() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_set you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace set { - - namespace { - typedef boost::container::flat_set< StripedSetHdrTest::item, StripedSetHdrTest::less > set_t; - - struct my_copy_policy { - typedef set_t::iterator iterator; - - void operator()( set_t& set, iterator itWhat ) - { - set.insert( *itWhat ); - } - }; - } - - void StripedSetHdrTest::Striped_boost_flat_set() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > set_cmp; - test_striped< set_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - > set_less; - test_striped< set_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > set_cmpmix; - test_striped< set_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - ,co::mutex_policy< cc::striped_set::striping< cds::sync::spin> > - > set_spin; - test_striped< set_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > set_less_resizing_lf; - - set_less_resizing_lf s( 30, cc::striped_set::load_factor_resizing<0>( 1024 ) ); - test_striped_with( s ); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > set_less_resizing_lf16; - test_striped< set_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > set_less_resizing_sbt; - - set_less_resizing_sbt s( 30, cc::striped_set::single_bucket_size_threshold<0>( 1024 ) ); - test_striped_with( s ); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > set_less_resizing_sbt16; - test_striped< set_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedSet< set_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } - -} // namespace set - -/* -#else - namespace set { - void StripedSetHdrTest::Striped_boost_flat_set() - { - CPPUNIT_MESSAGE( "Skipped; boost::container::flat_set is not compatible with MS VC++ 11" ); - } - } -#endif -*/ - -#else // BOOST_VERSION < 104800 - -namespace set { - void StripedSetHdrTest::Striped_boost_flat_set() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_set you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION