From dc42eb61d5257df0d28e1a5dd1d3c389bd0fdb72 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 30 May 2016 22:53:58 +0300 Subject: [PATCH] Removed old map tests --- tests/unit/map2/CMakeLists.txt | 103 -- tests/unit/map2/map_defs.h | 997 ------------------ tests/unit/map2/map_delodd.cpp | 74 -- tests/unit/map2/map_delodd.h | 829 --------------- tests/unit/map2/map_delodd_bronsonavltree.cpp | 40 - tests/unit/map2/map_delodd_cuckoo.cpp | 40 - tests/unit/map2/map_delodd_ellentree.cpp | 40 - tests/unit/map2/map_delodd_feldmanhashmap.cpp | 41 - tests/unit/map2/map_delodd_michael.cpp | 40 - tests/unit/map2/map_delodd_skip.cpp | 40 - tests/unit/map2/map_delodd_split.cpp | 40 - tests/unit/map2/map_find_int.cpp | 84 -- tests/unit/map2/map_find_int.h | 282 ----- .../unit/map2/map_find_int_bronsonavltree.cpp | 40 - tests/unit/map2/map_find_int_cuckoo.cpp | 40 - tests/unit/map2/map_find_int_ellentree.cpp | 40 - .../unit/map2/map_find_int_feldmanhashmap.cpp | 40 - tests/unit/map2/map_find_int_michael.cpp | 41 - tests/unit/map2/map_find_int_skip.cpp | 41 - tests/unit/map2/map_find_int_split.cpp | 41 - tests/unit/map2/map_find_int_std.cpp | 41 - tests/unit/map2/map_find_int_striped.cpp | 41 - tests/unit/map2/map_find_string.cpp | 86 -- tests/unit/map2/map_find_string.h | 274 ----- .../map2/map_find_string_bronsonavltree.cpp | 40 - tests/unit/map2/map_find_string_cuckoo.cpp | 40 - tests/unit/map2/map_find_string_ellentree.cpp | 40 - .../map2/map_find_string_feldmanhashmap.cpp | 40 - tests/unit/map2/map_find_string_michael.cpp | 41 - tests/unit/map2/map_find_string_skip.cpp | 41 - tests/unit/map2/map_find_string_split.cpp | 41 - tests/unit/map2/map_find_string_std.cpp | 41 - tests/unit/map2/map_find_string_striped.cpp | 41 - tests/unit/map2/map_insdel_func.cpp | 54 - tests/unit/map2/map_insdel_func.h | 607 ----------- .../map2/map_insdel_func_bronsonavltree.cpp | 40 - tests/unit/map2/map_insdel_func_cuckoo.cpp | 40 - tests/unit/map2/map_insdel_func_ellentree.cpp | 40 - .../map2/map_insdel_func_feldmanhashmap.cpp | 41 - tests/unit/map2/map_insdel_func_michael.cpp | 40 - tests/unit/map2/map_insdel_func_skip.cpp | 40 - tests/unit/map2/map_insdel_func_split.cpp | 40 - tests/unit/map2/map_insdel_func_striped.cpp | 41 - tests/unit/map2/map_insdel_int.cpp | 66 -- tests/unit/map2/map_insdel_int.h | 304 ------ .../map2/map_insdel_int_bronsonavltree.cpp | 40 - tests/unit/map2/map_insdel_int_cuckoo.cpp | 40 - tests/unit/map2/map_insdel_int_ellentree.cpp | 40 - .../map2/map_insdel_int_feldmanhashmap.cpp | 41 - tests/unit/map2/map_insdel_int_michael.cpp | 40 - tests/unit/map2/map_insdel_int_skip.cpp | 40 - tests/unit/map2/map_insdel_int_split.cpp | 40 - tests/unit/map2/map_insdel_int_std.cpp | 40 - tests/unit/map2/map_insdel_int_striped.cpp | 41 - tests/unit/map2/map_insdel_item_int.cpp | 55 - tests/unit/map2/map_insdel_item_int.h | 328 ------ .../map_insdel_item_int_bronsonavltree.cpp | 40 - .../unit/map2/map_insdel_item_int_cuckoo.cpp | 40 - .../map2/map_insdel_item_int_ellentree.cpp | 40 - .../map_insdel_item_int_feldmanhashmap.cpp | 41 - .../unit/map2/map_insdel_item_int_michael.cpp | 40 - tests/unit/map2/map_insdel_item_int_skip.cpp | 40 - tests/unit/map2/map_insdel_item_int_split.cpp | 40 - .../unit/map2/map_insdel_item_int_striped.cpp | 41 - tests/unit/map2/map_insdel_item_string.cpp | 55 - tests/unit/map2/map_insdel_item_string.h | 308 ------ .../map_insdel_item_string_bronsonavltree.cpp | 40 - .../map2/map_insdel_item_string_cuckoo.cpp | 40 - .../map2/map_insdel_item_string_ellentree.cpp | 40 - .../map_insdel_item_string_feldmanhashmap.cpp | 40 - .../map2/map_insdel_item_string_michael.cpp | 40 - .../unit/map2/map_insdel_item_string_skip.cpp | 40 - .../map2/map_insdel_item_string_split.cpp | 40 - .../map2/map_insdel_item_string_striped.cpp | 41 - tests/unit/map2/map_insdel_string.cpp | 57 - tests/unit/map2/map_insdel_string.h | 307 ------ .../map2/map_insdel_string_bronsonavltree.cpp | 40 - tests/unit/map2/map_insdel_string_cuckoo.cpp | 40 - .../unit/map2/map_insdel_string_ellentree.cpp | 40 - .../map2/map_insdel_string_feldmanhashmap.cpp | 40 - tests/unit/map2/map_insdel_string_michael.cpp | 40 - tests/unit/map2/map_insdel_string_skip.cpp | 40 - tests/unit/map2/map_insdel_string_split.cpp | 40 - tests/unit/map2/map_insdel_string_std.cpp | 40 - tests/unit/map2/map_insdel_string_striped.cpp | 41 - tests/unit/map2/map_insdelfind.cpp | 70 -- tests/unit/map2/map_insdelfind.h | 307 ------ .../map2/map_insdelfind_bronsonavltree.cpp | 40 - tests/unit/map2/map_insdelfind_cuckoo.cpp | 40 - tests/unit/map2/map_insdelfind_ellentree.cpp | 40 - .../map2/map_insdelfind_feldmanhashmap.cpp | 41 - tests/unit/map2/map_insdelfind_michael.cpp | 40 - tests/unit/map2/map_insdelfind_skip.cpp | 40 - tests/unit/map2/map_insdelfind_split.cpp | 40 - tests/unit/map2/map_insdelfind_std.cpp | 40 - tests/unit/map2/map_insdelfind_striped.cpp | 41 - tests/unit/map2/map_insfind_int.cpp | 53 - tests/unit/map2/map_insfind_int.h | 252 ----- .../map2/map_insfind_int_bronsonavltree.cpp | 40 - tests/unit/map2/map_insfind_int_cuckoo.cpp | 40 - tests/unit/map2/map_insfind_int_ellentree.cpp | 40 - .../map2/map_insfind_int_feldmanhashmap.cpp | 41 - tests/unit/map2/map_insfind_int_michael.cpp | 41 - tests/unit/map2/map_insfind_int_skip.cpp | 41 - tests/unit/map2/map_insfind_int_split.cpp | 41 - tests/unit/map2/map_insfind_int_std.cpp | 40 - tests/unit/map2/map_insfind_int_striped.cpp | 41 - tests/unit/map2/map_type.h | 163 --- tests/unit/map2/map_type_bronson_avltree.h | 199 ---- tests/unit/map2/map_type_cuckoo.h | 206 ---- tests/unit/map2/map_type_ellen_bintree.h | 279 ----- tests/unit/map2/map_type_feldman_hashmap.h | 201 ---- tests/unit/map2/map_type_lazy_list.h | 162 --- tests/unit/map2/map_type_michael.h | 226 ---- tests/unit/map2/map_type_michael_list.h | 154 --- tests/unit/map2/map_type_skip_list.h | 238 ----- tests/unit/map2/map_type_split_list.h | 573 ---------- tests/unit/map2/map_type_std.h | 62 -- tests/unit/map2/map_type_striped.h | 284 ----- tests/unit/map2/std_hash_map.h | 137 --- tests/unit/map2/std_map.h | 127 --- 121 files changed, 11989 deletions(-) delete mode 100644 tests/unit/map2/CMakeLists.txt delete mode 100644 tests/unit/map2/map_defs.h delete mode 100644 tests/unit/map2/map_delodd.cpp delete mode 100644 tests/unit/map2/map_delodd.h delete mode 100644 tests/unit/map2/map_delodd_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_delodd_cuckoo.cpp delete mode 100644 tests/unit/map2/map_delodd_ellentree.cpp delete mode 100644 tests/unit/map2/map_delodd_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_delodd_michael.cpp delete mode 100644 tests/unit/map2/map_delodd_skip.cpp delete mode 100644 tests/unit/map2/map_delodd_split.cpp delete mode 100644 tests/unit/map2/map_find_int.cpp delete mode 100644 tests/unit/map2/map_find_int.h delete mode 100644 tests/unit/map2/map_find_int_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_find_int_cuckoo.cpp delete mode 100644 tests/unit/map2/map_find_int_ellentree.cpp delete mode 100644 tests/unit/map2/map_find_int_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_find_int_michael.cpp delete mode 100644 tests/unit/map2/map_find_int_skip.cpp delete mode 100644 tests/unit/map2/map_find_int_split.cpp delete mode 100644 tests/unit/map2/map_find_int_std.cpp delete mode 100644 tests/unit/map2/map_find_int_striped.cpp delete mode 100644 tests/unit/map2/map_find_string.cpp delete mode 100644 tests/unit/map2/map_find_string.h delete mode 100644 tests/unit/map2/map_find_string_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_find_string_cuckoo.cpp delete mode 100644 tests/unit/map2/map_find_string_ellentree.cpp delete mode 100644 tests/unit/map2/map_find_string_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_find_string_michael.cpp delete mode 100644 tests/unit/map2/map_find_string_skip.cpp delete mode 100644 tests/unit/map2/map_find_string_split.cpp delete mode 100644 tests/unit/map2/map_find_string_std.cpp delete mode 100644 tests/unit/map2/map_find_string_striped.cpp delete mode 100644 tests/unit/map2/map_insdel_func.cpp delete mode 100644 tests/unit/map2/map_insdel_func.h delete mode 100644 tests/unit/map2/map_insdel_func_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdel_func_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdel_func_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdel_func_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdel_func_michael.cpp delete mode 100644 tests/unit/map2/map_insdel_func_skip.cpp delete mode 100644 tests/unit/map2/map_insdel_func_split.cpp delete mode 100644 tests/unit/map2/map_insdel_func_striped.cpp delete mode 100644 tests/unit/map2/map_insdel_int.cpp delete mode 100644 tests/unit/map2/map_insdel_int.h delete mode 100644 tests/unit/map2/map_insdel_int_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdel_int_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdel_int_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdel_int_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdel_int_michael.cpp delete mode 100644 tests/unit/map2/map_insdel_int_skip.cpp delete mode 100644 tests/unit/map2/map_insdel_int_split.cpp delete mode 100644 tests/unit/map2/map_insdel_int_std.cpp delete mode 100644 tests/unit/map2/map_insdel_int_striped.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int.h delete mode 100644 tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_michael.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_skip.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_split.cpp delete mode 100644 tests/unit/map2/map_insdel_item_int_striped.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string.h delete mode 100644 tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_michael.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_skip.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_split.cpp delete mode 100644 tests/unit/map2/map_insdel_item_string_striped.cpp delete mode 100644 tests/unit/map2/map_insdel_string.cpp delete mode 100644 tests/unit/map2/map_insdel_string.h delete mode 100644 tests/unit/map2/map_insdel_string_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdel_string_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdel_string_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdel_string_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdel_string_michael.cpp delete mode 100644 tests/unit/map2/map_insdel_string_skip.cpp delete mode 100644 tests/unit/map2/map_insdel_string_split.cpp delete mode 100644 tests/unit/map2/map_insdel_string_std.cpp delete mode 100644 tests/unit/map2/map_insdel_string_striped.cpp delete mode 100644 tests/unit/map2/map_insdelfind.cpp delete mode 100644 tests/unit/map2/map_insdelfind.h delete mode 100644 tests/unit/map2/map_insdelfind_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insdelfind_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insdelfind_ellentree.cpp delete mode 100644 tests/unit/map2/map_insdelfind_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insdelfind_michael.cpp delete mode 100644 tests/unit/map2/map_insdelfind_skip.cpp delete mode 100644 tests/unit/map2/map_insdelfind_split.cpp delete mode 100644 tests/unit/map2/map_insdelfind_std.cpp delete mode 100644 tests/unit/map2/map_insdelfind_striped.cpp delete mode 100644 tests/unit/map2/map_insfind_int.cpp delete mode 100644 tests/unit/map2/map_insfind_int.h delete mode 100644 tests/unit/map2/map_insfind_int_bronsonavltree.cpp delete mode 100644 tests/unit/map2/map_insfind_int_cuckoo.cpp delete mode 100644 tests/unit/map2/map_insfind_int_ellentree.cpp delete mode 100644 tests/unit/map2/map_insfind_int_feldmanhashmap.cpp delete mode 100644 tests/unit/map2/map_insfind_int_michael.cpp delete mode 100644 tests/unit/map2/map_insfind_int_skip.cpp delete mode 100644 tests/unit/map2/map_insfind_int_split.cpp delete mode 100644 tests/unit/map2/map_insfind_int_std.cpp delete mode 100644 tests/unit/map2/map_insfind_int_striped.cpp delete mode 100644 tests/unit/map2/map_type.h delete mode 100644 tests/unit/map2/map_type_bronson_avltree.h delete mode 100644 tests/unit/map2/map_type_cuckoo.h delete mode 100644 tests/unit/map2/map_type_ellen_bintree.h delete mode 100644 tests/unit/map2/map_type_feldman_hashmap.h delete mode 100644 tests/unit/map2/map_type_lazy_list.h delete mode 100644 tests/unit/map2/map_type_michael.h delete mode 100644 tests/unit/map2/map_type_michael_list.h delete mode 100644 tests/unit/map2/map_type_skip_list.h delete mode 100644 tests/unit/map2/map_type_split_list.h delete mode 100644 tests/unit/map2/map_type_std.h delete mode 100644 tests/unit/map2/map_type_striped.h delete mode 100644 tests/unit/map2/std_hash_map.h delete mode 100644 tests/unit/map2/std_map.h diff --git a/tests/unit/map2/CMakeLists.txt b/tests/unit/map2/CMakeLists.txt deleted file mode 100644 index 1a55ab84..00000000 --- a/tests/unit/map2/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -set(PACKAGE_NAME cdsu-map) - -set(CDSUNIT_MAP_SOURCES - map_find_int.cpp - map_find_int_bronsonavltree.cpp - map_find_int_cuckoo.cpp - map_find_int_ellentree.cpp - map_find_int_michael.cpp - map_find_int_feldmanhashmap.cpp - map_find_int_skip.cpp - map_find_int_split.cpp - map_find_int_striped.cpp - map_find_int_std.cpp - map_find_string.cpp - map_find_string_bronsonavltree.cpp - map_find_string_cuckoo.cpp - map_find_string_ellentree.cpp - map_find_string_michael.cpp - map_find_string_feldmanhashmap.cpp - map_find_string_skip.cpp - map_find_string_split.cpp - map_find_string_striped.cpp - map_find_string_std.cpp - map_insfind_int.cpp - map_insfind_int_bronsonavltree.cpp - map_insfind_int_cuckoo.cpp - map_insfind_int_ellentree.cpp - map_insfind_int_feldmanhashmap.cpp - map_insfind_int_michael.cpp - map_insfind_int_skip.cpp - map_insfind_int_split.cpp - map_insfind_int_striped.cpp - map_insfind_int_std.cpp - map_insdel_func.cpp - map_insdel_func_bronsonavltree.cpp - map_insdel_func_cuckoo.cpp - map_insdel_func_ellentree.cpp - map_insdel_func_michael.cpp - map_insdel_func_feldmanhashmap.cpp - map_insdel_func_skip.cpp - map_insdel_func_split.cpp - map_insdel_func_striped.cpp - map_insdel_int.cpp - map_insdel_int_bronsonavltree.cpp - map_insdel_int_cuckoo.cpp - map_insdel_int_ellentree.cpp - map_insdel_int_michael.cpp - map_insdel_int_feldmanhashmap.cpp - map_insdel_int_skip.cpp - map_insdel_int_split.cpp - map_insdel_int_striped.cpp - map_insdel_int_std.cpp - map_insdel_item_int.cpp - map_insdel_item_int_bronsonavltree.cpp - map_insdel_item_int_cuckoo.cpp - map_insdel_item_int_ellentree.cpp - map_insdel_item_int_michael.cpp - map_insdel_item_int_feldmanhashmap.cpp - map_insdel_item_int_skip.cpp - map_insdel_item_int_split.cpp - map_insdel_item_int_striped.cpp - map_insdel_item_string.cpp - map_insdel_item_string_bronsonavltree.cpp - map_insdel_item_string_cuckoo.cpp - map_insdel_item_string_ellentree.cpp - map_insdel_item_string_michael.cpp - map_insdel_item_string_feldmanhashmap.cpp - map_insdel_item_string_skip.cpp - map_insdel_item_string_split.cpp - map_insdel_item_string_striped.cpp - map_insdel_string.cpp - map_insdel_string_bronsonavltree.cpp - map_insdel_string_cuckoo.cpp - map_insdel_string_ellentree.cpp - map_insdel_string_michael.cpp - map_insdel_string_feldmanhashmap.cpp - map_insdel_string_skip.cpp - map_insdel_string_split.cpp - map_insdel_string_striped.cpp - map_insdel_string_std.cpp - map_insdelfind.cpp - map_insdelfind_bronsonavltree.cpp - map_insdelfind_cuckoo.cpp - map_insdelfind_ellentree.cpp - map_insdelfind_michael.cpp - map_insdelfind_feldmanhashmap.cpp - map_insdelfind_skip.cpp - map_insdelfind_split.cpp - map_insdelfind_striped.cpp - map_insdelfind_std.cpp - map_delodd.cpp - map_delodd_bronsonavltree.cpp - map_delodd_cuckoo.cpp - map_delodd_ellentree.cpp - map_delodd_michael.cpp - map_delodd_feldmanhashmap.cpp - map_delodd_split.cpp - map_delodd_skip.cpp -) - -add_executable(${PACKAGE_NAME} ${CDSUNIT_MAP_SOURCES} $) -target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) -add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) \ No newline at end of file diff --git a/tests/unit/map2/map_defs.h b/tests/unit/map2/map_defs.h deleted file mode 100644 index f53b7a9e..00000000 --- a/tests/unit/map2/map_defs.h +++ /dev/null @@ -1,997 +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. -*/ - -#define CDSUNIT_DECLARE_StdMap \ - TEST_CASE(tag_StdMap, StdMap_Spin) \ - TEST_CASE(tag_StdMap, StdHashMap_Spin) \ - TEST_CASE(tag_StdMap, StdMap_Mutex) \ - TEST_CASE(tag_StdMap, StdHashMap_Mutex) - -#define CDSUNIT_TEST_StdMap \ - CPPUNIT_TEST(StdMap_Spin) \ - CPPUNIT_TEST(StdHashMap_Spin) \ - CPPUNIT_TEST(StdMap_Mutex) \ - CPPUNIT_TEST(StdHashMap_Mutex) \ - -#define CDSUNIT_DECLARE_StdMap_NoLock \ - TEST_CASE(tag_StdMap, StdMap_NoLock) \ - TEST_CASE(tag_StdMap, StdHashMap_NoLock) \ - -#define CDSUNIT_TEST_StdMap_NoLock \ - CPPUNIT_TEST(StdMap_NoLock) \ - CPPUNIT_TEST(StdHashMap_NoLock) \ - - -// ************************************************************************************** -// MichaelMap - -#undef CDSUNIT_DECLARE_MichaelMap_RCU_signal -#undef CDSUNIT_TEST_MichaelMap_RCU_signal -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_MichaelMap_RCU_signal \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_SHB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_SHB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_SHT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_SHT_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_SHB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_SHB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_SHT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_SHT_less_michaelAlloc) - -# define CDSUNIT_TEST_MichaelMap_RCU_signal \ - CPPUNIT_TEST(MichaelMap_RCU_SHB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_SHB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_SHT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_SHT_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_SHB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_SHB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_SHT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_SHT_less_michaelAlloc) - -#else -# define CDSUNIT_DECLARE_MichaelMap_RCU_signal -# define CDSUNIT_TEST_MichaelMap_RCU_signal -#endif - -#undef CDSUNIT_DECLARE_MichaelMap -#define CDSUNIT_DECLARE_MichaelMap \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_HP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_HP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_DHP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_DHP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPI_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPI_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_RCU_GPT_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_HP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_HP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_DHP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_DHP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPI_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPI_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_RCU_GPT_less_michaelAlloc)\ - CDSUNIT_DECLARE_MichaelMap_RCU_signal - -#undef CDSUNIT_TEST_MichaelMap -#define CDSUNIT_TEST_MichaelMap \ - CPPUNIT_TEST(MichaelMap_HP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_HP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_DHP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_DHP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPI_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPI_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_RCU_GPT_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_HP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_HP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_DHP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_DHP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPI_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPI_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_RCU_GPT_less_michaelAlloc)\ - CDSUNIT_TEST_MichaelMap_RCU_signal - -#undef CDSUNIT_DECLARE_MichaelMap_nogc -#define CDSUNIT_DECLARE_MichaelMap_nogc \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_NOGC_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_NOGC_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_NOGC_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_NOGC_unord_stdAlloc) \ - TEST_CASE(tag_MichaelHashMap, MichaelMap_Lazy_NOGC_less_michaelAlloc) - -#undef CDSUNIT_TEST_MichaelMap_nogc -#define CDSUNIT_TEST_MichaelMap_nogc \ - CPPUNIT_TEST(MichaelMap_NOGC_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_NOGC_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_NOGC_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_NOGC_unord_stdAlloc) \ - CPPUNIT_TEST(MichaelMap_Lazy_NOGC_less_michaelAlloc) \ - - -// ************************************************************************************** -// SplitListMap - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_SplitList_RCU_signal \ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHB_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_SHT_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHB_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_SHT_st_less_stat) - -# define CDSUNIT_TEST_SplitList_RCU_signal \ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_less_stat) - -#else -# define CDSUNIT_DECLARE_SplitList_RCU_signal -# define CDSUNIT_TEST_SplitList_RCU_signal -#endif - -#define CDSUNIT_DECLARE_SplitList \ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_HP_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_DHP_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPI_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPB_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_RCU_GPT_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_HP_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_DHP_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPI_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPB_st_less_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_RCU_GPT_st_less_stat)\ - CDSUNIT_DECLARE_SplitList_RCU_signal - -#define CDSUNIT_TEST_SplitList \ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_less)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_less)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_less_stat)\ - CDSUNIT_TEST_SplitList_RCU_signal - -#define CDSUNIT_DECLARE_SplitList_nogc \ - TEST_CASE(tag_SplitListMap, SplitList_Michael_NOGC_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_NOGC_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_NOGC_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Michael_NOGC_st_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_NOGC_dyn_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_NOGC_st_cmp)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_NOGC_dyn_less)\ - TEST_CASE(tag_SplitListMap, SplitList_Lazy_NOGC_st_less) - -#define CDSUNIT_TEST_SplitList_nogc \ - CPPUNIT_TEST(SplitList_Michael_NOGC_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_NOGC_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_NOGC_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_NOGC_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_NOGC_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_NOGC_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_NOGC_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_NOGC_st_less) - - -// ************************************************************************************** -// SkipListMap - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_SkipListMap_RCU_signal \ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_shb_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_shb_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_shb_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_shb_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_sht_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_sht_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_sht_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_sht_cmp_xorshift_stat) - -# define CDSUNIT_TEST_SkipListMap_RCU_signal \ - CPPUNIT_TEST(SkipListMap_rcu_shb_less_pascal)\ - CPPUNIT_TEST(SkipListMap_rcu_shb_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_shb_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_rcu_shb_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_sht_less_pascal)\ - CPPUNIT_TEST(SkipListMap_rcu_sht_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_sht_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_rcu_sht_cmp_xorshift_stat) - -#else -# define CDSUNIT_DECLARE_SkipListMap_RCU_signal -# define CDSUNIT_TEST_SkipListMap_RCU_signal -#endif - -#define CDSUNIT_DECLARE_SkipListMap \ - TEST_CASE(tag_SkipListMap, SkipListMap_hp_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_hp_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_hp_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_hp_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_dhp_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_dhp_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_dhp_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_dhp_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpi_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpi_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpi_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpi_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpb_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpb_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpb_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpb_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpt_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpt_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpt_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_rcu_gpt_cmp_xorshift_stat)\ - CDSUNIT_DECLARE_SkipListMap_RCU_signal - -#define CDSUNIT_TEST_SkipListMap \ - CPPUNIT_TEST(SkipListMap_hp_less_pascal)\ - CPPUNIT_TEST(SkipListMap_hp_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_hp_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_hp_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListMap_dhp_less_pascal)\ - CPPUNIT_TEST(SkipListMap_dhp_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_dhp_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_dhp_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpi_less_pascal)\ - CPPUNIT_TEST(SkipListMap_rcu_gpi_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpi_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_rcu_gpi_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpb_less_pascal)\ - CPPUNIT_TEST(SkipListMap_rcu_gpb_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpb_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_rcu_gpb_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpt_less_pascal)\ - CPPUNIT_TEST(SkipListMap_rcu_gpt_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_rcu_gpt_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_rcu_gpt_cmp_xorshift_stat)\ - CDSUNIT_TEST_SkipListMap_RCU_signal - -#define CDSUNIT_DECLARE_SkipListMap_nogc \ - TEST_CASE(tag_SkipListMap, SkipListMap_nogc_less_pascal)\ - TEST_CASE(tag_SkipListMap, SkipListMap_nogc_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListMap, SkipListMap_nogc_less_xorshift)\ - TEST_CASE(tag_SkipListMap, SkipListMap_nogc_cmp_xorshift_stat) - -#define CDSUNIT_TEST_SkipListMap_nogc \ - CPPUNIT_TEST(SkipListMap_nogc_less_pascal)\ - CPPUNIT_TEST(SkipListMap_nogc_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListMap_nogc_less_xorshift)\ - CPPUNIT_TEST(SkipListMap_nogc_cmp_xorshift_stat) - - -// ************************************************************************************** -// EllenBinTreeMap - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal \ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_shb)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_shb_stat)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_sht)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_sht_stat) - -# define CDSUNIT_TEST_EllenBinTreeMap_RCU_signal \ - CPPUNIT_TEST(EllenBinTreeMap_rcu_shb)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_shb_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_sht)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_sht_stat) -#else -# define CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal -# define CDSUNIT_TEST_EllenBinTreeMap_RCU_signal -#endif - -#define CDSUNIT_DECLARE_EllenBinTreeMap \ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp_yield)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_hp_stat)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp_yield)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_dhp_stat)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpi)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpi_stat)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb_yield)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpb_stat)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpt)\ - TEST_CASE(tag_EllenBinTreeMap, EllenBinTreeMap_rcu_gpt_stat)\ - CDSUNIT_DECLARE_EllenBinTreeMap_RCU_signal - -#define CDSUNIT_TEST_EllenBinTreeMap \ - CPPUNIT_TEST(EllenBinTreeMap_hp)\ - CPPUNIT_TEST(EllenBinTreeMap_hp_yield)\ - CPPUNIT_TEST(EllenBinTreeMap_hp_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_dhp)\ - CPPUNIT_TEST(EllenBinTreeMap_dhp_yield)\ - CPPUNIT_TEST(EllenBinTreeMap_dhp_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpi)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpi_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpb)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpb_yield)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpb_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpt)\ - CPPUNIT_TEST(EllenBinTreeMap_rcu_gpt_stat)\ - CDSUNIT_TEST_EllenBinTreeMap_RCU_signal - - -// ************************************************************************************** -// BronsonAVLTreeMap - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_cmp_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_cmp_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_simple) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_simple) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_lazy) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_lazy) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_bounded) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_bounded) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat) \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat) \ - -# define CDSUNIT_TEST_BronsonAVLTreeMap_RCU_signal \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_cmp_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_cmp_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_simple) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_simple) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_lazy) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_lazy) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_bounded) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_bounded) \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat) \ - -#else -# define CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal -# define CDSUNIT_TEST_BronsonAVLTreeMap_RCU_signal -#endif - -#define CDSUNIT_DECLARE_BronsonAVLTreeMap \ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_cmp_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_cmp_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_simple)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_simple)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_simple)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat)\ - TEST_CASE(tag_BronsonAVLTreeMap, BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat)\ - CDSUNIT_DECLARE_BronsonAVLTreeMap_RCU_signal - -#define CDSUNIT_TEST_BronsonAVLTreeMap \ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_cmp_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_cmp_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_cmp_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_simple)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_simple)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_simple)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_lazy)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_lazy)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_lazy)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_bounded)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_bounded)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_bounded)\ - CPPUNIT_TEST(BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat)\ - CDSUNIT_TEST_BronsonAVLTreeMap_RCU_signal - - -// ************************************************************************************** -// StripedMap - -#define CDSUNIT_DECLARE_StripedMap_common \ - TEST_CASE(tag_StripedMap, StripedMap_list) \ - TEST_CASE(tag_StripedMap, StripedMap_map) \ - TEST_CASE(tag_StripedMap, StripedMap_hashmap) \ - TEST_CASE(tag_StripedMap, StripedMap_boost_unordered_map) - -#define CDSUNIT_TEST_StripedMap_common \ - CPPUNIT_TEST(StripedMap_list) \ - CPPUNIT_TEST(StripedMap_map) \ - CPPUNIT_TEST(StripedMap_hashmap) \ - CPPUNIT_TEST(StripedMap_boost_unordered_map) - -#if BOOST_VERSION >= 104800 -# define CDSUNIT_DECLARE_StripedMap_boost_container \ - TEST_CASE(tag_StripedMap, StripedMap_boost_list) \ - TEST_CASE(tag_StripedMap, StripedMap_slist) \ - TEST_CASE(tag_StripedMap, StripedMap_boost_map) - -# define CDSUNIT_TEST_StripedMap_boost_container \ - CPPUNIT_TEST(StripedMap_boost_list) \ - CPPUNIT_TEST(StripedMap_slist) \ - CPPUNIT_TEST(StripedMap_boost_map) -#else -# define CDSUNIT_DECLARE_StripedMap_boost_container -# define CDSUNIT_TEST_StripedMap_boost_container -#endif - -#if BOOST_VERSION >= 104800 && defined(CDS_UNIT_MAP_TYPES_ENABLE_BOOST_FLAT_CONTAINERS) -# define CDSUNIT_DECLARE_StripedMap_boost_flat_container \ - TEST_CASE(tag_StripedMap, StripedMap_boost_flat_map) - -# define CDSUNIT_TEST_StripedMap_boost_flat_container \ - CPPUNIT_TEST(StripedMap_boost_flat_map) -#else -# define CDSUNIT_DECLARE_StripedMap_boost_flat_container -# define CDSUNIT_TEST_StripedMap_boost_flat_container -#endif - -#define CDSUNIT_DECLARE_StripedMap \ - CDSUNIT_DECLARE_StripedMap_common \ - CDSUNIT_DECLARE_StripedMap_boost_container \ - CDSUNIT_DECLARE_StripedMap_boost_flat_container - -#define CDSUNIT_TEST_StripedMap \ - CDSUNIT_TEST_StripedMap_common \ - CDSUNIT_TEST_StripedMap_boost_container \ - CDSUNIT_TEST_StripedMap_boost_flat_container - - -// ************************************************************************************** -// RefinableMap - -#define CDSUNIT_DECLARE_RefinableMap_common \ - TEST_CASE(tag_StripedMap, RefinableMap_list) \ - TEST_CASE(tag_StripedMap, RefinableMap_map) \ - TEST_CASE(tag_StripedMap, RefinableMap_hashmap) \ - TEST_CASE(tag_StripedMap, RefinableMap_boost_unordered_map) - -#define CDSUNIT_TEST_RefinableMap_common \ - CPPUNIT_TEST(RefinableMap_list) \ - CPPUNIT_TEST(RefinableMap_map) \ - CPPUNIT_TEST(RefinableMap_hashmap) \ - CPPUNIT_TEST(RefinableMap_boost_unordered_map) - -#if BOOST_VERSION >= 104800 -# define CDSUNIT_DECLARE_RefinableMap_boost_container \ - TEST_CASE(tag_StripedMap, RefinableMap_boost_list) \ - TEST_CASE(tag_StripedMap, RefinableMap_slist) \ - TEST_CASE(tag_StripedMap, RefinableMap_boost_map) - -# define CDSUNIT_TEST_RefinableMap_boost_container \ - CPPUNIT_TEST(RefinableMap_boost_list) \ - CPPUNIT_TEST(RefinableMap_slist) \ - CPPUNIT_TEST(RefinableMap_boost_map) -#else -# define CDSUNIT_DECLARE_RefinableMap_boost_container -# define CDSUNIT_TEST_RefinableMap_boost_container -#endif - -#if BOOST_VERSION >= 104800 && defined(CDS_UNIT_MAP_TYPES_ENABLE_BOOST_FLAT_CONTAINERS) -# define CDSUNIT_DECLARE_RefinableMap_boost_flat_container \ - TEST_CASE(tag_StripedMap, RefinableMap_boost_flat_map) - -# define CDSUNIT_TEST_RefinableMap_boost_flat_container \ - CPPUNIT_TEST(RefinableMap_boost_flat_map) -#else -# define CDSUNIT_DECLARE_RefinableMap_boost_flat_container -# define CDSUNIT_TEST_RefinableMap_boost_flat_container -#endif - -#define CDSUNIT_DECLARE_RefinableMap \ - CDSUNIT_DECLARE_RefinableMap_common \ - CDSUNIT_DECLARE_RefinableMap_boost_container \ - CDSUNIT_DECLARE_RefinableMap_boost_flat_container - -#define CDSUNIT_TEST_RefinableMap \ - CDSUNIT_TEST_RefinableMap_common \ - CDSUNIT_TEST_RefinableMap_boost_container \ - CDSUNIT_TEST_RefinableMap_boost_flat_container - - -// ************************************************************************************** -// CuckooMap - -#define CDSUNIT_DECLARE_CuckooMap \ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_unord)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_ord)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_unord)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_ord)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_unord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_ord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_unord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_ord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_unord)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_ord)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_unord)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_ord) \ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_unord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_ord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_unord_stat)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_ord_stat) \ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_unord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_list_ord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_unord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooStripedMap_vector_ord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_unord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_list_ord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_unord_storehash)\ - TEST_CASE(tag_CuckooMap, CuckooRefinableMap_vector_ord_storehash) - -#define CDSUNIT_TEST_CuckooMap \ - CPPUNIT_TEST(CuckooStripedMap_list_unord)\ - CPPUNIT_TEST(CuckooStripedMap_list_unord_stat)\ - CPPUNIT_TEST(CuckooStripedMap_list_unord_storehash)\ - CPPUNIT_TEST(CuckooStripedMap_list_ord)\ - CPPUNIT_TEST(CuckooStripedMap_list_ord_stat)\ - CPPUNIT_TEST(CuckooStripedMap_list_ord_storehash)\ - CPPUNIT_TEST(CuckooStripedMap_vector_unord)\ - CPPUNIT_TEST(CuckooStripedMap_vector_unord_stat)\ - CPPUNIT_TEST(CuckooStripedMap_vector_unord_storehash)\ - CPPUNIT_TEST(CuckooStripedMap_vector_ord)\ - CPPUNIT_TEST(CuckooStripedMap_vector_ord_stat)\ - CPPUNIT_TEST(CuckooStripedMap_vector_ord_storehash)\ - CPPUNIT_TEST(CuckooRefinableMap_list_unord)\ - CPPUNIT_TEST(CuckooRefinableMap_list_unord_stat)\ - CPPUNIT_TEST(CuckooRefinableMap_list_unord_storehash)\ - CPPUNIT_TEST(CuckooRefinableMap_list_ord)\ - CPPUNIT_TEST(CuckooRefinableMap_list_ord_stat)\ - CPPUNIT_TEST(CuckooRefinableMap_list_ord_storehash)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_unord)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_unord_stat)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_unord_storehash)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_ord)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_ord_stat)\ - CPPUNIT_TEST(CuckooRefinableMap_vector_ord_storehash) - - -// ************************************************************************************** -// FeldmanHashMap - - -// fixed-sized key - no hash function is necessary - -#undef CDSUNIT_DECLARE_FeldmanHashMap_fixed -#undef CDSUNIT_DECLARE_FeldmanHashMap_fixed_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_fixed -#undef CDSUNIT_TEST_FeldmanHashMap_fixed_RCU_Signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashMap_fixed_RCU_Signal \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_fixed_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_fixed_stat) \ - -# define CDSUNIT_TEST_FeldmanHashMap_fixed_RCU_Signal \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_fixed_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashMap_fixed_RCU_Signal -# define CDSUNIT_TEST_FeldmanHashMap_fixed_RCU_Signal -#endif - - -#define CDSUNIT_DECLARE_FeldmanHashMap_fixed \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_fixed_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_fixed_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_fixed_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_fixed_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_fixed) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_fixed_stat) \ - CDSUNIT_DECLARE_FeldmanHashMap_fixed_RCU_Signal - -#define CDSUNIT_TEST_FeldmanHashMap_fixed \ - CPPUNIT_TEST(FeldmanHashMap_hp_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_hp_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_fixed) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_fixed_stat) \ - CDSUNIT_TEST_FeldmanHashMap_fixed_RCU_Signal - -// std::hash - -#undef CDSUNIT_DECLARE_FeldmanHashMap_stdhash -#undef CDSUNIT_DECLARE_FeldmanHashMap_stdhash_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_stdhash -#undef CDSUNIT_TEST_FeldmanHashMap_stdhash_RCU_Signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashMap_stdhash_RCU_Signal \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_stdhash_stat) \ - -# define CDSUNIT_TEST_FeldmanHashMap_stdhash_RCU_Signal \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_stdhash_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashMap_stdhash_RCU_Signal -# define CDSUNIT_TEST_FeldmanHashMap_stdhash_RCU_Signal -#endif - - -#define CDSUNIT_DECLARE_FeldmanHashMap_stdhash \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_stdhash) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_stdhash_stat) \ - CDSUNIT_DECLARE_FeldmanHashMap_stdhash_RCU_Signal - -#define CDSUNIT_TEST_FeldmanHashMap_stdhash \ - CPPUNIT_TEST(FeldmanHashMap_hp_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_hp_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_stdhash) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_stdhash_stat) \ - CDSUNIT_TEST_FeldmanHashMap_stdhash_RCU_Signal - -// CityHash - only for 64bit - -#undef CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_city128_RCU_Signal - -#if CDS_BUILD_BITS == 64 - -#undef CDSUNIT_DECLARE_FeldmanHashMap_city64 -#undef CDSUNIT_DECLARE_FeldmanHashMap_city64_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_city64 -#undef CDSUNIT_TEST_FeldmanHashMap_city64_RCU_Signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashMap_city64_RCU_Signal \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_city64_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_city64_stat) \ - -# define CDSUNIT_TEST_FeldmanHashMap_city64_RCU_Signal \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_city64) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_city64_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_city64) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_city64_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashMap_city64_RCU_Signal -# define CDSUNIT_TEST_FeldmanHashMap_city64_RCU_Signal -#endif - - -#define CDSUNIT_DECLARE_FeldmanHashMap_city64 \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_city64_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_city64_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_city64_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_city64_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_city64) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_city64_stat) \ - CDSUNIT_DECLARE_FeldmanHashMap_city64_RCU_Signal - -#define CDSUNIT_TEST_FeldmanHashMap_city64 \ - CPPUNIT_TEST(FeldmanHashMap_hp_city64) \ - CPPUNIT_TEST(FeldmanHashMap_hp_city64_stat) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_city64) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_city64_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_city64) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_city64_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_city64) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_city64_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_city64) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_city64_stat) \ - CDSUNIT_TEST_FeldmanHashMap_city64_RCU_Signal - -#undef CDSUNIT_DECLARE_FeldmanHashMap_city128 -#undef CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_city128 -#undef CDSUNIT_TEST_FeldmanHashMap_city128_RCU_Signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_city128_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_city128_stat) \ - -# define CDSUNIT_TEST_FeldmanHashMap_city128_RCU_Signal \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_city128) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_city128_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_city128) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_city128_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal -# define CDSUNIT_TEST_FeldmanHashMap_city128_RCU_Signal -#endif - - -#define CDSUNIT_DECLARE_FeldmanHashMap_city128 \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_city128_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_city128_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_city128_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_city128_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_city128) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_city128_stat) \ - CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal - -#define CDSUNIT_TEST_FeldmanHashMap_city128 \ - CPPUNIT_TEST(FeldmanHashMap_hp_city128) \ - CPPUNIT_TEST(FeldmanHashMap_hp_city128_stat) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_city128) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_city128_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_city128) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_city128_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_city128) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_city128_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_city128) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_city128_stat) \ - CDSUNIT_TEST_FeldmanHashMap_city128_RCU_Signal - -#define CDSUNIT_DECLARE_FeldmanHashMap_city \ - CDSUNIT_DECLARE_FeldmanHashMap_city64 \ - CDSUNIT_DECLARE_FeldmanHashMap_city128 - -#define CDSUNIT_TEST_FeldmanHashMap_city \ - CDSUNIT_TEST_FeldmanHashMap_city64 \ - CDSUNIT_TEST_FeldmanHashMap_city128 - -#else // 32bit -# define CDSUNIT_DECLARE_FeldmanHashMap_city -# define CDSUNIT_TEST_FeldmanHashMap_city -#endif // #if CDS_BUILD_BITS == 64 - -#undef CDSUNIT_DECLARE_FeldmanHashMap -#undef CDSUNIT_TEST_FeldmanHashMap - -#define CDSUNIT_DECLARE_FeldmanHashMap \ - CDSUNIT_DECLARE_FeldmanHashMap_fixed \ - CDSUNIT_DECLARE_FeldmanHashMap_stdhash \ - CDSUNIT_DECLARE_FeldmanHashMap_city \ - -#define CDSUNIT_TEST_FeldmanHashMap \ - CDSUNIT_TEST_FeldmanHashMap_fixed \ - CDSUNIT_TEST_FeldmanHashMap_stdhash \ - CDSUNIT_TEST_FeldmanHashMap_city - diff --git a/tests/unit/map2/map_delodd.cpp b/tests/unit/map2/map_delodd.cpp deleted file mode 100644 index 790cb957..00000000 --- a/tests/unit/map2/map_delodd.cpp +++ /dev/null @@ -1,74 +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 "map2/map_delodd.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_DelOdd ); - - void Map_DelOdd::setUpParams( const CppUnitMini::TestCfg& cfg ) { - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize ); - c_nInsThreadCount = cfg.getSizeT("InsThreadCount", c_nInsThreadCount ); - c_nDelThreadCount = cfg.getSizeT("DelThreadCount", c_nDelThreadCount ); - c_nExtractThreadCount = cfg.getSizeT("ExtractThreadCount", c_nExtractThreadCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize ); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize ); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold ); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nInsThreadCount == 0 ) - c_nInsThreadCount = cds::OS::topology::processor_count(); - if ( c_nDelThreadCount == 0 && c_nExtractThreadCount == 0 ) { - c_nExtractThreadCount = cds::OS::topology::processor_count() / 2; - c_nDelThreadCount = cds::OS::topology::processor_count() - c_nExtractThreadCount; - } - - m_arrInsert.resize( c_nMapSize ); - m_arrRemove.resize( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - m_arrInsert[i] = i; - m_arrRemove[i] = i; - } - shuffle( m_arrInsert.begin(), m_arrInsert.end()); - shuffle( m_arrRemove.begin(), m_arrRemove.end()); - } - - void Map_DelOdd::endTestCase() - { - m_arrInsert.resize(0); - m_arrRemove.resize(0); - } - -} // namespace map2 diff --git a/tests/unit/map2/map_delodd.h b/tests/unit/map2/map_delodd.h deleted file mode 100644 index 354884fa..00000000 --- a/tests/unit/map2/map_delodd.h +++ /dev/null @@ -1,829 +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 "cppunit/thread.h" -#include "map2/map_type.h" -#include - -namespace map2 { - -# define TEST_CASE(TAG, X) void X(); - - namespace { - struct key_thread - { - uint32_t nKey; - uint16_t nThread; - uint16_t pad_; - - key_thread( size_t key, size_t threadNo ) - : nKey( static_cast(key)) - , nThread( static_cast(threadNo)) - , pad_(0) - {} - - key_thread() - {} - }; - } - - template <> - struct cmp { - int operator ()(key_thread const& k1, key_thread const& k2) const - { - if ( k1.nKey < k2.nKey ) - return -1; - if ( k1.nKey > k2.nKey ) - return 1; - if ( k1.nThread < k2.nThread ) - return -1; - if ( k1.nThread > k2.nThread ) - return 1; - return 0; - } - int operator ()(key_thread const& k1, size_t k2) const - { - if ( k1.nKey < k2 ) - return -1; - if ( k1.nKey > k2 ) - return 1; - return 0; - } - int operator ()(size_t k1, key_thread const& k2) const - { - if ( k1 < k2.nKey ) - return -1; - if ( k1 > k2.nKey ) - return 1; - return 0; - } - }; - -} // namespace map2 - -namespace std { - template <> - struct less - { - bool operator()(map2::key_thread const& k1, map2::key_thread const& k2) const - { - if ( k1.nKey <= k2.nKey ) - return k1.nKey < k2.nKey || k1.nThread < k2.nThread; - return false; - } - }; - - template <> - struct hash - { - typedef size_t result_type; - typedef map2::key_thread argument_type; - - size_t operator()( map2::key_thread const& k ) const - { - return std::hash()(k.nKey); - } - size_t operator()( size_t k ) const - { - return std::hash()(k); - } - }; -} // namespace std - -namespace boost { - inline size_t hash_value( map2::key_thread const& k ) - { - return std::hash()( k.nKey ); - } - - template <> - struct hash - { - typedef size_t result_type; - typedef map2::key_thread argument_type; - - size_t operator()(map2::key_thread const& k) const - { - return boost::hash()( k.nKey ); - } - size_t operator()(size_t k) const - { - return boost::hash()( k ); - } - }; -} // namespace boost - -namespace map2 { - - class Map_DelOdd: public CppUnitMini::TestCase - { - public: - size_t c_nInsThreadCount = 4; // insert thread count - size_t c_nDelThreadCount = 4; // delete thread count - size_t c_nExtractThreadCount = 4; // extract thread count - size_t c_nMapSize = 1000000; // max map size - size_t c_nMaxLoadFactor = 8; // maximum load factor - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (0 - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - bool c_bPrintGCState = true; - - size_t c_nLoadFactor; // current load factor - - private: - std::vector m_arrInsert; - std::vector m_arrRemove; - - protected: - typedef key_thread key_type; - typedef size_t value_type; - typedef std::pair pair_type; - - atomics::atomic m_nInsThreadCount; - - // Inserts keys from [0..N) - template - class InsertThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual InsertThread * clone() - { - return new InsertThread( *this ); - } - - struct ensure_func - { - template - void operator()( bool /*bNew*/, Q const& ) - {} - template - void operator()( bool /*bNew*/, Q const&, V& ) - {} - - // FeldmanHashMap - template - void operator()( Q&, Q*) - {} - }; - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - InsertThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - InsertThread( InsertThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - std::vector& arrData = getTest().m_arrInsert; - for ( size_t i = 0; i < arrData.size(); ++i ) { - if ( rMap.insert( key_type( arrData[i], m_nThreadNo ))) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - - ensure_func f; - for ( size_t i = arrData.size() - 1; i > 0; --i ) { - if ( arrData[i] & 1 ) { - rMap.update( key_type( arrData[i], m_nThreadNo ), f ); - } - } - - getTest().m_nInsThreadCount.fetch_sub( 1, atomics::memory_order_acquire ); - } - }; - - struct key_equal { - bool operator()( key_type const& k1, key_type const& k2 ) const - { - return k1.nKey == k2.nKey; - } - bool operator()( size_t k1, key_type const& k2 ) const - { - return k1 == k2.nKey; - } - bool operator()( key_type const& k1, size_t k2 ) const - { - return k1.nKey == k2; - } - }; - - struct key_less { - bool operator()( key_type const& k1, key_type const& k2 ) const - { - return k1.nKey < k2.nKey; - } - bool operator()( size_t k1, key_type const& k2 ) const - { - return k1 < k2.nKey; - } - bool operator()( key_type const& k1, size_t k2 ) const - { - return k1.nKey < k2; - } - - typedef key_equal equal_to; - }; - - // Deletes odd keys from [0..N) - template - class DeleteThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual DeleteThread * clone() - { - return new DeleteThread( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - DeleteThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - DeleteThread( DeleteThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct eraser { - static bool erase(MapType& map, size_t key, size_t /*insThread*/) - { - return map.erase_with(key, key_less()); - } - }; - - template - struct eraser - { - static bool erase(MapType& map, size_t key, size_t insThread) - { - return map.erase(key_type(key, insThread)); - } - }; - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - - for ( size_t pass = 0; pass < 2; pass++ ) { - std::vector& arrData = getTest().m_arrRemove; - if ( m_nThreadNo & 1 ) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = 0; i < arrData.size(); ++i ) { - if ( arrData[i] & 1 ) { - if ( Map::c_bEraseExactKey ) { - for (size_t key = 0; key < nInsThreadCount; ++key) { - if ( eraser::erase( rMap, arrData[i], key )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - if ( eraser::erase(rMap, arrData[i], 0)) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = arrData.size() - 1; i > 0; --i ) { - if ( arrData[i] & 1 ) { - if ( Map::c_bEraseExactKey ) { - for (size_t key = 0; key < nInsThreadCount; ++key) { - if (eraser::erase(rMap, arrData[i], key)) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - if (eraser::erase(rMap, arrData[i], 0)) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - } - }; - - // Deletes odd keys from [0..N) - template - class ExtractThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual ExtractThread * clone() - { - return new ExtractThread( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - ExtractThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - ExtractThread( ExtractThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct extractor { - static typename Map::guarded_ptr extract(MapType& map, size_t key, size_t /*insThread*/) - { - return map.extract_with(key, key_less()); - } - }; - - template - struct extractor - { - static typename Map::guarded_ptr extract(MapType& map, size_t key, size_t insThread) - { - return map.extract(key_type(key, insThread)); - } - }; - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - typename Map::guarded_ptr gp; - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - - for ( size_t pass = 0; pass < 2; ++pass ) { - std::vector& arrData = getTest().m_arrRemove; - if ( m_nThreadNo & 1 ) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = 0; i < arrData.size(); ++i ) { - if ( arrData[i] & 1 ) { - gp = extractor< Map, Map::c_bEraseExactKey >::extract( rMap, arrData[i], k ); - if ( gp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - gp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = arrData.size() - 1; i > 0; --i ) { - if ( arrData[i] & 1 ) { - gp = extractor< Map, Map::c_bEraseExactKey >::extract( rMap, arrData[i], k); - if ( gp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - gp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - } - }; - - template - class ExtractThread< cds::urcu::gc, Map > : public CppUnitMini::TestThread - { - Map& m_Map; - - virtual ExtractThread * clone() - { - return new ExtractThread( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - ExtractThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - ExtractThread( ExtractThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct extractor { - static typename Map::exempt_ptr extract( MapType& map, size_t key, size_t /*insThread*/ ) - { - return map.extract_with( key, key_less()); - } - }; - - template - struct extractor - { - static typename Map::exempt_ptr extract(MapType& map, size_t key, size_t insThread) - { - return map.extract( key_type(key, insThread)); - } - }; - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - typename Map::exempt_ptr xp; - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - - std::vector& arrData = getTest().m_arrRemove; - if ( m_nThreadNo & 1 ) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = 0; i < arrData.size(); ++i ) { - if ( arrData[i] & 1 ) { - if ( Map::c_bExtractLockExternal ) { - { - typename Map::rcu_lock l; - xp = extractor::extract( rMap, arrData[i], k ); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - xp = extractor::extract( rMap, arrData[i], k); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - xp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - for ( size_t i = arrData.size() - 1; i > 0; --i ) { - if ( arrData[i] & 1 ) { - if ( Map::c_bExtractLockExternal ) { - { - typename Map::rcu_lock l; - xp = extractor::extract(rMap, arrData[i], k); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - xp = extractor::extract(rMap, arrData[i], k); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - xp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - }; - - protected: - template - void do_test() - { - Map testMap( *this ); - do_test_with( testMap ); - } - - template - void do_test_extract() - { - Map testMap( *this ); - do_test_extract_with( testMap ); - } - - template - void do_test_with( Map& testMap ) - { - typedef InsertThread insert_thread; - typedef DeleteThread delete_thread; - - m_nInsThreadCount.store( c_nInsThreadCount, atomics::memory_order_release ); - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new insert_thread( pool, testMap ), c_nInsThreadCount ); - pool.add( new delete_thread( pool, testMap ), c_nDelThreadCount ? c_nDelThreadCount : cds::OS::topology::processor_count()); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration()); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - insert_thread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - delete_thread * p = static_cast( *it ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - ); - CPPUNIT_CHECK( nInsertSuccess == c_nMapSize * c_nInsThreadCount ); - CPPUNIT_CHECK( nInsertFailed == 0 ); - - analyze( testMap ); - } - - template - void do_test_extract_with( Map& testMap ) - { - typedef InsertThread insert_thread; - typedef DeleteThread delete_thread; - typedef ExtractThread< typename Map::gc, Map > extract_thread; - - m_nInsThreadCount.store( c_nInsThreadCount, atomics::memory_order_release ); - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new insert_thread( pool, testMap ), c_nInsThreadCount ); - if ( c_nDelThreadCount ) - pool.add( new delete_thread( pool, testMap ), c_nDelThreadCount ); - if ( c_nExtractThreadCount ) - pool.add( new extract_thread( pool, testMap ), c_nExtractThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration()); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nExtractSuccess = 0; - size_t nExtractFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - insert_thread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - delete_thread * p = dynamic_cast( *it ); - if ( p ) { - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - else { - extract_thread * pExtract = dynamic_cast( *it ); - assert( pExtract ); - nExtractSuccess += pExtract->m_nDeleteSuccess; - nExtractFailed += pExtract->m_nDeleteFailed; - } - } - } - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - << " Extract=" << nExtractSuccess << '/' << nExtractFailed << "\n\t" - ); - CPPUNIT_CHECK( nInsertSuccess == c_nMapSize * c_nInsThreadCount ); - CPPUNIT_CHECK( nInsertFailed == 0 ); - - analyze( testMap ); - } - - template - void analyze( Map& testMap ) - { - cds::OS::Timer timer; - - // All even keys must be in the map - { - size_t nErrorCount = 0; - CPPUNIT_MSG( " Check even keys..." ); - for ( size_t n = 0; n < c_nMapSize; n +=2 ) { - for ( size_t i = 0; i < c_nInsThreadCount; ++i ) { - if ( !testMap.contains( key_type(n, i))) { - if ( ++nErrorCount < 10 ) { - CPPUNIT_MSG( "key " << n << "-" << i << " is not found!"); - } - } - } - } - CPPUNIT_CHECK_EX( nErrorCount == 0, "Totals: " << nErrorCount << " keys is not found"); - } - - print_stat(testMap); - - check_before_cleanup( testMap ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - testMap.clear(); - CPPUNIT_MSG( " Duration=" << timer.duration()); - CPPUNIT_CHECK_EX( testMap.empty(), ((long long) testMap.size())); - - additional_check( testMap ); - print_stat( testMap ); - - additional_cleanup( testMap ); - } - - template - void run_test() - { - static_assert( Map::c_bExtractSupported, "Map class must support extract() method" ); - - CPPUNIT_MSG( "Thread count: insert=" << c_nInsThreadCount - << ", delete=" << c_nDelThreadCount - << ", extract=" << c_nExtractThreadCount - << "; set size=" << c_nMapSize - ); - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - do_test_extract(); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else - do_test_extract(); - } - - template - void run_test_no_extract() - { - static_assert( !Map::c_bExtractSupported, "Map class must not support extract() method" ); - - CPPUNIT_MSG( "Insert thread count=" << c_nInsThreadCount - << " delete thread count=" << c_nDelThreadCount - << " set size=" << c_nMapSize - ); - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - do_test(); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else - do_test(); - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - virtual void endTestCase(); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - //CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_CuckooMap - - CPPUNIT_TEST_SUITE_(Map_DelOdd, "map_delodd") - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - //CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CPPUNIT_TEST_SUITE_END(); - - // Not implemented yet - ////CDSUNIT_DECLARE_StripedMap - ////CDSUNIT_DECLARE_RefinableMap - ////CDSUNIT_DECLARE_StdMap - }; -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_bronsonavltree.cpp b/tests/unit/map2/map_delodd_bronsonavltree.cpp deleted file mode 100644 index 1a05c862..00000000 --- a/tests/unit/map2/map_delodd_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_cuckoo.cpp b/tests/unit/map2/map_delodd_cuckoo.cpp deleted file mode 100644 index e57d5fcf..00000000 --- a/tests/unit/map2/map_delodd_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test_no_extract::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_ellentree.cpp b/tests/unit/map2/map_delodd_ellentree.cpp deleted file mode 100644 index f41fa345..00000000 --- a/tests/unit/map2/map_delodd_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_feldmanhashmap.cpp b/tests/unit/map2/map_delodd_feldmanhashmap.cpp deleted file mode 100644 index 69983740..00000000 --- a/tests/unit/map2/map_delodd_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_delodd.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - //CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_michael.cpp b/tests/unit/map2/map_delodd_michael.cpp deleted file mode 100644 index af674016..00000000 --- a/tests/unit/map2/map_delodd_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_skip.cpp b/tests/unit/map2/map_delodd_skip.cpp deleted file mode 100644 index 21f904d6..00000000 --- a/tests/unit/map2/map_delodd_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_delodd_split.cpp b/tests/unit/map2/map_delodd_split.cpp deleted file mode 100644 index 992cd3de..00000000 --- a/tests/unit/map2/map_delodd_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_delodd.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_DelOdd::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_find_int.cpp b/tests/unit/map2/map_find_int.cpp deleted file mode 100644 index 85a89c93..00000000 --- a/tests/unit/map2/map_find_int.cpp +++ /dev/null @@ -1,84 +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 "map2/map_find_int.h" - -// find int test in map in mutithreaded mode -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_int ); - - void Map_find_int::generateSequence() - { - size_t nPercent = c_nPercentExists; - - if ( nPercent > 100 ) - nPercent = 100; - else if ( nPercent < 1 ) - nPercent = 1; - - m_nRealMapSize = 0; - - m_Arr.resize( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - m_Arr[i].nKey = i * 13; - m_Arr[i].bExists = CppUnitMini::Rand( 100 ) <= nPercent; - if ( m_Arr[i].bExists ) - ++m_nRealMapSize; - } - shuffle( m_Arr.begin(), m_Arr.end() ); - } - - void Map_find_int::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize); - c_nPercentExists = cfg.getSizeT("PercentExists", c_nPercentExists); - c_nPassCount = cfg.getSizeT("PassCount", c_nPassCount); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency(); - - CPPUNIT_MSG( "Generating test data..."); - cds::OS::Timer timer; - generateSequence(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_MSG( "Map size=" << m_nRealMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" ); - CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount ); - } -} // namespace map diff --git a/tests/unit/map2/map_find_int.h b/tests/unit/map2/map_find_int.h deleted file mode 100644 index 37939aa4..00000000 --- a/tests/unit/map2/map_find_int.h +++ /dev/null @@ -1,282 +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. -*/ - -// defines concurrent access to map::nonconcurrent_iterator::Sequence::TValue::nAccess field - -#include "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -// find int test in map in mutithreaded mode -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_find_int: public CppUnitMini::TestCase - { - public: - size_t c_nThreadCount = 8; // thread count - size_t c_nMapSize = 10000000; // map size (count of searching item) - size_t c_nPercentExists = 50; // percent of existing keys in searching sequence - size_t c_nPassCount = 2; - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nLoadFactor; // current load factor - - private: - typedef size_t key_type; - struct value_type { - key_type nKey ; // key - bool bExists ; // true - key in map, false - key not in map - }; - - typedef std::vector ValueVector; - ValueVector m_Arr; - size_t m_nRealMapSize; - - void generateSequence(); - - template - static bool check_result( Iterator const& it, Map const& map ) - { - return it != map.end(); - } - template - static bool check_result( bool b, Map const& ) - { - return b; - } - - template - class TestThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual TestThread * clone() - { - return new TestThread( *this ); - } - public: - struct Stat { - size_t nSuccess; - size_t nFailed; - - Stat() - : nSuccess(0) - , nFailed(0) - {} - }; - - Stat m_KeyExists; - Stat m_KeyNotExists; - - public: - TestThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - TestThread( TestThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_find_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - ValueVector& arr = getTest().m_Arr; - size_t const nPassCount = getTest().c_nPassCount; - - Map& rMap = m_Map; - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - if ( m_nThreadNo & 1 ) { - ValueVector::const_iterator itEnd = arr.end(); - for ( ValueVector::const_iterator it = arr.begin(); it != itEnd; ++it ) { - auto bFound = rMap.contains( it->nKey ); - if ( it->bExists ) { - if ( check_result( bFound, rMap )) - ++m_KeyExists.nSuccess; - else { - //rMap.find( it->nKey ); - ++m_KeyExists.nFailed; - } - } - else { - if ( check_result( bFound, rMap )) { - //rMap.find( it->nKey ); - ++m_KeyNotExists.nFailed; - } - else - ++m_KeyNotExists.nSuccess; - } - } - } - else { - ValueVector::const_reverse_iterator itEnd = arr.rend(); - for ( ValueVector::const_reverse_iterator it = arr.rbegin(); it != itEnd; ++it ) { - auto bFound = rMap.contains( it->nKey ); - if ( it->bExists ) { - if ( check_result( bFound, rMap )) - ++m_KeyExists.nSuccess; - else { - //rMap.find( it->nKey ); - ++m_KeyExists.nFailed; - } - } - else { - if ( check_result( bFound, rMap )) { - //rMap.find( it->nKey ); - ++m_KeyNotExists.nFailed; - } - else - ++m_KeyNotExists.nSuccess; - } - } - } - } - } - }; - - protected: - - template - void find_int_test( Map& testMap ) - { - typedef TestThread Thread; - cds::OS::Timer timer; - - // Fill the map - CPPUNIT_MSG( " Fill map with " << m_Arr.size() << " items..."); - timer.reset(); - for ( size_t i = 0; i < m_Arr.size(); ++i ) { - if ( m_Arr[i].bExists ) { - CPPUNIT_ASSERT( check_result( testMap.insert( m_Arr[i].nKey, m_Arr[i] ), testMap )); - } - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - CPPUNIT_MSG( " Searching..."); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new Thread( pool, testMap ), c_nThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - Thread * pThread = static_cast( *it ); - CPPUNIT_CHECK( pThread->m_KeyExists.nFailed == 0 ); - CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == m_nRealMapSize * c_nPassCount ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nFailed == 0 ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - m_nRealMapSize) * c_nPassCount ); - } - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - find_int_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - find_int_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - - public: - Map_find_int() - : c_nLoadFactor(2) - {} - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - CDSUNIT_DECLARE_StdMap_NoLock - - CPPUNIT_TEST_SUITE_(Map_find_int, "map_find_int") - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_MichaelMap_nogc - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SplitList_nogc - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_SkipListMap_nogc - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CDSUNIT_TEST_StdMap_NoLock - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map diff --git a/tests/unit/map2/map_find_int_bronsonavltree.cpp b/tests/unit/map2/map_find_int_bronsonavltree.cpp deleted file mode 100644 index bb9a72b5..00000000 --- a/tests/unit/map2/map_find_int_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_int.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_cuckoo.cpp b/tests/unit/map2/map_find_int_cuckoo.cpp deleted file mode 100644 index 2e183680..00000000 --- a/tests/unit/map2/map_find_int_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_int.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_ellentree.cpp b/tests/unit/map2/map_find_int_ellentree.cpp deleted file mode 100644 index 1ac5e106..00000000 --- a/tests/unit/map2/map_find_int_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_int.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_feldmanhashmap.cpp b/tests/unit/map2/map_find_int_feldmanhashmap.cpp deleted file mode 100644 index 2bd135cb..00000000 --- a/tests/unit/map2/map_find_int_feldmanhashmap.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_int.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_michael.cpp b/tests/unit/map2/map_find_int_michael.cpp deleted file mode 100644 index 0db3407f..00000000 --- a/tests/unit/map2/map_find_int_michael.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_int.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_skip.cpp b/tests/unit/map2/map_find_int_skip.cpp deleted file mode 100644 index 09e6d2ca..00000000 --- a/tests/unit/map2/map_find_int_skip.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_int.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_split.cpp b/tests/unit/map2/map_find_int_split.cpp deleted file mode 100644 index 425714bd..00000000 --- a/tests/unit/map2/map_find_int_split.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_int.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_std.cpp b/tests/unit/map2/map_find_int_std.cpp deleted file mode 100644 index 466d333f..00000000 --- a/tests/unit/map2/map_find_int_std.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_int.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap - CDSUNIT_DECLARE_StdMap_NoLock -} // namespace map2 diff --git a/tests/unit/map2/map_find_int_striped.cpp b/tests/unit/map2/map_find_int_striped.cpp deleted file mode 100644 index 8d47ca87..00000000 --- a/tests/unit/map2/map_find_int_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_int.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_string.cpp b/tests/unit/map2/map_find_string.cpp deleted file mode 100644 index ad77d934..00000000 --- a/tests/unit/map2/map_find_string.cpp +++ /dev/null @@ -1,86 +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 "map2/map_find_string.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_string ); - - void Map_find_string::generateSequence() - { - size_t nPercent = c_nPercentExists; - - if ( nPercent > 100 ) - nPercent = 100; - else if ( nPercent < 1 ) - nPercent = 1; - - std::vector const& arrString = CppUnitMini::TestCase::getTestStrings(); - size_t nSize = arrString.size(); - if ( nSize > c_nMapSize ) - nSize = c_nMapSize; - m_Arr.reserve( nSize ); - - nSize = 0; - for ( size_t i = 0; i < nSize && i < arrString.size(); ++i ) { - bool bExists = CppUnitMini::Rand( 100 ) <= nPercent; - m_Arr.push_back( { &arrString.at(i), bExists } ); - if ( bExists ) - ++nSize; - } - c_nMapSize = nSize; - } - - void Map_find_string::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize); - c_nPercentExists = cfg.getSizeT("PercentExists", c_nPercentExists); - c_nPassCount = cfg.getSizeT("PassCount", c_nPassCount); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency(); - - CPPUNIT_MSG( "Generating test data...\n"); - cds::OS::Timer timer; - generateSequence(); - CPPUNIT_MSG( " Duration=" << timer.duration() << "\n" ); - - } -} // namespace map2 diff --git a/tests/unit/map2/map_find_string.h b/tests/unit/map2/map_find_string.h deleted file mode 100644 index e182ff6a..00000000 --- a/tests/unit/map2/map_find_string.h +++ /dev/null @@ -1,274 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_find_string: public CppUnitMini::TestCase - { - public: - size_t c_nThreadCount = 8; // thread count - size_t c_nMapSize = 10000000; // map size (count of searching item) - size_t c_nPercentExists = 50; // percent of existing keys in searching sequence - size_t c_nPassCount = 2; - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nLoadFactor; // current load factor - - private: - typedef std::string key_type; - struct value_type { - std::string const * pKey; - bool bExists ; // true - key in map, false - key not in map - }; - - typedef std::vector ValueVector; - ValueVector m_Arr; - - template - static bool check_result( Iterator const& it, Map const& map ) - { - return it != map.end(); - } - template - static bool check_result( bool b, Map const& ) - { - return b; - } - - template - class TestThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual TestThread * clone() - { - return new TestThread( *this ); - } - public: - struct Stat { - size_t nSuccess; - size_t nFailed; - - Stat() - : nSuccess(0) - , nFailed(0) - {} - }; - - Stat m_KeyExists; - Stat m_KeyNotExists; - - public: - TestThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - TestThread( TestThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_find_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - ValueVector& arr = getTest().m_Arr; - size_t const nPassCount = getTest().c_nPassCount; - - Map& rMap = m_Map; - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - if ( m_nThreadNo & 1 ) { - ValueVector::const_iterator itEnd = arr.end(); - for ( ValueVector::const_iterator it = arr.begin(); it != itEnd; ++it ) { - auto bFound = rMap.contains( *(it->pKey) ); - if ( it->bExists ) { - if ( check_result(bFound, rMap)) - ++m_KeyExists.nSuccess; - else - ++m_KeyExists.nFailed; - } - else { - if ( check_result(bFound, rMap)) - ++m_KeyNotExists.nFailed; - else - ++m_KeyNotExists.nSuccess; - } - } - } - else { - ValueVector::const_reverse_iterator itEnd = arr.rend(); - for ( ValueVector::const_reverse_iterator it = arr.rbegin(); it != itEnd; ++it ) { - auto bFound = rMap.contains( *(it->pKey) ); - if ( it->bExists ) { - if ( check_result(bFound, rMap)) - ++m_KeyExists.nSuccess; - else - ++m_KeyExists.nFailed; - } - else { - if ( check_result( bFound, rMap )) - ++m_KeyNotExists.nFailed; - else - ++m_KeyNotExists.nSuccess; - } - } - } - } - } - }; - - public: - Map_find_string() - : c_nLoadFactor( 2 ) - {} - - protected: - - void generateSequence(); - - template - void find_string_test( Map& testMap ) - { - typedef TestThread Thread; - cds::OS::Timer timer; - - CPPUNIT_MSG( "Map size=" << c_nMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" ); - CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount ); - - // Fill the map - CPPUNIT_MSG( " Fill map..."); - timer.reset(); - for ( size_t i = 0; i < m_Arr.size(); ++i ) { - // All keys in arrData are unique, insert() must be successful - if ( m_Arr[i].bExists ) - CPPUNIT_ASSERT( check_result( testMap.insert( *(m_Arr[i].pKey), m_Arr[i] ), testMap )); - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - CPPUNIT_MSG( " Searching..."); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new Thread( pool, testMap ), c_nThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - // Postcondition: the number of success searching == the number of map item - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - Thread * pThread = static_cast( *it ); - CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == c_nMapSize * c_nPassCount ); - CPPUNIT_CHECK( pThread->m_KeyExists.nFailed == 0 ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - c_nMapSize) * c_nPassCount ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nFailed == 0 ); - } - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - find_string_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - find_string_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - CDSUNIT_DECLARE_StdMap_NoLock - - CPPUNIT_TEST_SUITE(Map_find_string) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_MichaelMap_nogc - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SplitList_nogc - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_SkipListMap_nogc - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CDSUNIT_TEST_StdMap_NoLock - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_bronsonavltree.cpp b/tests/unit/map2/map_find_string_bronsonavltree.cpp deleted file mode 100644 index aa668e09..00000000 --- a/tests/unit/map2/map_find_string_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_string.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_cuckoo.cpp b/tests/unit/map2/map_find_string_cuckoo.cpp deleted file mode 100644 index e13deca1..00000000 --- a/tests/unit/map2/map_find_string_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_string.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_ellentree.cpp b/tests/unit/map2/map_find_string_ellentree.cpp deleted file mode 100644 index f6ece459..00000000 --- a/tests/unit/map2/map_find_string_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_string.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_feldmanhashmap.cpp b/tests/unit/map2/map_find_string_feldmanhashmap.cpp deleted file mode 100644 index 25056ff3..00000000 --- a/tests/unit/map2/map_find_string_feldmanhashmap.cpp +++ /dev/null @@ -1,40 +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 "map2/map_find_string.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_michael.cpp b/tests/unit/map2/map_find_string_michael.cpp deleted file mode 100644 index 50d3bdfa..00000000 --- a/tests/unit/map2/map_find_string_michael.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_string.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_skip.cpp b/tests/unit/map2/map_find_string_skip.cpp deleted file mode 100644 index dc2ee6c5..00000000 --- a/tests/unit/map2/map_find_string_skip.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_string.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_split.cpp b/tests/unit/map2/map_find_string_split.cpp deleted file mode 100644 index 1a29d846..00000000 --- a/tests/unit/map2/map_find_string_split.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_string.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_std.cpp b/tests/unit/map2/map_find_string_std.cpp deleted file mode 100644 index c90db990..00000000 --- a/tests/unit/map2/map_find_string_std.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_string.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap - CDSUNIT_DECLARE_StdMap_NoLock -} // namespace map2 diff --git a/tests/unit/map2/map_find_string_striped.cpp b/tests/unit/map2/map_find_string_striped.cpp deleted file mode 100644 index 07c09f2f..00000000 --- a/tests/unit/map2/map_find_string_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_find_string.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_find_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func.cpp b/tests/unit/map2/map_insdel_func.cpp deleted file mode 100644 index 5d627763..00000000 --- a/tests/unit/map2/map_insdel_func.cpp +++ /dev/null @@ -1,54 +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 "map2/map_insdel_func.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_func ); - - void Map_InsDel_func::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nInsertThreadCount = cfg.getULong("InsertThreadCount", static_cast(c_nInsertThreadCount)); - c_nDeleteThreadCount = cfg.getULong("DeleteThreadCount", static_cast(c_nDeleteThreadCount)); - c_nUpdateThreadCount = cfg.getULong("UpdateThreadCount", static_cast(c_nUpdateThreadCount)); - c_nThreadPassCount = cfg.getULong("ThreadPassCount", static_cast(c_nThreadPassCount)); - c_nMapSize = cfg.getULong("MapSize", static_cast(c_nMapSize)); - c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", static_cast(c_nMaxLoadFactor)); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - - c_nCuckooInitialSize = cfg.getULong("CuckooInitialSize", static_cast(c_nCuckooInitialSize) ); - c_nCuckooProbesetSize = cfg.getULong("CuckooProbesetSize", static_cast(c_nCuckooProbesetSize) ); - c_nCuckooProbesetThreshold = cfg.getULong("CuckooProbesetThreshold", static_cast(c_nCuckooProbesetThreshold) ); - - c_nFeldmanMap_HeadBits = cfg.getULong("FeldmanMapHeadBits", static_cast(c_nFeldmanMap_HeadBits) ); - c_nFeldmanMap_ArrayBits = cfg.getULong("FeldmanMapArrayBits", static_cast(c_nFeldmanMap_ArrayBits) ); - - } -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func.h b/tests/unit/map2/map_insdel_func.h deleted file mode 100644 index b00bc538..00000000 --- a/tests/unit/map2/map_insdel_func.h +++ /dev/null @@ -1,607 +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 -#include //unique_lock -#include "map2/map_type.h" -#include "cppunit/thread.h" - -#include -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsDel_func: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 1000000; // map size - size_t c_nInsertThreadCount = 4; // count of insertion thread - size_t c_nDeleteThreadCount = 4; // count of deletion thread - size_t c_nUpdateThreadCount = 4; // count of updating thread - size_t c_nThreadPassCount = 4; // pass count for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nLoadFactor; // current load factor - - private: - typedef size_t key_type; - struct value_type { - size_t nKey; - size_t nData; - size_t nUpdateCall; - atomics::atomic bInitialized; - cds::OS::ThreadId threadId; // inserter thread id - - typedef cds::sync::spin_lock< cds::backoff::pause > lock_type; - mutable lock_type m_access; - - value_type() - : nKey(0) - , nData(0) - , nUpdateCall(0) - , bInitialized( false ) - , threadId( cds::OS::get_current_thread_id()) - {} - - value_type( value_type const& s ) - : nKey(s.nKey) - , nData(s.nData) - , nUpdateCall( s.nUpdateCall ) - , bInitialized( s.bInitialized.load(atomics::memory_order_relaxed)) - , threadId( cds::OS::get_current_thread_id()) - {} - - // boost::container::flat_map requires operator = - value_type& operator=( value_type const& v ) - { - nKey = v.nKey; - nData = v.nData; - nUpdateCall = v.nUpdateCall; - bInitialized.store(v.bInitialized.load(atomics::memory_order_relaxed), atomics::memory_order_relaxed); - - return *this; - } - }; - - typedef std::vector key_array; - key_array m_arrValues; - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - - struct insert_functor { - size_t nTestFunctorRef; - - insert_functor() - : nTestFunctorRef(0) - {} - - template - void operator()( Pair& val ) - { - operator()( val.first, val.second ); - } - - template - void operator()( Key const& key, Val& v ) - { - std::unique_lock< typename value_type::lock_type> ac( v.m_access ); - - v.nKey = key; - v.nData = key * 8; - - ++nTestFunctorRef; - v.bInitialized.store( true, atomics::memory_order_relaxed); - } - }; - - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - size_t m_nTestFunctorRef; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = - m_nTestFunctorRef = 0; - - // func is passed by reference - insert_functor func; - key_array const& arr = getTest().m_arrValues; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) { - if ( rMap.insert_with( *it, std::ref(func))) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) { - if ( rMap.insert_with( *it, std::ref(func))) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - - m_nTestFunctorRef = func.nTestFunctorRef; - } - }; - - template - class Updater: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Updater * clone() - { - return new Updater( *this ); - } - - struct update_functor { - size_t nCreated; - size_t nModified; - - update_functor() - : nCreated(0) - , nModified(0) - {} - - template - void operator()( bool /*bNew*/, Key const& key, Val& v ) - { - std::unique_lock ac( v.m_access ); - if ( !v.bInitialized.load( atomics::memory_order_acquire )) { - ++nCreated; - v.nKey = key; - v.nData = key * 8; - v.bInitialized.store( true, atomics::memory_order_relaxed); - } - else { - ++v.nUpdateCall; - ++nModified; - } - } - - template - void operator()( bool bNew, Pair& val ) - { - operator()( bNew, val.first, val.second ); - } - - // For FeldmanHashMap - template - void operator()( Val& cur, Val * old ) - { - if ( old ) { - // If a key exists, FeldmanHashMap creates a new node too - // We should manually copy important values from old to cur - std::unique_lock ac( cur.second.m_access ); - cur.second.nKey = cur.first; - cur.second.nData = cur.first * 8; - cur.second.bInitialized.store( true, atomics::memory_order_release ); - } - operator()( old == nullptr, cur.first, cur.second ); - } - - private: - update_functor(const update_functor& ) = delete; - }; - - public: - size_t m_nUpdateFailed; - size_t m_nUpdateCreated; - size_t m_nUpdateExisted; - size_t m_nFunctorCreated; - size_t m_nFunctorModified; - - public: - Updater( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Updater( Updater& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nUpdateCreated = - m_nUpdateExisted = - m_nUpdateFailed = 0; - - update_functor func; - - key_array const& arr = getTest().m_arrValues; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) { - std::pair ret = rMap.update( *it, std::ref( func )); - if ( ret.first ) { - if ( ret.second ) - ++m_nUpdateCreated; - else - ++m_nUpdateExisted; - } - else - ++m_nUpdateFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) { - std::pair ret = rMap.update( *it, std::ref( func )); - if ( ret.first ) { - if ( ret.second ) - ++m_nUpdateCreated; - else - ++m_nUpdateExisted; - } - else - ++m_nUpdateFailed; - } - } - } - - m_nFunctorCreated = func.nCreated; - m_nFunctorModified = func.nModified; - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Map& m_Map; - typedef typename Map::mapped_type value_type; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - - struct value_container - { - size_t nKeyExpected; - - size_t nSuccessItem; - size_t nFailedItem; - - value_container() - : nSuccessItem(0) - , nFailedItem(0) - {} - }; - - struct erase_functor { - value_container m_cnt; - - template - void operator()( Key const& /*key*/, Val& v ) - { - while ( true ) { - if ( v.bInitialized.load( atomics::memory_order_relaxed )) { - std::unique_lock< typename value_type::lock_type> ac( v.m_access ); - - if ( m_cnt.nKeyExpected == v.nKey && m_cnt.nKeyExpected * 8 == v.nData ) - ++m_cnt.nSuccessItem; - else - ++m_cnt.nFailedItem; - v.nData++; - v.nKey = 0; - break; - } - else - cds::backoff::yield()(); - } - } - - template - void operator ()( Pair& item ) - { - operator()( item.first, item.second ); - } - }; - - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - size_t m_nValueSuccess; - size_t m_nValueFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - erase_functor func; - key_array const& arr = getTest().m_arrValues; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) { - func.m_cnt.nKeyExpected = *it; - if ( rMap.erase( *it, std::ref(func))) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) { - func.m_cnt.nKeyExpected = *it; - if ( rMap.erase( *it, std::ref(func))) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - - m_nValueSuccess = func.m_cnt.nSuccessItem; - m_nValueFailed = func.m_cnt.nFailedItem; - } - }; - - protected: - - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - typedef Updater UpdaterThread; - cds::OS::Timer timer; - - m_arrValues.clear(); - m_arrValues.reserve( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) - m_arrValues.push_back( i ); - shuffle( m_arrValues.begin(), m_arrValues.end()); - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testMap ), c_nDeleteThreadCount ); - pool.add( new UpdaterThread( pool, testMap ), c_nUpdateThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration()); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nDelValueSuccess = 0; - size_t nDelValueFailed = 0; - size_t nUpdateFailed = 0; - size_t nUpdateCreated = 0; - size_t nUpdateModified = 0; - size_t nEnsFuncCreated = 0; - size_t nEnsFuncModified = 0; - size_t nInsFuncCalled = 0; - - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - nInsFuncCalled += pThread->m_nTestFunctorRef; - } - else { - DeleterThread * p = dynamic_cast( *it ); - if ( p ) { - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - nDelValueSuccess += p->m_nValueSuccess; - nDelValueFailed += p->m_nValueFailed; - } - else { - UpdaterThread * pEns = static_cast( *it ); - nUpdateCreated += pEns->m_nUpdateCreated; - nUpdateModified += pEns->m_nUpdateExisted; - nUpdateFailed += pEns->m_nUpdateFailed; - nEnsFuncCreated += pEns->m_nFunctorCreated; - nEnsFuncModified += pEns->m_nFunctorModified; - } - } - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed << "\n" - << " : Update succ=" << (nUpdateCreated + nUpdateModified) << " fail=" << nUpdateFailed - << " create=" << nUpdateCreated << " modify=" << nUpdateModified << "\n" - << " : update functor: create=" << nEnsFuncCreated << " modify=" << nEnsFuncModified << "\n" - << " Map size=" << testMap.size() - ); - - CPPUNIT_CHECK_EX( nDelValueFailed == 0, "Functor del failed=" << nDelValueFailed ); - CPPUNIT_CHECK_EX( nDelValueSuccess == nDeleteSuccess, "Delete success=" << nDeleteSuccess << " functor=" << nDelValueSuccess ); - - CPPUNIT_CHECK( nUpdateFailed == 0 ); - CPPUNIT_CHECK( nUpdateCreated + nUpdateModified == nEnsFuncCreated + nEnsFuncModified ); - - // nInsFuncCalled is call count of insert functor - CPPUNIT_CHECK_EX( nInsFuncCalled == nInsertSuccess, "nInsertSuccess=" << nInsertSuccess << " functor nInsFuncCalled=" << nInsFuncCalled ); - - check_before_cleanup( testMap ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) { - testMap.erase( nItem ); - } - CPPUNIT_MSG( " Duration=" << timer.duration()); - CPPUNIT_CHECK( testMap.empty()); - - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " update=" << c_nUpdateThreadCount - << " pass count=" << c_nThreadPassCount - << " map size=" << c_nMapSize - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - - CPPUNIT_TEST_SUITE_(Map_InsDel_func, "map_insdel_func") - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CPPUNIT_TEST_SUITE_END(); - - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_bronsonavltree.cpp b/tests/unit/map2/map_insdel_func_bronsonavltree.cpp deleted file mode 100644 index c265f687..00000000 --- a/tests/unit/map2/map_insdel_func_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_cuckoo.cpp b/tests/unit/map2/map_insdel_func_cuckoo.cpp deleted file mode 100644 index 39c6b79f..00000000 --- a/tests/unit/map2/map_insdel_func_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_ellentree.cpp b/tests/unit/map2/map_insdel_func_ellentree.cpp deleted file mode 100644 index 5870645c..00000000 --- a/tests/unit/map2/map_insdel_func_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_func_feldmanhashmap.cpp deleted file mode 100644 index de4fa3fe..00000000 --- a/tests/unit/map2/map_insdel_func_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_func.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_michael.cpp b/tests/unit/map2/map_insdel_func_michael.cpp deleted file mode 100644 index c6d6a3c7..00000000 --- a/tests/unit/map2/map_insdel_func_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_skip.cpp b/tests/unit/map2/map_insdel_func_skip.cpp deleted file mode 100644 index 83af2769..00000000 --- a/tests/unit/map2/map_insdel_func_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_split.cpp b/tests/unit/map2/map_insdel_func_split.cpp deleted file mode 100644 index b361d964..00000000 --- a/tests/unit/map2/map_insdel_func_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_func.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_func_striped.cpp b/tests/unit/map2/map_insdel_func_striped.cpp deleted file mode 100644 index f72bbfb3..00000000 --- a/tests/unit/map2/map_insdel_func_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_func.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_func::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int.cpp b/tests/unit/map2/map_insdel_int.cpp deleted file mode 100644 index 5b942298..00000000 --- a/tests/unit/map2/map_insdel_int.cpp +++ /dev/null @@ -1,66 +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 "map2/map_insdel_int.h" -#include - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_int ); - - - void Map_InsDel_int::setUpParams( const CppUnitMini::TestCfg& cfg ) { - c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount ); - c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount ); - c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - - c_nCuckooInitialSize = cfg.getULong("CuckooInitialSize", static_cast(c_nCuckooInitialSize) ); - c_nCuckooProbesetSize = cfg.getULong("CuckooProbesetSize", static_cast(c_nCuckooProbesetSize) ); - c_nCuckooProbesetThreshold = cfg.getULong("CuckooProbesetThreshold", static_cast(c_nCuckooProbesetThreshold) ); - - c_nFeldmanMap_HeadBits = cfg.getULong("FeldmanMapHeadBits", static_cast(c_nFeldmanMap_HeadBits) ); - c_nFeldmanMap_ArrayBits = cfg.getULong("FeldmanMapArrayBits", static_cast(c_nFeldmanMap_ArrayBits) ); - - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - if ( c_nInsertThreadCount == 0 ) - c_nInsertThreadCount = cds::OS::topology::processor_count(); - if ( c_nDeleteThreadCount == 0 ) - c_nDeleteThreadCount = cds::OS::topology::processor_count(); - - m_arrValues.clear(); - m_arrValues.reserve( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) - m_arrValues.push_back( i ); - shuffle( m_arrValues.begin(), m_arrValues.end() ); - } - -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int.h b/tests/unit/map2/map_insdel_int.h deleted file mode 100644 index c8f8c1bf..00000000 --- a/tests/unit/map2/map_insdel_int.h +++ /dev/null @@ -1,304 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -namespace map2 { - -# define TEST_CASE(TAG, X) void X(); - - class Map_InsDel_int: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 1000000; // map size - size_t c_nInsertThreadCount = 4; // count of insertion thread - size_t c_nDeleteThreadCount = 4; // count of deletion thread - size_t c_nThreadPassCount = 4; // pass count for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - bool c_bPrintGCState = true; - - size_t c_nLoadFactor; // current load factor - - private: - typedef size_t key_type; - typedef size_t value_type; - - typedef std::vector key_array; - key_array m_arrValues; - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = 0; - key_array const& arr = getTest().m_arrValues; - - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) { - if ( rMap.insert( *it, *it * 8 ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) { - if ( rMap.insert( *it, *it * 8 ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - key_array const& arr = getTest().m_arrValues; - - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) { - if ( rMap.erase( *it ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) { - if ( rMap.erase( *it ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - } - }; - - protected: - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testMap ), c_nDeleteThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = static_cast( *it ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed - << " Map size=" << testMap.size() - ); - - check_before_cleanup( testMap ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) { - testMap.erase( nItem ); - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK( testMap.empty()); - CPPUNIT_CHECK_EX( testMap.size() == 0, "size() == " << testMap.size() ); - - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " pass count=" << c_nThreadPassCount - << " map size=" << c_nMapSize - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - - CPPUNIT_TEST_SUITE(Map_InsDel_int) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_bronsonavltree.cpp b/tests/unit/map2/map_insdel_int_bronsonavltree.cpp deleted file mode 100644 index f2e7e220..00000000 --- a/tests/unit/map2/map_insdel_int_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_cuckoo.cpp b/tests/unit/map2/map_insdel_int_cuckoo.cpp deleted file mode 100644 index 742a74d2..00000000 --- a/tests/unit/map2/map_insdel_int_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_ellentree.cpp b/tests/unit/map2/map_insdel_int_ellentree.cpp deleted file mode 100644 index 1eb5ead5..00000000 --- a/tests/unit/map2/map_insdel_int_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_int_feldmanhashmap.cpp deleted file mode 100644 index 89f586c5..00000000 --- a/tests/unit/map2/map_insdel_int_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_int.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_michael.cpp b/tests/unit/map2/map_insdel_int_michael.cpp deleted file mode 100644 index 028d70c8..00000000 --- a/tests/unit/map2/map_insdel_int_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_skip.cpp b/tests/unit/map2/map_insdel_int_skip.cpp deleted file mode 100644 index b311d5ae..00000000 --- a/tests/unit/map2/map_insdel_int_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_split.cpp b/tests/unit/map2/map_insdel_int_split.cpp deleted file mode 100644 index 2000e49b..00000000 --- a/tests/unit/map2/map_insdel_int_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_std.cpp b/tests/unit/map2/map_insdel_int_std.cpp deleted file mode 100644 index e65fd91d..00000000 --- a/tests/unit/map2/map_insdel_int_std.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_int.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_int_striped.cpp b/tests/unit/map2/map_insdel_int_striped.cpp deleted file mode 100644 index ced21888..00000000 --- a/tests/unit/map2/map_insdel_int_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_int.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int.cpp b/tests/unit/map2/map_insdel_item_int.cpp deleted file mode 100644 index a472463c..00000000 --- a/tests/unit/map2/map_insdel_item_int.cpp +++ /dev/null @@ -1,55 +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 "map2/map_insdel_item_int.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_Item_int ); - - void Map_InsDel_Item_int::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize ); - c_nGoalItem = cfg.getSizeT("GoalItem", c_nMapSize / 2 ); - c_nAttemptCount = cfg.getSizeT("AttemptCount", c_nAttemptCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency() * 2; - } -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int.h b/tests/unit/map2/map_insdel_item_int.h deleted file mode 100644 index 34214c9d..00000000 --- a/tests/unit/map2/map_insdel_item_int.h +++ /dev/null @@ -1,328 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsDel_Item_int: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 1000000; // map size - size_t c_nThreadCount = 4; // thread count - size_t c_nAttemptCount = 100000; // count of SUCCESS insert/delete for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024; // initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nGoalItem; - size_t c_nLoadFactor = 2; // current load factor - - private: - typedef size_t key_type; - typedef size_t value_type; - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - - struct update_func - { - void operator()( bool bNew, std::pair& item ) - { - if ( bNew ) - item.second = item.first; - } - // for boost::container::flat_map - void operator()( bool bNew, std::pair& item ) - { - if ( bNew ) - item.second = item.first; - } - - // for BronsonAVLTreeMap - void operator()( bool bNew, key_type key, value_type& val ) - { - if ( bNew ) - val = key; - } - - // for FeldmanHashMap - void operator()( std::pair& item, std::pair * pOld ) - { - if ( !pOld ) - item.second = item.first; - } - }; - - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_Item_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - size_t nGoalItem = getTest().c_nGoalItem; - size_t const nAttemptCount = getTest().c_nAttemptCount; - - for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) { - if ( nAttempt % 2 == 0 ) { - if ( rMap.insert( nGoalItem, nGoalItem )) { - ++m_nInsertSuccess; - ++nAttempt; - } - else - ++m_nInsertFailed; - } - else { - std::pair updateResult = rMap.update( nGoalItem, update_func(), true ); - if ( updateResult.second ) { - ++m_nInsertSuccess; - ++nAttempt; - } - else - ++m_nInsertFailed; - } - } - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_Item_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - size_t nGoalItem = getTest().c_nGoalItem; - size_t const nAttemptCount = getTest().c_nAttemptCount; - for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) { - if ( rMap.erase( nGoalItem )) { - ++m_nDeleteSuccess; - ++nAttempt; - } - else - ++m_nDeleteFailed; - } - } - }; - - protected: - - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - cds::OS::Timer timer; - - // Fill the map - CPPUNIT_MSG( " Fill map (" << c_nMapSize << " items)..."); - timer.reset(); - { - std::vector v; - v.reserve( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) - v.push_back( i ); - shuffle( v.begin(), v.end() ); - for ( size_t i = 0; i < v.size(); ++i ) { - CPPUNIT_ASSERT( testMap.insert( v[i], v[i] )); - } - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - CPPUNIT_MSG( " Insert/delete the key " << c_nGoalItem << " (" << c_nAttemptCount << " successful times)..."); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), (c_nThreadCount + 1) / 2 ); - pool.add( new DeleterThread( pool, testMap ), (c_nThreadCount + 1) / 2 ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - CPPUNIT_CHECK( pThread->m_nInsertSuccess == c_nAttemptCount ); - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = static_cast( *it ); - CPPUNIT_CHECK( p->m_nDeleteSuccess == c_nAttemptCount ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - CPPUNIT_CHECK( nInsertSuccess == nDeleteSuccess ); - size_t nGoalItem = c_nGoalItem; - CPPUNIT_CHECK( testMap.contains( nGoalItem )); - - - CPPUNIT_MSG( " Totals: Ins fail=" << nInsertFailed << " Del fail=" << nDeleteFailed ); - - // Check if the map contains all items - CPPUNIT_MSG( " Check if the map contains all items" ); - timer.reset(); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - CPPUNIT_CHECK_EX( testMap.contains( i ), "key " << i ); - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - // CDSUNIT_DECLARE_StdMap // very slow!! - - CPPUNIT_TEST_SUITE(Map_InsDel_Item_int) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - CDSUNIT_TEST_FeldmanHashMap_city - //CDSUNIT_TEST_CuckooMap - //CDSUNIT_TEST_StripedMap - //CDSUNIT_TEST_RefinableMap - // CDSUNIT_TEST_StdMap // very slow!! - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp b/tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp deleted file mode 100644 index c0483f72..00000000 --- a/tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_cuckoo.cpp b/tests/unit/map2/map_insdel_item_int_cuckoo.cpp deleted file mode 100644 index f145d399..00000000 --- a/tests/unit/map2/map_insdel_item_int_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_ellentree.cpp b/tests/unit/map2/map_insdel_item_int_ellentree.cpp deleted file mode 100644 index 5098a3ed..00000000 --- a/tests/unit/map2/map_insdel_item_int_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_item_int_feldmanhashmap.cpp deleted file mode 100644 index 2e01a799..00000000 --- a/tests/unit/map2/map_insdel_item_int_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_michael.cpp b/tests/unit/map2/map_insdel_item_int_michael.cpp deleted file mode 100644 index 4f8e27c8..00000000 --- a/tests/unit/map2/map_insdel_item_int_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_skip.cpp b/tests/unit/map2/map_insdel_item_int_skip.cpp deleted file mode 100644 index 3a2cb13c..00000000 --- a/tests/unit/map2/map_insdel_item_int_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_split.cpp b/tests/unit/map2/map_insdel_item_int_split.cpp deleted file mode 100644 index 38619279..00000000 --- a/tests/unit/map2/map_insdel_item_int_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_int_striped.cpp b/tests/unit/map2/map_insdel_item_int_striped.cpp deleted file mode 100644 index 5d2d5e30..00000000 --- a/tests/unit/map2/map_insdel_item_int_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_item_int.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string.cpp b/tests/unit/map2/map_insdel_item_string.cpp deleted file mode 100644 index 75693522..00000000 --- a/tests/unit/map2/map_insdel_item_string.cpp +++ /dev/null @@ -1,55 +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 "map2/map_insdel_item_string.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_Item_string ); - - void Map_InsDel_Item_string::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize ); - c_nGoalItem = cfg.getSizeT("GoalItem", c_nMapSize / 2 ); - c_nAttemptCount = cfg.getSizeT("AttemptCount", c_nAttemptCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency() * 2; - } -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string.h b/tests/unit/map2/map_insdel_item_string.h deleted file mode 100644 index 1461f4a6..00000000 --- a/tests/unit/map2/map_insdel_item_string.h +++ /dev/null @@ -1,308 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsDel_Item_string: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 1000000; // map size - size_t c_nThreadCount = 4; // thread count - size_t c_nAttemptCount = 100000; // count of SUCCESS insert/delete for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024; // initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nGoalItem; - size_t c_nLoadFactor = 2; // current load factor - - private: - typedef std::string key_type; - typedef size_t value_type; - - const std::vector * m_parrString; - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_Item_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - size_t nGoalItem = getTest().c_nGoalItem; - std::string strGoal = (*getTest().m_parrString)[nGoalItem]; - size_t const nAttemptCount = getTest().c_nAttemptCount; - - for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) { - if ( rMap.insert( strGoal, nGoalItem )) { - ++m_nInsertSuccess; - ++nAttempt; - } - else - ++m_nInsertFailed; - } - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Map& m_Map; - - struct erase_cleaner { - void operator ()(std::pair& val ) - { - val.second = 0; - } - // for boost::container::flat_map - void operator ()(std::pair< typename std::remove_const< typename Map::key_type >::type, typename Map::mapped_type>& val ) - { - val.second = 0; - } - // for BronsonAVLTreeMap - void operator()( typename Map::key_type const& /*key*/, typename Map::mapped_type& val ) - { - val = 0; - } - }; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_Item_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - size_t nGoalItem = getTest().c_nGoalItem; - std::string strGoal = (*getTest().m_parrString)[nGoalItem]; - size_t const nAttemptCount = getTest().c_nAttemptCount; - - for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) { - if ( rMap.erase( strGoal, erase_cleaner() )) { - ++m_nDeleteSuccess; - ++nAttempt; - } - else - ++m_nDeleteFailed; - } - } - }; - - protected: - - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - cds::OS::Timer timer; - - // Fill the map - CPPUNIT_MSG( " Fill map (" << c_nMapSize << " items)..."); - timer.reset(); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - CPPUNIT_ASSERT_EX( testMap.insert( (*m_parrString)[i], i ), i ); - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - CPPUNIT_MSG( " Insert/delete the key " << c_nGoalItem << " (" << c_nAttemptCount << " successful times)..."); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), (c_nThreadCount + 1) / 2 ); - pool.add( new DeleterThread( pool, testMap ), (c_nThreadCount + 1) / 2 ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - CPPUNIT_CHECK( pThread->m_nInsertSuccess == c_nAttemptCount ); - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = static_cast( *it ); - CPPUNIT_CHECK( p->m_nDeleteSuccess == c_nAttemptCount ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - CPPUNIT_CHECK_EX( nInsertSuccess == nDeleteSuccess, "nInsertSuccess=" << nInsertSuccess << ", nDeleteSuccess=" << nDeleteSuccess ); - CPPUNIT_MSG( " Totals: Ins fail=" << nInsertFailed << " Del fail=" << nDeleteFailed ); - - // Check if the map contains all items - CPPUNIT_MSG( " Check if the map contains all items" ); - timer.reset(); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - CPPUNIT_CHECK_EX( testMap.contains( (*m_parrString)[i] ), "Key \"" << (*m_parrString)[i] << "\" not found" ); - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - m_parrString = &CppUnitMini::TestCase::getTestStrings(); - if ( c_nMapSize > m_parrString->size() ) - c_nMapSize = m_parrString->size(); - if ( c_nGoalItem > m_parrString->size() ) - c_nGoalItem = m_parrString->size() / 2; - - CPPUNIT_MSG( "Thread count= " << c_nThreadCount - << " pass count=" << c_nAttemptCount - << " map size=" << c_nMapSize - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - // CDSUNIT_DECLARE_StdMap // very slow!! - - CPPUNIT_TEST_SUITE(Map_InsDel_Item_string) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - // CDSUNIT_TEST_StdMap // very slow!! - CPPUNIT_TEST_SUITE_END(); - - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp b/tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp deleted file mode 100644 index 81e0cade..00000000 --- a/tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_cuckoo.cpp b/tests/unit/map2/map_insdel_item_string_cuckoo.cpp deleted file mode 100644 index 4ffcd53c..00000000 --- a/tests/unit/map2/map_insdel_item_string_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_ellentree.cpp b/tests/unit/map2/map_insdel_item_string_ellentree.cpp deleted file mode 100644 index 596fb8dd..00000000 --- a/tests/unit/map2/map_insdel_item_string_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp deleted file mode 100644 index 33a15aaf..00000000 --- a/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_michael.cpp b/tests/unit/map2/map_insdel_item_string_michael.cpp deleted file mode 100644 index e9122c87..00000000 --- a/tests/unit/map2/map_insdel_item_string_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_skip.cpp b/tests/unit/map2/map_insdel_item_string_skip.cpp deleted file mode 100644 index 31017301..00000000 --- a/tests/unit/map2/map_insdel_item_string_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_split.cpp b/tests/unit/map2/map_insdel_item_string_split.cpp deleted file mode 100644 index 7f37753e..00000000 --- a/tests/unit/map2/map_insdel_item_string_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string_striped.cpp b/tests/unit/map2/map_insdel_item_string_striped.cpp deleted file mode 100644 index 9a532325..00000000 --- a/tests/unit/map2/map_insdel_item_string_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_item_string.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_Item_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string.cpp b/tests/unit/map2/map_insdel_string.cpp deleted file mode 100644 index 338bc958..00000000 --- a/tests/unit/map2/map_insdel_string.cpp +++ /dev/null @@ -1,57 +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 "map2/map_insdel_string.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_string ); - - void Map_InsDel_string::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount ); - c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount ); - c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nInsertThreadCount == 0 ) - c_nInsertThreadCount = std::thread::hardware_concurrency(); - if ( c_nDeleteThreadCount == 0 ) - c_nDeleteThreadCount = std::thread::hardware_concurrency(); - } -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string.h b/tests/unit/map2/map_insdel_string.h deleted file mode 100644 index 3163e210..00000000 --- a/tests/unit/map2/map_insdel_string.h +++ /dev/null @@ -1,307 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsDel_string: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 1000000; // map size - size_t c_nInsertThreadCount = 4; // count of insertion thread - size_t c_nDeleteThreadCount = 4; // count of deletion thread - size_t c_nThreadPassCount = 4; // pass count for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - bool c_bPrintGCState = true; - - size_t c_nLoadFactor; // current load factor - - private: - typedef std::string key_type; - typedef size_t value_type; - - const std::vector * m_parrString; - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nMapSize = getTest().c_nMapSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nMapSize; ++nItem ) { - if ( rMap.insert( arrString[nItem % nArrSize], nItem * 8 ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nMapSize; nItem > 0; --nItem ) { - if ( rMap.insert( arrString[nItem % nArrSize], nItem * 8 ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nMapSize = getTest().c_nMapSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nMapSize; ++nItem ) { - if ( rMap.erase( arrString[nItem % nArrSize] ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nMapSize; nItem > 0; --nItem ) { - if ( rMap.erase( arrString[nItem % nArrSize] ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - } - }; - - protected: - - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testMap ), c_nDeleteThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = static_cast( *it ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed - << " Map size=" << testMap.size() - ); - - check_before_cleanup( testMap ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - for ( size_t i = 0; i < m_parrString->size(); ++i ) - testMap.erase( (*m_parrString)[i] ); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK( testMap.empty() ); - CPPUNIT_CHECK_EX( testMap.size() == 0, "size() == " << testMap.size() ); - - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - m_parrString = &CppUnitMini::TestCase::getTestStrings(); - - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " pass count=" << c_nThreadPassCount - << " map size=" << c_nMapSize - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - - CPPUNIT_TEST_SUITE_(Map_InsDel_string, "map_insdel_func") - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_bronsonavltree.cpp b/tests/unit/map2/map_insdel_string_bronsonavltree.cpp deleted file mode 100644 index ed90eacd..00000000 --- a/tests/unit/map2/map_insdel_string_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_cuckoo.cpp b/tests/unit/map2/map_insdel_string_cuckoo.cpp deleted file mode 100644 index 5e6d724d..00000000 --- a/tests/unit/map2/map_insdel_string_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_ellentree.cpp b/tests/unit/map2/map_insdel_string_ellentree.cpp deleted file mode 100644 index 956f44c0..00000000 --- a/tests/unit/map2/map_insdel_string_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_string_feldmanhashmap.cpp deleted file mode 100644 index 6b0cca44..00000000 --- a/tests/unit/map2/map_insdel_string_feldmanhashmap.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_michael.cpp b/tests/unit/map2/map_insdel_string_michael.cpp deleted file mode 100644 index 1f1e0c59..00000000 --- a/tests/unit/map2/map_insdel_string_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_skip.cpp b/tests/unit/map2/map_insdel_string_skip.cpp deleted file mode 100644 index 3f2affcd..00000000 --- a/tests/unit/map2/map_insdel_string_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_split.cpp b/tests/unit/map2/map_insdel_string_split.cpp deleted file mode 100644 index d1ea0771..00000000 --- a/tests/unit/map2/map_insdel_string_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_std.cpp b/tests/unit/map2/map_insdel_string_std.cpp deleted file mode 100644 index 16f01dd6..00000000 --- a/tests/unit/map2/map_insdel_string_std.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdel_string.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdel_string_striped.cpp b/tests/unit/map2/map_insdel_string_striped.cpp deleted file mode 100644 index f58c2a8e..00000000 --- a/tests/unit/map2/map_insdel_string_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdel_string.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDel_string::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind.cpp b/tests/unit/map2/map_insdelfind.cpp deleted file mode 100644 index 031855f7..00000000 --- a/tests/unit/map2/map_insdelfind.cpp +++ /dev/null @@ -1,70 +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 "map2/map_insdelfind.h" -#include - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDelFind ); - - void Map_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nMapSize = cfg.getSizeT("InitialMapSize", c_nMapSize ); - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage ); - c_nDeletePercentage = cfg.getUInt("DeletePercentage", c_nDeletePercentage ); - c_nDuration = cfg.getUInt("Duration", c_nDuration ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency() * 2; - - CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 ); - - actions * pFirst = m_arrShuffle; - actions * pLast = m_arrShuffle + c_nInsertPercentage; - std::fill( pFirst, pLast, do_insert ); - pFirst = pLast; - pLast += c_nDeletePercentage; - std::fill( pFirst, pLast, do_delete ); - pFirst = pLast; - pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]); - std::fill( pFirst, pLast, do_find ); - shuffle( m_arrShuffle, pLast ); - } -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind.h b/tests/unit/map2/map_insdelfind.h deleted file mode 100644 index 208d8cbd..00000000 --- a/tests/unit/map2/map_insdelfind.h +++ /dev/null @@ -1,307 +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 "map2/map_type.h" -#include "cppunit/thread.h" -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsDelFind: public CppUnitMini::TestCase - { - public: - size_t c_nMapSize = 500000; // initial map size - size_t c_nThreadCount = 8; // thread count - size_t c_nMaxLoadFactor = 8; // maximum load factor - unsigned int c_nInsertPercentage = 5; - unsigned int c_nDeletePercentage = 5; - unsigned int c_nDuration = 30; // test duration, seconds - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nLoadFactor = 2; // current load factor - - public: - enum actions - { - do_find, - do_insert, - do_delete - }; - static const unsigned int c_nShuffleSize = 100; - actions m_arrShuffle[c_nShuffleSize]; - - protected: - typedef size_t key_type; - typedef size_t value_type; - - template - class WorkThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual WorkThread * clone() - { - return new WorkThread( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - size_t m_nFindSuccess; - size_t m_nFindFailed; - - public: - WorkThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - WorkThread( WorkThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsDelFind& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - typedef std::pair< key_type const, value_type > map_value_type; - - struct update_functor { - template - void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ ) - {} - - // FeldmanHashMap - void operator()( map_value_type& /*cur*/, map_value_type * /*old*/) - {} - - // MichaelMap - void operator()( bool /*bNew*/, map_value_type& /*cur*/ ) - {} - - // BronsonAVLTreeMap - void operator()( bool /*bNew*/, key_type /*key*/, value_type& /*val*/ ) - {} - }; - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = - m_nDeleteSuccess = - m_nDeleteFailed = - m_nFindSuccess = - m_nFindFailed = 0; - - actions * pAct = getTest().m_arrShuffle; - unsigned int i = 0; - size_t const nNormalize = size_t(-1) / (getTest().c_nMapSize * 2); - - size_t nRand = 0; - while ( !time_elapsed() ) { - nRand = cds::bitop::RandXorShift(nRand); - size_t n = nRand / nNormalize; - switch ( pAct[i] ) { - case do_find: - if ( rMap.contains( n )) - ++m_nFindSuccess; - else - ++m_nFindFailed; - break; - case do_insert: - if ( n % 2 ) { - if ( rMap.insert( n, n )) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - else { - if ( rMap.update(n, update_functor(), true ).first ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - break; - case do_delete: - if ( rMap.erase( n )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - break; - } - - if ( ++i >= c_nShuffleSize ) - i = 0; - } - } - }; - - protected: - template - void do_test( Map& testMap ) - { - typedef WorkThread work_thread; - cds::OS::Timer timer; - - // fill map - only odd number - { - std::vector arr; - arr.reserve( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) - arr.push_back( i * 2 + 1); - shuffle( arr.begin(), arr.end() ); - for ( size_t i = 0; i < c_nMapSize; ++i ) - testMap.insert( arr[i], arr[i] ); - } - CPPUNIT_MSG( " Insert " << c_nMapSize << " items time (single-threaded)=" << timer.duration() ); - - timer.reset(); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new work_thread( pool, testMap ), c_nThreadCount ); - pool.run( c_nDuration ); - //CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nFindSuccess = 0; - size_t nFindFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - work_thread * pThread = static_cast( *it ); - assert( pThread != nullptr ); - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - nDeleteSuccess += pThread->m_nDeleteSuccess; - nDeleteFailed += pThread->m_nDeleteFailed; - nFindSuccess += pThread->m_nFindSuccess; - nFindFailed += pThread->m_nFindFailed; - } - - size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed; - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - << " Find=" << nFindSuccess << '/' << nFindFailed << "\n\t" - << " Speed=" << (nFindSuccess + nFindFailed) / c_nDuration << " find/sec\n\t" - << " " << (nInsertSuccess + nDeleteSuccess) / c_nDuration << " modify/sec\n\t" - << " Total ops=" << nTotalOps << "\n\t" - << " speed=" << nTotalOps / c_nDuration << " ops/sec\n\t" - << " Map size=" << testMap.size() - ); - - - check_before_cleanup( testMap ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - testMap.clear(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK_EX( testMap.empty(), "size=" << ((long long) testMap.size()) ); - - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - CPPUNIT_MSG( "Thread count=" << c_nThreadCount - << " initial map size=" << c_nMapSize - << " insert=" << c_nInsertPercentage << '%' - << " delete=" << c_nDeletePercentage << '%' - << " duration=" << c_nDuration << "s" - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - - CPPUNIT_TEST_SUITE_(Map_InsDelFind, "map_insdelfind") - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_bronsonavltree.cpp b/tests/unit/map2/map_insdelfind_bronsonavltree.cpp deleted file mode 100644 index 2529f11e..00000000 --- a/tests/unit/map2/map_insdelfind_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_cuckoo.cpp b/tests/unit/map2/map_insdelfind_cuckoo.cpp deleted file mode 100644 index d9ba1cb1..00000000 --- a/tests/unit/map2/map_insdelfind_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_ellentree.cpp b/tests/unit/map2/map_insdelfind_ellentree.cpp deleted file mode 100644 index 39c33f07..00000000 --- a/tests/unit/map2/map_insdelfind_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_feldmanhashmap.cpp b/tests/unit/map2/map_insdelfind_feldmanhashmap.cpp deleted file mode 100644 index 8d0ad78f..00000000 --- a/tests/unit/map2/map_insdelfind_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdelfind.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_michael.cpp b/tests/unit/map2/map_insdelfind_michael.cpp deleted file mode 100644 index b9413225..00000000 --- a/tests/unit/map2/map_insdelfind_michael.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_skip.cpp b/tests/unit/map2/map_insdelfind_skip.cpp deleted file mode 100644 index b32f968b..00000000 --- a/tests/unit/map2/map_insdelfind_skip.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_split.cpp b/tests/unit/map2/map_insdelfind_split.cpp deleted file mode 100644 index 4d1be290..00000000 --- a/tests/unit/map2/map_insdelfind_split.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_std.cpp b/tests/unit/map2/map_insdelfind_std.cpp deleted file mode 100644 index 75ed2817..00000000 --- a/tests/unit/map2/map_insdelfind_std.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insdelfind.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap -} // namespace map2 diff --git a/tests/unit/map2/map_insdelfind_striped.cpp b/tests/unit/map2/map_insdelfind_striped.cpp deleted file mode 100644 index 648f1c17..00000000 --- a/tests/unit/map2/map_insdelfind_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insdelfind.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsDelFind::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int.cpp b/tests/unit/map2/map_insfind_int.cpp deleted file mode 100644 index 78fec9aa..00000000 --- a/tests/unit/map2/map_insfind_int.cpp +++ /dev/null @@ -1,53 +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 "map2/map_insfind_int.h" - -namespace map2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsFind_int ); - - void Map_InsFind_int::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold); - - c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits); - c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency(); - } -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int.h b/tests/unit/map2/map_insfind_int.h deleted file mode 100644 index e40ec782..00000000 --- a/tests/unit/map2/map_insfind_int.h +++ /dev/null @@ -1,252 +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 "map2/map_type.h" -#include "cppunit/thread.h" - -#include -#include - -namespace map2 { - -#define TEST_CASE(TAG, X) void X(); - - class Map_InsFind_int: public CppUnitMini::TestCase - { - public: - size_t c_nThreadCount = 8; // thread count - size_t c_nMapSize = 5000; // map size (count of searching item) - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) - - size_t c_nFeldmanMap_HeadBits = 10; - size_t c_nFeldmanMap_ArrayBits = 4; - - size_t c_nLoadFactor = 2; // current load factor - - private: - typedef size_t key_type; - typedef size_t value_type; - - template - static bool check_result( Iterator const& it, Map const& map ) - { - return it != map.end(); - } - template - static bool check_result( bool b, Map const& ) - { - return b; - } - - template - class Inserter: public CppUnitMini::TestThread - { - Map& m_Map; - std::vector m_arrVal; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - - void make_array() - { - size_t const nThreadCount = getTest().c_nThreadCount; - size_t const nSize = getTest().c_nMapSize / nThreadCount + 1; - m_arrVal.resize( nSize ); - size_t nItem = m_nThreadNo; - for ( size_t i = 0; i < nSize; nItem += nThreadCount, ++i ) - m_arrVal[i] = nItem; - shuffle( m_arrVal.begin(), m_arrVal.end() ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - size_t m_nFindSuccess; - size_t m_nFindFail; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_InsFind_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() - { - cds::threading::Manager::attachThread(); - make_array(); - } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Map& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = - m_nFindSuccess = - m_nFindFail = 0; - - size_t const nArrSize = m_arrVal.size(); - for ( size_t i = 0; i < nArrSize; ++i ) { - size_t const nItem = m_arrVal[i]; - if ( check_result( rMap.insert( nItem, nItem * 8 ), rMap )) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - - for ( size_t k = 0; k <= i; ++k ) { - if ( check_result( rMap.contains( m_arrVal[k] ), rMap )) - ++m_nFindSuccess; - else - ++m_nFindFail; - } - } - } - }; - - protected: - - template - void do_test( Map& testMap ) - { - typedef Inserter InserterThread; - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testMap ), c_nThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nFindSuccess = 0; - size_t nFindFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = static_cast( *it ); - - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - nFindSuccess += pThread->m_nFindSuccess; - nFindFailed += pThread->m_nFindFail; - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess << " fail=" << nInsertFailed << "\n" - << " Find succ=" << nFindSuccess << " fail=" << nFindFailed - ); - - CPPUNIT_CHECK( nInsertFailed == 0 ); - CPPUNIT_CHECK( nFindFailed == 0 ); - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - template - void run_test() - { - static_assert( (!std::is_same< typename Map::item_counter, cds::atomicity::empty_item_counter >::value), - "Empty item counter is not suitable for this test"); - - CPPUNIT_MSG( "Thread count: " << c_nThreadCount - << " map size=" << c_nMapSize - ); - - if ( Map::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Map testMap( *this ); - do_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap - - CPPUNIT_TEST_SUITE(Map_InsFind_int) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_MichaelMap_nogc - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SplitList_nogc - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_SkipListMap_nogc - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_fixed - CDSUNIT_TEST_FeldmanHashMap_city - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_bronsonavltree.cpp b/tests/unit/map2/map_insfind_int_bronsonavltree.cpp deleted file mode 100644 index 6c5e1d53..00000000 --- a/tests/unit/map2/map_insfind_int_bronsonavltree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insfind_int.h" -#include "map2/map_type_bronson_avltree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_BronsonAVLTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_cuckoo.cpp b/tests/unit/map2/map_insfind_int_cuckoo.cpp deleted file mode 100644 index 0e02da4f..00000000 --- a/tests/unit/map2/map_insfind_int_cuckoo.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insfind_int.h" -#include "map2/map_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_CuckooMap -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_ellentree.cpp b/tests/unit/map2/map_insfind_int_ellentree.cpp deleted file mode 100644 index c99a76a9..00000000 --- a/tests/unit/map2/map_insfind_int_ellentree.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insfind_int.h" -#include "map2/map_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_EllenBinTreeMap -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_feldmanhashmap.cpp b/tests/unit/map2/map_insfind_int_feldmanhashmap.cpp deleted file mode 100644 index 52a0a7f0..00000000 --- a/tests/unit/map2/map_insfind_int_feldmanhashmap.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insfind_int.h" -#include "map2/map_type_feldman_hashmap.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_fixed - CDSUNIT_DECLARE_FeldmanHashMap_city -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_michael.cpp b/tests/unit/map2/map_insfind_int_michael.cpp deleted file mode 100644 index b6650bc2..00000000 --- a/tests/unit/map2/map_insfind_int_michael.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insfind_int.h" -#include "map2/map_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_skip.cpp b/tests/unit/map2/map_insfind_int_skip.cpp deleted file mode 100644 index f0efa130..00000000 --- a/tests/unit/map2/map_insfind_int_skip.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insfind_int.h" -#include "map2/map_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_split.cpp b/tests/unit/map2/map_insfind_int_split.cpp deleted file mode 100644 index 3d5513e8..00000000 --- a/tests/unit/map2/map_insfind_int_split.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insfind_int.h" -#include "map2/map_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_std.cpp b/tests/unit/map2/map_insfind_int_std.cpp deleted file mode 100644 index 4e7f9a50..00000000 --- a/tests/unit/map2/map_insfind_int_std.cpp +++ /dev/null @@ -1,40 +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 "map2/map_insfind_int.h" -#include "map2/map_type_std.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StdMap -} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int_striped.cpp b/tests/unit/map2/map_insfind_int_striped.cpp deleted file mode 100644 index 6351a811..00000000 --- a/tests/unit/map2/map_insfind_int_striped.cpp +++ /dev/null @@ -1,41 +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 "map2/map_insfind_int.h" -#include "map2/map_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Map_InsFind_int::X() { run_test::X>(); } -#include "map2/map_defs.h" - -namespace map2 { - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap -} // namespace map2 diff --git a/tests/unit/map2/map_type.h b/tests/unit/map2/map_type.h deleted file mode 100644 index 51b53068..00000000 --- a/tests/unit/map2/map_type.h +++ /dev/null @@ -1,163 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_H -#define CDSUNIT_MAP_TYPE_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "cppunit/cppunit_mini.h" - -namespace map2 { - namespace cc = cds::container; - namespace co = cds::opt; - - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi; - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_gpb; - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_gpt; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_shb; - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_sht; -#endif - - template - struct cmp { - int operator ()(Key const& k1, Key const& k2) const - { - if ( std::less( k1, k2 ) ) - return -1; - return std::less( k2, k1 ) ? 1 : 0; - } - }; - -#define CDSUNIT_INT_COMPARE(t) template <> struct cmp { int operator()( t k1, t k2 ){ return (int)(k1 - k2); } } - CDSUNIT_INT_COMPARE(char); - CDSUNIT_INT_COMPARE(unsigned char); - CDSUNIT_INT_COMPARE(int); - CDSUNIT_INT_COMPARE(unsigned int); - CDSUNIT_INT_COMPARE(long); - CDSUNIT_INT_COMPARE(unsigned long); - CDSUNIT_INT_COMPARE(long long); - CDSUNIT_INT_COMPARE(unsigned long long); -#undef CDSUNIT_INT_COMPARE - - template <> - struct cmp - { - int operator()(std::string const& s1, std::string const& s2) - { - return s1.compare( s2 ); - } - int operator()(std::string const& s1, char const * s2) - { - return s1.compare( s2 ); - } - int operator()(char const * s1, std::string const& s2) - { - return -s2.compare( s1 ); - } - }; - - // forward - template - struct map_type; - - template - struct map_type_base - { - typedef co::v::hash key_hash; - typedef std::less less; - typedef cmp compare; - - struct equal_to { - bool operator()( Key const& k1, Key const& k2 ) const - { - return compare()( k1, k2 ) == 0; - } - }; - - struct hash: public key_hash - { - size_t operator()( Key const& k ) const - { - return key_hash::operator()( k ); - } - template - size_t operator()( Q const& k ) const - { - return key_hash::operator()( k ); - } - }; - - struct hash2: public key_hash - { - size_t operator()( Key const& k ) const - { - size_t seed = ~key_hash::operator ()( k ); - boost::hash_combine( seed, k ); - return seed; - } - template - size_t operator()( Q const& k ) const - { - size_t seed = ~key_hash::operator()( k ); - boost::hash_combine( seed, k ); - return seed; - } - }; - }; - - template - static inline void print_stat( Map const& /*m*/ ) - {} - - template - static inline void check_before_cleanup( Map& /*m*/ ) - {} - - template - static inline void additional_cleanup( Map& /*m*/ ) - {} - - template - static inline void additional_check( Map& /*m*/ ) - {} - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_H diff --git a/tests/unit/map2/map_type_bronson_avltree.h b/tests/unit/map2/map_type_bronson_avltree.h deleted file mode 100644 index 867cb46b..00000000 --- a/tests/unit/map2/map_type_bronson_avltree.h +++ /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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_BRONSON_AVLTREE_H -#define CDSUNIT_MAP_TYPE_BRONSON_AVLTREE_H - -#include "map2/map_type.h" - -#include -#include -#include - -#include "print_bronsonavltree_stat.h" -#include "print_sync_monitor_stat.h" - -namespace map2 { - - template - class BronsonAVLTreeMap : public cc::BronsonAVLTreeMap< GC, Key, T, Traits > - { - typedef cc::BronsonAVLTreeMap< GC, Key, T, Traits > base_class; - public: - template - BronsonAVLTreeMap( Config const& /*cfg*/) - : base_class() - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_BronsonAVLTreeMap; - - template - struct map_type< tag_BronsonAVLTreeMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - - typedef cds::memory::vyukov_queue_pool< std::mutex > BronsonAVLTreeMap_simple_pool; - typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > BronsonAVLTreeMap_lazy_pool; - typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > BronsonAVLTreeMap_bounded_pool; - - struct BronsonAVLTreeMap_less: public - cc::bronson_avltree::make_traits< - co::less< less > - ,cc::bronson_avltree::relaxed_insert< false > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpi_less; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpb_less; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_gpt_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_shb_less; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_sht_less; -#endif - struct BronsonAVLTreeMap_cmp_stat: public - cc::bronson_avltree::make_traits< - co::compare< compare > - ,cc::bronson_avltree::relaxed_insert< false > - ,co::item_counter< cds::atomicity::item_counter > - ,co::stat< cc::bronson_avltree::stat<>> - >::type - {}; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpi_cmp_stat; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpb_cmp_stat; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_gpt_cmp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_shb_cmp_stat; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_cmp_stat > BronsonAVLTreeMap_rcu_sht_cmp_stat; -#endif - - struct BronsonAVLTreeMap_less_pool_simple: public BronsonAVLTreeMap_less - { - typedef cds::sync::pool_monitor sync_monitor; - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpi_less_pool_simple; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpb_less_pool_simple; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_gpt_less_pool_simple; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_shb_less_pool_simple; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple > BronsonAVLTreeMap_rcu_sht_less_pool_simple; -#endif - struct BronsonAVLTreeMap_less_pool_simple_stat : public BronsonAVLTreeMap_less - { - typedef cc::bronson_avltree::stat<> stat; - typedef cds::sync::pool_monitor sync_monitor; - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_simple_stat; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_simple_stat; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_simple_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_shb_less_pool_simple_stat; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_simple_stat > BronsonAVLTreeMap_rcu_sht_less_pool_simple_stat; -#endif - struct BronsonAVLTreeMap_less_pool_lazy: public BronsonAVLTreeMap_less - { - typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_shb_less_pool_lazy; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_sht_less_pool_lazy; -#endif - struct BronsonAVLTreeMap_less_pool_lazy_stat : public BronsonAVLTreeMap_less - { - typedef cc::bronson_avltree::stat<> stat; - typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_lazy_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_shb_less_pool_lazy_stat; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_sht_less_pool_lazy_stat; -#endif - struct BronsonAVLTreeMap_less_pool_bounded: public BronsonAVLTreeMap_less - { - typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_shb_less_pool_bounded; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_sht_less_pool_bounded; -#endif - struct BronsonAVLTreeMap_less_pool_bounded_stat : public BronsonAVLTreeMap_less - { - typedef cc::bronson_avltree::stat<> stat; - typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering - }; - typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat; - typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat; - typedef BronsonAVLTreeMap< rcu_gpt, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpt_less_pool_bounded_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_shb_less_pool_bounded_stat; - typedef BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_sht_less_pool_bounded_stat; -#endif - }; - - template - static inline void print_stat( BronsonAVLTreeMap const& m ) - { - CPPUNIT_MSG( m.statistics() ); - CPPUNIT_MSG( m.monitor().statistics() ); - } - - template - static inline void check_before_cleanup( BronsonAVLTreeMap& m ) - { - CPPUNIT_MSG( " Check internal consistency (single-threaded)..." ); - bool bOk = m.check_consistency([]( size_t nLevel, size_t hLeft, size_t hRight ) - { - CPPUNIT_MSG( "Tree violation on level=" << nLevel << ": hLeft=" << hLeft << ", hRight=" << hRight ) - }); - CPPUNIT_CHECK_CURRENT_EX( bOk, "check_consistency failed"); - } - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_BRONSON_AVLTREE_H diff --git a/tests/unit/map2/map_type_cuckoo.h b/tests/unit/map2/map_type_cuckoo.h deleted file mode 100644 index ece659dc..00000000 --- a/tests/unit/map2/map_type_cuckoo.h +++ /dev/null @@ -1,206 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_CUCKOO_H -#define CDSUNIT_MAP_TYPE_CUCKOO_H - -#include "map2/map_type.h" -#include -#include "print_cuckoo_stat.h" - -namespace map2 { - - template - class CuckooMap: public cc::CuckooMap< K, V, Traits > - { - public: - typedef cc::CuckooMap< K, V, Traits > base_class; - - public: - template - CuckooMap( Config const& cfg ) - : base_class( - - cfg.c_nCuckooInitialSize, - static_cast( cfg.c_nCuckooProbesetSize ), - static_cast( cfg.c_nCuckooProbesetThreshold ) - ) - {} - - template - bool erase_with( Q const& key, Pred /*pred*/ ) - { - return base_class::erase_with( key, typename std::conditional< base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); - } - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_CuckooMap; - - template - struct map_type< tag_CuckooMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::key_hash key_hash; - typedef typename base_class::hash hash; - typedef typename base_class::hash2 hash2; - - template - struct traits_CuckooStripedMap: public Traits - { - typedef cc::cuckoo::striping<> mutex_policy; - }; - template - struct traits_CuckooRefinableMap : public Traits - { - typedef cc::cuckoo::refinable<> mutex_policy; - }; - - struct traits_CuckooMap_list_unord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::list > - , co::equal_to< equal_to > - , co::hash< std::tuple< hash, hash2 > > - > ::type - {}; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord; - - struct traits_CuckooMap_list_unord_stat : public traits_CuckooMap_list_unord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord_stat; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord_stat; - - struct traits_CuckooMap_list_unord_storehash : public traits_CuckooMap_list_unord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_unord_storehash; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_unord_storehash; - - struct traits_CuckooMap_list_ord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::list > - , co::compare< compare > - , co::hash< std::tuple< hash, hash2 > > - >::type - {}; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord; - - struct traits_CuckooMap_list_ord_stat : public traits_CuckooMap_list_ord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord_stat; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord_stat; - - struct traits_CuckooMap_list_ord_storehash : public traits_CuckooMap_list_ord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_list_ord_storehash; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_list_ord_storehash; - - struct traits_CuckooMap_vector_unord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - , co::equal_to< equal_to > - , co::hash< std::tuple< hash, hash2 > > - >::type - {}; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord; - - struct traits_CuckooMap_vector_unord_stat : public traits_CuckooMap_vector_unord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord_stat; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord_stat; - - struct traits_CuckooMap_vector_unord_storehash : public traits_CuckooMap_vector_unord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_unord_storehash; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_unord_storehash; - - struct traits_CuckooMap_vector_ord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - , co::compare< compare > - , co::hash< std::tuple< hash, hash2 > > - >::type - {}; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord; - - struct traits_CuckooMap_vector_ord_stat : public traits_CuckooMap_vector_ord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord_stat; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord_stat; - - struct traits_CuckooMap_vector_ord_storehash : public traits_CuckooMap_vector_ord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooMap< Key, Value, traits_CuckooStripedMap> CuckooStripedMap_vector_ord_storehash; - typedef CuckooMap< Key, Value, traits_CuckooRefinableMap> CuckooRefinableMap_vector_ord_storehash; - - }; - - template - static inline void print_stat( cc::CuckooMap< K, T, Traits > const& m ) - { - CPPUNIT_MSG( m.statistics() << m.mutex_policy_statistics() ); - } - - template - static inline void print_stat( CuckooMap< K, V, Traits > const& m ) - { - typedef CuckooMap< K, V, Traits > map_type; - print_stat( static_cast(m) ); - } - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_CUCKOO_H diff --git a/tests/unit/map2/map_type_ellen_bintree.h b/tests/unit/map2/map_type_ellen_bintree.h deleted file mode 100644 index b061124d..00000000 --- a/tests/unit/map2/map_type_ellen_bintree.h +++ /dev/null @@ -1,279 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_ELLEN_BINTREE_H -#define CDSUNIT_MAP_TYPE_ELLEN_BINTREE_H - -#include "map2/map_type.h" - -#include -#include -#include - -#include "ellen_bintree_update_desc_pool.h" -#include "print_ellenbintree_stat.h" - -namespace map2 { - - template - class EllenBinTreeMap : public cc::EllenBinTreeMap< GC, Key, T, Traits > - { - typedef cc::EllenBinTreeMap< GC, Key, T, Traits > base_class; - public: - template - EllenBinTreeMap( Config const& /*cfg*/) - : base_class() - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_EllenBinTreeMap; - - template - struct map_type< tag_EllenBinTreeMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - - struct ellen_bintree_props { - struct hp_gc { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct dhp_gc { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct gpi { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct gpb { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct gpt { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct shb { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct sht { - typedef cc::ellen_bintree::map_node leaf_node; - typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; -#endif - }; - - struct traits_EllenBinTreeMap: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - struct traits_EllenBinTreeMap_hp : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp >EllenBinTreeMap_hp; - - struct traits_EllenBinTreeMap_dhp : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp >EllenBinTreeMap_dhp; - - struct traits_EllenBinTreeMap_gpi : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_gpi >EllenBinTreeMap_rcu_gpi; - - struct traits_EllenBinTreeMap_gpb : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb >EllenBinTreeMap_rcu_gpb; - - struct traits_EllenBinTreeMap_gpt : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_gpt >EllenBinTreeMap_rcu_gpt; - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits_EllenBinTreeMap_shb : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_shb >EllenBinTreeMap_rcu_shb; - - struct traits_EllenBinTreeMap_sht : traits_EllenBinTreeMap { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_sht >EllenBinTreeMap_rcu_sht; -#endif - - struct traits_EllenBinTreeMap_yield : public traits_EllenBinTreeMap - { - typedef cds::backoff::yield back_off; - }; - struct traits_EllenBinTreeMap_hp_yield : traits_EllenBinTreeMap_yield { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp_yield >EllenBinTreeMap_hp_yield; - - struct traits_EllenBinTreeMap_dhp_yield : traits_EllenBinTreeMap_yield { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp_yield >EllenBinTreeMap_dhp_yield; - - struct traits_EllenBinTreeMap_gpb_yield : traits_EllenBinTreeMap_yield { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb_yield >EllenBinTreeMap_rcu_gpb_yield; - - - struct traits_EllenBinTreeMap_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - - struct traits_EllenBinTreeMap_stat_hp : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_hp > EllenBinTreeMap_hp_stat; - - struct traits_EllenBinTreeMap_stat_dhp : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_dhp > EllenBinTreeMap_dhp_stat; - - struct traits_EllenBinTreeMap_stat_gpi : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_stat_gpi > EllenBinTreeMap_rcu_gpi_stat; - - struct traits_EllenBinTreeMap_stat_gpb : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_stat_gpb > EllenBinTreeMap_rcu_gpb_stat; - - struct traits_EllenBinTreeMap_stat_gpt : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_stat_gpt > EllenBinTreeMap_rcu_gpt_stat; - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits_EllenBinTreeMap_stat_shb : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_stat_shb > EllenBinTreeMap_rcu_shb_stat; - - struct traits_EllenBinTreeMap_stat_sht : public traits_EllenBinTreeMap_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_stat_sht > EllenBinTreeMap_rcu_sht_stat; -#endif - }; - - template - static inline void print_stat( EllenBinTreeMap const& s ) - { - CPPUNIT_MSG( s.statistics() ); - } - template - static inline void additional_cleanup( EllenBinTreeMap& /*s*/ ) - { - ellen_bintree_pool::internal_node_counter::reset(); - } - namespace ellen_bintree_check { - static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& /*s*/ ) - { - // This check is not valid for thread-based RCU - /* - CPPUNIT_CHECK_CURRENT_EX( ellen_bintree_pool::internal_node_counter::m_nAlloc.get() == ellen_bintree_pool::internal_node_counter::m_nFree.get(), - "m_nAlloc=" << ellen_bintree_pool::internal_node_counter::m_nAlloc.get() - << ", m_nFree=" << ellen_bintree_pool::internal_node_counter::m_nFree.get() - ); - */ - } - - static inline void check_stat( cds::intrusive::ellen_bintree::stat<> const& stat ) - { - CPPUNIT_CHECK_CURRENT_EX( stat.m_nInternalNodeCreated == stat.m_nInternalNodeDeleted, - "m_nInternalNodeCreated=" << stat.m_nInternalNodeCreated - << " m_nInternalNodeDeleted=" << stat.m_nInternalNodeDeleted ); - CPPUNIT_CHECK_CURRENT_EX( stat.m_nUpdateDescCreated == stat.m_nUpdateDescDeleted, - "m_nUpdateDescCreated=" << stat.m_nUpdateDescCreated - << " m_nUpdateDescDeleted=" << stat.m_nUpdateDescDeleted ); - CPPUNIT_CHECK_CURRENT_EX( ellen_bintree_pool::internal_node_counter::m_nAlloc.get() == stat.m_nInternalNodeCreated, - "allocated=" << ellen_bintree_pool::internal_node_counter::m_nAlloc.get() - << "m_nInternalNodeCreated=" << stat.m_nInternalNodeCreated ); - } - } // namespace ellen_bintree_check - template - static inline void additional_check( EllenBinTreeMap& s ) - { - GC::force_dispose(); - ellen_bintree_check::check_stat( s.statistics() ); - } - - template - static inline void check_before_cleanup( EllenBinTreeMap& m ) - { - CPPUNIT_MSG( " Check internal consistency (single-threaded)..." ); - CPPUNIT_CHECK_CURRENT( m.check_consistency() ); - } -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_ELLEN_BINTREE_H diff --git a/tests/unit/map2/map_type_feldman_hashmap.h b/tests/unit/map2/map_type_feldman_hashmap.h deleted file mode 100644 index 7d5a8206..00000000 --- a/tests/unit/map2/map_type_feldman_hashmap.h +++ /dev/null @@ -1,201 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_FELDMAN_HASHMAP_H -#define CDSUNIT_MAP_TYPE_FELDMAN_HASHMAP_H - -#include "map2/map_type.h" - -#include -#include -#include - -#include "print_feldman_hashset_stat.h" -#include "hashing/hash_func.h" - -namespace map2 { - - template - class FeldmanHashMap : public cc::FeldmanHashMap< GC, Key, T, Traits > - { - typedef cc::FeldmanHashMap< GC, Key, T, Traits > base_class; - public: - template - FeldmanHashMap( Config const& cfg) - : base_class( cfg.c_nFeldmanMap_HeadBits, cfg.c_nFeldmanMap_ArrayBits ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = true; - }; - - struct tag_FeldmanHashMap; - - template - struct map_type< tag_FeldmanHashMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - - struct traits_FeldmanHashMap_stdhash : public cc::feldman_hashmap::traits - { - typedef std::hash< Key > hash; - }; - - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_hp_stdhash; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_dhp_stdhash; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_rcu_gpi_stdhash; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_rcu_gpb_stdhash; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_rcu_gpt_stdhash; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_rcu_shb_stdhash; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_rcu_sht_stdhash; -#endif - - struct traits_FeldmanHashMap_stdhash_stat: traits_FeldmanHashMap_stdhash - { - typedef cc::feldman_hashmap::stat<> stat; - }; - - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_hp_stdhash_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_dhp_stdhash_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_gpi_stdhash_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_gpb_stdhash_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_gpt_stdhash_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_shb_stdhash_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_sht_stdhash_stat; -#endif - - // CityHash -#if CDS_BUILD_BITS == 64 - struct traits_FeldmanHashMap_city64 : public cc::feldman_hashmap::traits - { - typedef ::hashing::city64 hash; - typedef ::hashing::city64::less less; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_hp_city64; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_dhp_city64; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_rcu_gpi_city64; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_rcu_gpb_city64; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_rcu_gpt_city64; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_rcu_shb_city64; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_city64 > FeldmanHashMap_rcu_sht_city64; -#endif - - struct traits_FeldmanHashMap_city64_stat : public traits_FeldmanHashMap_city64 - { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_hp_city64_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_dhp_city64_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_rcu_gpi_city64_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_rcu_gpb_city64_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_rcu_gpt_city64_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_rcu_shb_city64_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_city64_stat > FeldmanHashMap_rcu_sht_city64_stat; -#endif - - struct traits_FeldmanHashMap_city128 : public cc::feldman_hashmap::traits - { - typedef ::hashing::city128 hash; - typedef ::hashing::city128::less less; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_hp_city128; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_dhp_city128; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_rcu_gpi_city128; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_rcu_gpb_city128; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_rcu_gpt_city128; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_rcu_shb_city128; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_city128 > FeldmanHashMap_rcu_sht_city128; -#endif - - struct traits_FeldmanHashMap_city128_stat : public traits_FeldmanHashMap_city128 - { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_hp_city128_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_dhp_city128_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_rcu_gpi_city128_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_rcu_gpb_city128_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_rcu_gpt_city128_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_rcu_shb_city128_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_city128_stat > FeldmanHashMap_rcu_sht_city128_stat; -#endif -#endif // CDS_BUILD_BITS == 64 - - - // for fixed-sized keys - no hash functor required - typedef FeldmanHashMap< cds::gc::HP, Key, Value > FeldmanHashMap_hp_fixed; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value > FeldmanHashMap_dhp_fixed; - typedef FeldmanHashMap< rcu_gpi, Key, Value > FeldmanHashMap_rcu_gpi_fixed; - typedef FeldmanHashMap< rcu_gpb, Key, Value > FeldmanHashMap_rcu_gpb_fixed; - typedef FeldmanHashMap< rcu_gpt, Key, Value > FeldmanHashMap_rcu_gpt_fixed; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value > FeldmanHashMap_rcu_shb_fixed; - typedef FeldmanHashMap< rcu_sht, Key, Value > FeldmanHashMap_rcu_sht_fixed; -#endif - - struct traits_FeldmanHashMap_stat : public cc::feldman_hashmap::traits - { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_hp_fixed_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_dhp_fixed_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpi_fixed_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpb_fixed_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpt_fixed_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_shb_fixed_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_sht_fixed_stat; -#endif - - }; - - template - static inline void print_stat( FeldmanHashMap< GC, K, T, Traits > const& m ) - { - CPPUNIT_MSG( m.statistics() ); - - std::vector< cds::intrusive::feldman_hashset::level_statistics > level_stat; - m.get_level_statistics( level_stat ); - CPPUNIT_MSG( level_stat ); - } - -} // namespace map2 - -#endif // #ifndef CDSUNIT_MAP_TYPE_FELDMAN_HASHMAP_H diff --git a/tests/unit/map2/map_type_lazy_list.h b/tests/unit/map2/map_type_lazy_list.h deleted file mode 100644 index 6ca2f464..00000000 --- a/tests/unit/map2/map_type_lazy_list.h +++ /dev/null @@ -1,162 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_LAZY_LIST_H -#define CDSUNIT_MAP_TYPE_LAZY_LIST_H - -#include "map2/map_type.h" - -#include -#include -#include -#include - -#include "michael_alloc.h" - -namespace map2 { - - template - struct lazy_list_type - { - typedef typename map_type_base::compare compare; - typedef typename map_type_base::less less; - typedef typename map_type_base::equal_to equal_to; - - struct traits_LazyList_cmp_stdAlloc: - public cc::lazy_list::make_traits< - co::compare< compare > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_HP_cmp_stdAlloc; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_DHP_cmp_stdAlloc; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_NOGC_cmp_stdAlloc; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPI_cmp_stdAlloc; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPB_cmp_stdAlloc; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHB_cmp_stdAlloc; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHT_cmp_stdAlloc; -#endif - - struct traits_LazyList_unord_stdAlloc : - public cc::lazy_list::make_traits< - co::equal_to< equal_to > - ,co::sort< false > - >::type - {}; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_unord_stdAlloc > LazyList_NOGC_unord_stdAlloc; - - struct traits_LazyList_cmp_stdAlloc_seqcst : - public cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_HP_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_DHP_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_NOGC_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPI_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPB_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHB_cmp_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - - struct traits_LazyList_cmp_michaelAlloc : - public cc::lazy_list::make_traits< - co::compare< compare >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_HP_cmp_michaelAlloc; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_DHP_cmp_michaelAlloc; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_NOGC_cmp_michaelAlloc; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPI_cmp_michaelAlloc; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPB_cmp_michaelAlloc; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHB_cmp_michaelAlloc; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHT_cmp_michaelAlloc; -#endif - struct traits_LazyList_less_stdAlloc : - public cc::lazy_list::make_traits< - co::less< less > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_less_stdAlloc > LazyList_HP_less_stdAlloc; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_less_stdAlloc > LazyList_DHP_less_stdAlloc; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_less_stdAlloc > LazyList_NOGC_less_stdAlloc; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_less_stdAlloc > LazyList_RCU_GPI_less_stdAlloc; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_less_stdAlloc > LazyList_RCU_GPB_less_stdAlloc; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_less_stdAlloc > LazyList_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_less_stdAlloc > LazyList_RCU_SHB_less_stdAlloc; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_less_stdAlloc > LazyList_RCU_SHT_less_stdAlloc; -#endif - - struct traits_LazyList_less_stdAlloc_seqcst : - public cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_HP_less_stdAlloc_seqcst; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_DHP_less_stdAlloc_seqcst; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_NOGC_less_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPI_less_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPB_less_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHB_less_stdAlloc_seqcst; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_LazyList_less_michaelAlloc : - public cc::lazy_list::make_traits< - co::less< less >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::LazyKVList< cds::gc::HP, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_HP_less_michaelAlloc; - typedef cc::LazyKVList< cds::gc::DHP, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_DHP_less_michaelAlloc; - typedef cc::LazyKVList< cds::gc::nogc, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_NOGC_less_michaelAlloc; - typedef cc::LazyKVList< rcu_gpi, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPI_less_michaelAlloc; - typedef cc::LazyKVList< rcu_gpb, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPB_less_michaelAlloc; - typedef cc::LazyKVList< rcu_gpt, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_shb, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHB_less_michaelAlloc; - typedef cc::LazyKVList< rcu_sht, Key, Value, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHT_less_michaelAlloc; -#endif - }; - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_LAZY_LIST_H diff --git a/tests/unit/map2/map_type_michael.h b/tests/unit/map2/map_type_michael.h deleted file mode 100644 index c47b6d68..00000000 --- a/tests/unit/map2/map_type_michael.h +++ /dev/null @@ -1,226 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_MICHAEL_H -#define CDSUNIT_MAP_TYPE_MICHAEL_H - -#include "map2/map_type_michael_list.h" -#include "map2/map_type_lazy_list.h" - -#include -#include -#include - -namespace map2 { - - template - class MichaelHashMap : public cc::MichaelHashMap< GC, List, Traits > - { - typedef cc::MichaelHashMap< GC, List, Traits > base_class; - public: - template - MichaelHashMap( Config const& cfg) - : base_class( cfg.c_nMapSize, cfg.c_nLoadFactor ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_MichaelHashMap; - - template - struct map_type< tag_MichaelHashMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::key_hash key_hash; - typedef typename base_class::hash hash; - - - // *************************************************************************** - // MichaelHashMap based on MichaelKVList - typedef michael_list_type< Key, Value > ml; - - struct traits_MichaelMap_hash : - public cc::michael_map::make_traits< - co::hash< hash > - >::type - {}; - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_HP_cmp_stdAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_DHP_cmp_stdAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_NOGC_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPI_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPB_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_SHB_cmp_stdAlloc; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_SHT_cmp_stdAlloc; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_HP_less_stdAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_DHP_less_stdAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_NOGC_less_stdAlloc; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPI_less_stdAlloc; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPB_less_stdAlloc; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_SHB_less_stdAlloc; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_RCU_SHT_less_stdAlloc; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_HP_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_DHP_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_NOGC_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPI_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPB_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHB_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_HP_less_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_DHP_less_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_NOGC_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPI_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPB_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHB_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_MichaelSet_michaelAlloc : - public traits_MichaelMap_hash - { - typedef memory::MichaelAllocator allocator; - }; - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_HP_cmp_michaelAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_DHP_cmp_michaelAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_NOGC_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPI_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPB_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_SHB_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_SHT_cmp_michaelAlloc; -#endif - typedef MichaelHashMap< cds::gc::HP, typename ml::MichaelList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_HP_less_michaelAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ml::MichaelList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_DHP_less_michaelAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ml::MichaelList_NOGC_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_NOGC_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPI_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPB_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ml::MichaelList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_SHB_less_michaelAlloc; - typedef MichaelHashMap< rcu_sht, typename ml::MichaelList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_RCU_SHT_less_michaelAlloc; -#endif - - - // *************************************************************************** - // MichaelHashMap based on LazyKVList - typedef lazy_list_type< Key, Value > ll; - - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_HP_cmp_stdAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_cmp_stdAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_cmp_stdAlloc; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_cmp_stdAlloc; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_cmp_stdAlloc; -#endif - - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_unord_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_unord_stdAlloc; - - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_HP_less_stdAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_less_stdAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_less_stdAlloc; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_less_stdAlloc; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_less_stdAlloc; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_less_stdAlloc; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_less_stdAlloc; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_HP_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_cmp_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_HP_less_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_DHP_less_stdAlloc_seqcst; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_NOGC_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPI_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPB_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHB_less_stdAlloc_seqcst; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelMap_hash > MichaelMap_Lazy_RCU_SHT_less_stdAlloc_seqcst; -#endif - - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_HP_cmp_michaelAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_DHP_cmp_michaelAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_NOGC_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPI_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPB_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_SHB_cmp_michaelAlloc; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_SHT_cmp_michaelAlloc; -#endif - typedef MichaelHashMap< cds::gc::HP, typename ll::LazyList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_HP_less_michaelAlloc; - typedef MichaelHashMap< cds::gc::DHP, typename ll::LazyList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_DHP_less_michaelAlloc; - typedef MichaelHashMap< cds::gc::nogc, typename ll::LazyList_NOGC_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_NOGC_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpi, typename ll::LazyList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPI_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpb, typename ll::LazyList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPB_less_michaelAlloc; - typedef MichaelHashMap< rcu_gpt, typename ll::LazyList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashMap< rcu_shb, typename ll::LazyList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_SHB_less_michaelAlloc; - typedef MichaelHashMap< rcu_sht, typename ll::LazyList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelMap_Lazy_RCU_SHT_less_michaelAlloc; -#endif - - }; -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_MICHAEL_H diff --git a/tests/unit/map2/map_type_michael_list.h b/tests/unit/map2/map_type_michael_list.h deleted file mode 100644 index 6887f39b..00000000 --- a/tests/unit/map2/map_type_michael_list.h +++ /dev/null @@ -1,154 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_MICHAEL_LIST_H -#define CDSUNIT_MAP_TYPE_MICHAEL_LIST_H - -#include "map2/map_type.h" - -#include -#include -#include -#include - -#include "michael_alloc.h" - -namespace map2 { - - template - struct michael_list_type - { - typedef typename map_type_base::compare compare; - typedef typename map_type_base::less less; - - struct traits_MichaelList_cmp_stdAlloc : - public cc::michael_list::make_traits< - co::compare< compare > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_HP_cmp_stdAlloc; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_DHP_cmp_stdAlloc; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_NOGC_cmp_stdAlloc; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPI_cmp_stdAlloc; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPB_cmp_stdAlloc; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHB_cmp_stdAlloc; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHT_cmp_stdAlloc; -#endif - - struct traits_MichaelList_cmp_stdAlloc_seqcst : - public cc::michael_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_HP_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_DHP_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_NOGC_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPI_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPB_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHB_cmp_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - - struct traits_MichaelList_cmp_michaelAlloc : - public cc::michael_list::make_traits< - co::compare< compare >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_HP_cmp_michaelAlloc; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_DHP_cmp_michaelAlloc; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_NOGC_cmp_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPI_cmp_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPB_cmp_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHB_cmp_michaelAlloc; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHT_cmp_michaelAlloc; -#endif - - struct traits_MichaelList_less_stdAlloc : - public cc::michael_list::make_traits< - co::less< less > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_HP_less_stdAlloc; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_DHP_less_stdAlloc; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_NOGC_less_stdAlloc; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPI_less_stdAlloc; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPB_less_stdAlloc; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHB_less_stdAlloc; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHT_less_stdAlloc; -#endif - - struct traits_MichaelList_less_stdAlloc_seqcst : - public cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_HP_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_DHP_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_NOGC_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPI_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPB_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHB_less_stdAlloc_seqcst; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_MichaelList_less_michaelAlloc : - public cc::michael_list::make_traits< - co::less< less >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::MichaelKVList< cds::gc::HP, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_HP_less_michaelAlloc; - typedef cc::MichaelKVList< cds::gc::DHP, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_DHP_less_michaelAlloc; - typedef cc::MichaelKVList< cds::gc::nogc, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_NOGC_less_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpi, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPI_less_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpb, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPB_less_michaelAlloc; - typedef cc::MichaelKVList< rcu_gpt, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_shb, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHB_less_michaelAlloc; - typedef cc::MichaelKVList< rcu_sht, Key, Value, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHT_less_michaelAlloc; -#endif - }; - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_MICHAEL_LIST_H diff --git a/tests/unit/map2/map_type_skip_list.h b/tests/unit/map2/map_type_skip_list.h deleted file mode 100644 index aa4d02b1..00000000 --- a/tests/unit/map2/map_type_skip_list.h +++ /dev/null @@ -1,238 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_SKIP_LIST_H -#define CDSUNIT_MAP_TYPE_SKIP_LIST_H - -#include "map2/map_type.h" - -#include -#include -#include -#include - -#include "print_skip_list_stat.h" - -namespace map2 { - - template - class SkipListMap : public cc::SkipListMap< GC, Key, T, Traits > - { - typedef cc::SkipListMap< GC, Key, T, Traits > base_class; - public: - template - SkipListMap( Config const& /*cfg*/) - : base_class() - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_SkipListMap; - - template - struct map_type< tag_SkipListMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - - class traits_SkipListMap_less_pascal: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_hp_less_pascal; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_dhp_less_pascal; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_nogc_less_pascal; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_rcu_gpi_less_pascal; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_rcu_gpb_less_pascal; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_rcu_gpt_less_pascal; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_rcu_shb_less_pascal; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_less_pascal > SkipListMap_rcu_sht_less_pascal; -#endif - - class traits_SkipListMap_less_pascal_seqcst: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::memory_model< co::v::sequential_consistent > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_hp_less_pascal_seqcst; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_dhp_less_pascal_seqcst; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_nogc_less_pascal_seqcst; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_rcu_gpi_less_pascal_seqcst; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_rcu_gpb_less_pascal_seqcst; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_rcu_gpt_less_pascal_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_rcu_shb_less_pascal_seqcst; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_less_pascal_seqcst > SkipListMap_rcu_sht_less_pascal_seqcst; -#endif - - class traits_SkipListMap_less_pascal_stat: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_hp_less_pascal_stat; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_dhp_less_pascal_stat; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_nogc_less_pascal_stat; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_rcu_gpi_less_pascal_stat; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_rcu_gpb_less_pascal_stat; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_rcu_gpt_less_pascal_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_rcu_shb_less_pascal_stat; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_less_pascal_stat > SkipListMap_rcu_sht_less_pascal_stat; -#endif - - class traits_SkipListMap_cmp_pascal: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_hp_cmp_pascal; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_dhp_cmp_pascal; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_nogc_cmp_pascal; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_rcu_gpi_cmp_pascal; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_rcu_gpb_cmp_pascal; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_rcu_gpt_cmp_pascal; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_rcu_shb_cmp_pascal; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_cmp_pascal > SkipListMap_rcu_sht_cmp_pascal; -#endif - - class traits_SkipListMap_cmp_pascal_stat: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_hp_cmp_pascal_stat; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_dhp_cmp_pascal_stat; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_nogc_cmp_pascal_stat; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_rcu_gpi_cmp_pascal_stat; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_rcu_gpb_cmp_pascal_stat; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_rcu_gpt_cmp_pascal_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_rcu_shb_cmp_pascal_stat; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_cmp_pascal_stat > SkipListMap_rcu_sht_cmp_pascal_stat; -#endif - - class traits_SkipListMap_less_xorshift: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_hp_less_xorshift; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_dhp_less_xorshift; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_nogc_less_xorshift; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_rcu_gpi_less_xorshift; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_rcu_gpb_less_xorshift; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_rcu_gpt_less_xorshift; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_rcu_shb_less_xorshift; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_less_xorshift > SkipListMap_rcu_sht_less_xorshift; -#endif - - class traits_SkipListMap_less_xorshift_stat: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_hp_less_xorshift_stat; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_dhp_less_xorshift_stat; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_nogc_less_xorshift_stat; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_rcu_gpi_less_xorshift_stat; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_rcu_gpb_less_xorshift_stat; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_rcu_gpt_less_xorshift_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_rcu_shb_less_xorshift_stat; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_less_xorshift_stat > SkipListMap_rcu_sht_less_xorshift_stat; -#endif - - class traits_SkipListMap_cmp_xorshift: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_hp_cmp_xorshift; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_dhp_cmp_xorshift; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_nogc_cmp_xorshift; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_rcu_gpi_cmp_xorshift; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_rcu_gpb_cmp_xorshift; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_rcu_gpt_cmp_xorshift; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_rcu_shb_cmp_xorshift; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_cmp_xorshift > SkipListMap_rcu_sht_cmp_xorshift; -#endif - - class traits_SkipListMap_cmp_xorshift_stat: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListMap< cds::gc::HP, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_hp_cmp_xorshift_stat; - typedef SkipListMap< cds::gc::DHP, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_dhp_cmp_xorshift_stat; - typedef SkipListMap< cds::gc::nogc, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_nogc_cmp_xorshift_stat; - typedef SkipListMap< rcu_gpi, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_rcu_gpi_cmp_xorshift_stat; - typedef SkipListMap< rcu_gpb, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_rcu_gpb_cmp_xorshift_stat; - typedef SkipListMap< rcu_gpt, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_rcu_gpt_cmp_xorshift_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListMap< rcu_shb, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_rcu_shb_cmp_xorshift_stat; - typedef SkipListMap< rcu_sht, Key, Value, traits_SkipListMap_cmp_xorshift_stat > SkipListMap_rcu_sht_cmp_xorshift_stat; -#endif - - }; - - template - static inline void print_stat( SkipListMap< GC, K, T, Traits > const& m ) - { - CPPUNIT_MSG( m.statistics() ); - } - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_SKIP_LIST_H diff --git a/tests/unit/map2/map_type_split_list.h b/tests/unit/map2/map_type_split_list.h deleted file mode 100644 index 958972bc..00000000 --- a/tests/unit/map2/map_type_split_list.h +++ /dev/null @@ -1,573 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_SPLIT_LIST_H -#define CDSUNIT_MAP_TYPE_SPLIT_LIST_H - -#include "map2/map_type.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include "print_split_list_stat.h" - -namespace map2 { - - template - class SplitListMap : public cc::SplitListMap< GC, Key, T, Traits > - { - typedef cc::SplitListMap< GC, Key, T, Traits > base_class; - public: - template - SplitListMap( Config const& cfg) - : base_class( cfg.c_nMapSize, cfg.c_nLoadFactor ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - template - class SplitListMap< cds::gc::nogc, Key, T, Traits> : public cc::SplitListMap< cds::gc::nogc, Key, T, Traits > - { - typedef cc::SplitListMap< cds::gc::nogc, Key, T, Traits > base_class; - public: - template - SplitListMap( Config const& cfg) - : base_class( cfg.c_nMapSize, cfg.c_nLoadFactor ) - {} - - template - bool insert( K const& key ) - { - return base_class::insert( key ) != base_class::end(); - } - - template - bool insert( K const& key, V const& val ) - { - return base_class::insert( key, val ) != base_class::end(); - } - - template - bool insert_with( K const& key, Func func ) - { - return base_class::insert_with( key, func ) != base_class::end(); - } - - template - bool find( K const& key ) - { - return base_class::find( key ) != base_class::end(); - } - - void clear() - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - struct tag_SplitListMap; - - template - struct map_type< tag_SplitListMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::key_hash key_hash; - typedef typename base_class::hash hash; - - - // *************************************************************************** - // SplitListMap based on MichaelList - struct traits_SplitList_Michael_dyn_cmp: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_HP_dyn_cmp; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_DHP_dyn_cmp; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_NOGC_dyn_cmp; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPI_dyn_cmp; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPB_dyn_cmp; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPT_dyn_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHB_dyn_cmp; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHT_dyn_cmp; -#endif - - struct traits_SplitList_Michael_dyn_cmp_stat : public traits_SplitList_Michael_dyn_cmp - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_HP_dyn_cmp_stat; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_DHP_dyn_cmp_stat; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_dyn_cmp_stat> SplitList_Michael_NOGC_dyn_cmp_stat; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPI_dyn_cmp_stat; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPB_dyn_cmp_stat; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPT_dyn_cmp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHB_dyn_cmp_stat; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHT_dyn_cmp_stat; -#endif - - struct traits_SplitList_Michael_dyn_cmp_seqcst: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_HP_dyn_cmp_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_DHP_dyn_cmp_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst> SplitList_Michael_NOGC_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPI_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPB_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPT_dyn_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHB_dyn_cmp_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHT_dyn_cmp_seqcst; -#endif - - struct traits_SplitList_Michael_st_cmp: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_HP_st_cmp; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_DHP_st_cmp; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_st_cmp> SplitList_Michael_NOGC_st_cmp; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPI_st_cmp; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPB_st_cmp; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPT_st_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHB_st_cmp; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHT_st_cmp; -#endif - - struct traits_SplitList_Michael_st_cmp_seqcst: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_HP_st_cmp_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_DHP_st_cmp_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_NOGC_st_cmp_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_RCU_GPI_st_cmp_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_RCU_GPB_st_cmp_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_RCU_GPT_st_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_RCU_SHB_st_cmp_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_st_cmp_seqcst > SplitList_Michael_RCU_SHT_st_cmp_seqcst; -#endif - - //HP + less - struct traits_SplitList_Michael_dyn_less: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_HP_dyn_less; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_DHP_dyn_less; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_dyn_less> SplitList_Michael_NOGC_dyn_less; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPI_dyn_less; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPB_dyn_less; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPT_dyn_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHB_dyn_less; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHT_dyn_less; -#endif - - - struct traits_SplitList_Michael_dyn_less_seqcst: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_HP_dyn_less_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_DHP_dyn_less_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_dyn_less_seqcst> SplitList_Michael_NOGC_dyn_less_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPI_dyn_less_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPB_dyn_less_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPT_dyn_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHB_dyn_less_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHT_dyn_less_seqcst; -#endif - - struct traits_SplitList_Michael_st_less: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_HP_st_less; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_DHP_st_less; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_st_less> SplitList_Michael_NOGC_st_less; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPI_st_less; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPB_st_less; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPT_st_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHB_st_less; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHT_st_less; -#endif - - struct traits_SplitList_Michael_st_less_stat : traits_SplitList_Michael_st_less - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_HP_st_less_stat; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_DHP_st_less_stat; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_st_less_stat> SplitList_Michael_NOGC_st_less_stat; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPI_st_less_stat; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPB_st_less_stat; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPT_st_less_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHB_st_less_stat; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHT_st_less_stat; -#endif - - - class traits_SplitList_Michael_st_less_seqcst: public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_HP_st_less_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_DHP_st_less_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, traits_SplitList_Michael_st_less_seqcst> SplitList_Michael_NOGC_st_less_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPI_st_less_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPB_st_less_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPT_st_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHB_st_less_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHT_st_less_seqcst; -#endif - - - // *************************************************************************** - // SplitListMap based on LazyKVList - - struct SplitList_Lazy_dyn_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_HP_dyn_cmp; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_DHP_dyn_cmp; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_dyn_cmp> SplitList_Lazy_NOGC_dyn_cmp; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPI_dyn_cmp; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPB_dyn_cmp; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPT_dyn_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHB_dyn_cmp; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHT_dyn_cmp; -#endif - - struct SplitList_Lazy_dyn_cmp_stat : public SplitList_Lazy_dyn_cmp - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_HP_dyn_cmp_stat; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_DHP_dyn_cmp_stat; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_dyn_cmp_stat> SplitList_Lazy_NOGC_dyn_cmp_stat; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPI_dyn_cmp_stat; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPB_dyn_cmp_stat; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPT_dyn_cmp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_SHB_dyn_cmp_stat; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_SHT_dyn_cmp_stat; -#endif - - struct SplitList_Lazy_dyn_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_HP_dyn_cmp_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_DHP_dyn_cmp_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_dyn_cmp_seqcst> SplitList_Lazy_NOGC_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPI_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPB_dyn_cmp_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPT_dyn_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHB_dyn_cmp_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHT_dyn_cmp_seqcst; -#endif - - struct SplitList_Lazy_st_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_HP_st_cmp; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_DHP_st_cmp; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_st_cmp> SplitList_Lazy_NOGC_st_cmp; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPI_st_cmp; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPB_st_cmp; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPT_st_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHB_st_cmp; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHT_st_cmp; -#endif - - - struct SplitList_Lazy_st_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_HP_st_cmp_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_DHP_st_cmp_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_NOGC_st_cmp_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_RCU_GPI_st_cmp_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_RCU_GPB_st_cmp_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_RCU_GPT_st_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_RCU_SHB_st_cmp_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_st_cmp_seqcst> SplitList_Lazy_RCU_SHT_st_cmp_seqcst; -#endif - - - struct SplitList_Lazy_dyn_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_HP_dyn_less; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_DHP_dyn_less; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_dyn_less> SplitList_Lazy_NOGC_dyn_less; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPI_dyn_less; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPB_dyn_less; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPT_dyn_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHB_dyn_less; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHT_dyn_less; -#endif - - struct SplitList_Lazy_dyn_less_seqcst: - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_HP_dyn_less_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_DHP_dyn_less_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_dyn_less_seqcst> SplitList_Lazy_NOGC_dyn_less_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPI_dyn_less_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPB_dyn_less_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPT_dyn_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHB_dyn_less_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHT_dyn_less_seqcst; -#endif - - struct SplitList_Lazy_st_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_HP_st_less; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_DHP_st_less; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_st_less> SplitList_Lazy_NOGC_st_less; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPI_st_less; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPB_st_less; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPT_st_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHB_st_less; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHT_st_less; -#endif - - struct SplitList_Lazy_st_less_stat : public SplitList_Lazy_st_less - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_HP_st_less_stat; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_DHP_st_less_stat; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_st_less_stat> SplitList_Lazy_NOGC_st_less_stat; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPI_st_less_stat; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPB_st_less_stat; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPT_st_less_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHB_st_less_stat; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHT_st_less_stat; -#endif - - struct SplitList_Lazy_st_less_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_HP_st_less_seqcst; - typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_DHP_st_less_seqcst; - typedef SplitListMap< cds::gc::nogc, Key, Value, SplitList_Lazy_st_less_seqcst> SplitList_Lazy_NOGC_st_less_seqcst; - typedef SplitListMap< rcu_gpi, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPI_st_less_seqcst; - typedef SplitListMap< rcu_gpb, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPB_st_less_seqcst; - typedef SplitListMap< rcu_gpt, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPT_st_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListMap< rcu_shb, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHB_st_less_seqcst; - typedef SplitListMap< rcu_sht, Key, Value, SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHT_st_less_seqcst; -#endif - }; - - template - static inline void print_stat( SplitListMap< GC, K, T, Traits > const& m ) - { - CPPUNIT_MSG( m.statistics() ); - } - -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_SPLIT_LIST_H diff --git a/tests/unit/map2/map_type_std.h b/tests/unit/map2/map_type_std.h deleted file mode 100644 index 6a794b28..00000000 --- a/tests/unit/map2/map_type_std.h +++ /dev/null @@ -1,62 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_STD_H -#define CDSUNIT_MAP_TYPE_STD_H - -#include "map2/map_type.h" - -#include "map2/std_map.h" -#include "map2/std_hash_map.h" - -#include "lock/nolock.h" - -namespace map2 { - - struct tag_StdMap; - - template - struct map_type< tag_StdMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - - typedef StdMap< Key, Value, cds::sync::spin > StdMap_Spin; - typedef StdMap< Key, Value, std::mutex > StdMap_Mutex; - typedef StdMap< Key, Value, lock::NoLock> StdMap_NoLock; - - typedef StdHashMap< Key, Value, cds::sync::spin > StdHashMap_Spin; - typedef StdHashMap< Key, Value, std::mutex > StdHashMap_Mutex; - typedef StdHashMap< Key, Value, lock::NoLock > StdHashMap_NoLock; - }; -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_STD_H diff --git a/tests/unit/map2/map_type_striped.h b/tests/unit/map2/map_type_striped.h deleted file mode 100644 index ccdde5d1..00000000 --- a/tests/unit/map2/map_type_striped.h +++ /dev/null @@ -1,284 +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. -*/ - -#ifndef CDSUNIT_MAP_TYPE_MICHAEL_H -#define CDSUNIT_MAP_TYPE_MICHAEL_H - -#include "map2/map_type.h" -#include -#include -#include - -#include -#if BOOST_VERSION >= 104800 -# include -# include -# include -# include -#endif -#include -#include - -namespace map2 { - - struct tag_StripedMap; - - template - struct map_type< tag_StripedMap, Key, Value >: public map_type_base< Key, Value > - { - typedef map_type_base< Key, Value > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::key_hash key_hash; - typedef typename base_class::hash hash; - typedef typename base_class::hash2 hash2; - - // for sequential containers - template - class StripedHashMap_seq: - public cc::StripedMap< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > - { - typedef cc::StripedMap< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashMap_seq( Config const& cfg ) - : base_class( cfg.c_nMapSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor )) ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - // for non-sequential ordered containers - template - class StripedHashMap_ord: - public cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > - { - typedef cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashMap_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - }; - - - typedef StripedHashMap_seq< - std::list< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > StripedMap_list; - -# if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600 - typedef StripedHashMap_ord< - stdext::hash_map< Key, Value, stdext::hash_compare > - , co::hash< hash2 > - > StripedMap_hashmap; -# else - typedef StripedHashMap_ord< - std::unordered_map< Key, Value, hash, equal_to > - , co::hash< hash2 > - > StripedMap_hashmap; -# endif - - typedef StripedHashMap_ord< - std::map< Key, Value, less > - , co::hash< hash2 > - > StripedMap_map; - - typedef StripedHashMap_ord< - boost::unordered_map< Key, Value, hash, equal_to > - , co::hash< hash2 > - > StripedMap_boost_unordered_map; - -# if BOOST_VERSION >= 104800 - typedef StripedHashMap_seq< - boost::container::slist< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > StripedMap_slist; - - typedef StripedHashMap_seq< - boost::container::list< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > StripedMap_boost_list; - - typedef StripedHashMap_ord< - boost::container::map< Key, Value, less > - , co::hash< hash2 > - > StripedMap_boost_map; - - typedef StripedHashMap_ord< - boost::container::flat_map< Key, Value, less > - , co::hash< hash2 > - > StripedMap_boost_flat_map; -# endif // BOOST_VERSION >= 104800 - - - // *************************************************************************** - // RefinableHashMap - - // for sequential containers - template - class RefinableHashMap_seq: - public cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > - { - typedef cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashMap_seq( Config const& cfg ) - : base_class( cfg.c_nMapSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor ))) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - // for non-sequential ordered containers - template - class RefinableHashMap_ord: - public cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > - { - typedef cc::StripedMap< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashMap_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - }; - - - typedef RefinableHashMap_seq< - std::list< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > RefinableMap_list; - -# if BOOST_VERSION >= 104800 - typedef RefinableHashMap_seq< - boost::container::slist< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > RefinableMap_slist; -# endif - - typedef RefinableHashMap_ord< - std::map< Key, Value, less > - , co::hash< hash2 > - > RefinableMap_map; - - typedef RefinableHashMap_ord< - std::unordered_map< Key, Value, hash, equal_to > - , co::hash< hash2 > - > RefinableMap_hashmap; - - typedef RefinableHashMap_ord< - boost::unordered_map< Key, Value, hash, equal_to > - , co::hash< hash2 > - > RefinableMap_boost_unordered_map; - -# if BOOST_VERSION >= 104800 - typedef RefinableHashMap_seq< - boost::container::list< std::pair< Key const, Value > > - , co::hash< hash2 > - , co::less< less > - > RefinableMap_boost_list; - - typedef RefinableHashMap_ord< - boost::container::map< Key, Value, less > - , co::hash< hash2 > - > RefinableMap_boost_map; - - typedef RefinableHashMap_ord< - boost::container::flat_map< Key, Value, less > - , co::hash< hash2 > - > RefinableMap_boost_flat_map; -# endif // #if BOOST_VERSION >= 104800 - - }; -} // namespace map2 - -#endif // ifndef CDSUNIT_MAP_TYPE_MICHAEL_H diff --git a/tests/unit/map2/std_hash_map.h b/tests/unit/map2/std_hash_map.h deleted file mode 100644 index 837b0e49..00000000 --- a/tests/unit/map2/std_hash_map.h +++ /dev/null @@ -1,137 +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. -*/ - -#ifndef CDSUNIT_STD_HASH_MAP_GCC_H -#define CDSUNIT_STD_HASH_MAP_GCC_H - -#include //unique_lock -#include - -namespace map2 { - - template >::other - > - class StdHashMap - : public std::unordered_map< - Key, Value - , std::hash - , std::equal_to - , Alloc - > - { - public: - Lock m_lock; - typedef std::unique_lock scoped_lock; - typedef std::unordered_map< - Key, Value - , std::hash - , std::equal_to - , Alloc - > base_class; - public: - typedef typename base_class::mapped_type value_type; - typedef size_t item_counter; - - StdHashMap() - {} - - template - StdHashMap( Config const& ) - {} - - bool contains( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::find( key ) != base_class::end(); - } - - bool insert( const Key& key, const Value& val ) - { - scoped_lock al( m_lock ); - return base_class::insert( typename base_class::value_type(key, val)).second; - } - - template - bool insert( const Key& key, const T& val, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( typename base_class::value_type(key, Value() )); - if ( pRet.second ) { - func( pRet.first->second, val ); - return true; - } - return false; - } - - template - std::pair update( const T& key, Func func, bool /*bAllowInsert*/ = true ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( typename base_class::value_type( key, Value() )); - if ( pRet.second ) { - func( true, *pRet.first ); - return std::make_pair( true, true ); - } - else { - func( false, *pRet.first ); - return std::make_pair( true, false ); - } - } - - bool erase( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::erase( key ) != 0; - } - - template - bool erase( const T& key, Func func ) - { - scoped_lock al( m_lock ); - typename base_class::iterator it = base_class::find( key ); - if ( it != base_class::end() ) { - func( *it ); - return base_class::erase( key ) != 0; - } - return false; - } - - std::ostream& dump( std::ostream& stm ) { return stm; } - - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; -} // namespace map2 - -#endif // #ifndef CDSUNIT_STD_HASH_MAP_GCC_H diff --git a/tests/unit/map2/std_map.h b/tests/unit/map2/std_map.h deleted file mode 100644 index 79635375..00000000 --- a/tests/unit/map2/std_map.h +++ /dev/null @@ -1,127 +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. -*/ - -#ifndef CDSUNIT_STD_MAP_GCC_H -#define CDSUNIT_STD_MAP_GCC_H - -#include -#include //unique_lock - -namespace map2 { - - template >::other - > - class StdMap: public std::map, Alloc> - { - Lock m_lock; - typedef std::unique_lock scoped_lock; - typedef std::map, Alloc> base_class; - public: - typedef typename base_class::mapped_type value_type; - typedef typename base_class::value_type pair_type; - typedef size_t item_counter; - - StdMap() - {} - - template - StdMap( Config const& ) - {} - - bool contains( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::find( key ) != base_class::end(); - } - - bool insert( const Key& key, const Value& val ) - { - scoped_lock al( m_lock ); - return base_class::insert( typename base_class::value_type(key, val)).second; - } - - template - bool insert( const Key& key, const T& val, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( typename base_class::value_type(key, Value() )); - if ( pRet.second ) { - func( pRet.first->second, val ); - return true; - } - return false; - } - - template - std::pair update( const T& key, Func func, bool /*bAllowInsert*/ = true ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( typename base_class::value_type(key, Value() )); - if ( pRet.second ) { - func( true, *pRet.first ); - return std::make_pair( true, true ); - } - else { - func( false, *pRet.first ); - return std::make_pair( true, false ); - } - } - - bool erase( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::erase( key ) != 0; - } - - template - bool erase( const T& key, Func func ) - { - scoped_lock al( m_lock ); - typename base_class::iterator it = base_class::find( key ); - if ( it != base_class::end() ) { - func( (*it) ); - base_class::erase( it ); - return true; - } - return false; - } - - std::ostream& dump( std::ostream& stm ) { return stm; } - - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; -} // namespace map - -#endif // #ifndef CDSUNIT_STD_MAP_GCC_H -- 2.34.1