From 3584c62b9f894a8e63d39b9ea90b012fa85bba78 Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 7 Apr 2016 00:41:36 +0300 Subject: [PATCH] Removed old map unit tests --- projects/Win/vc14/cds.sln | 19 - projects/Win/vc14/hdr-test-map.vcxproj | 411 ------ .../Win/vc14/hdr-test-map.vcxproj.filters | 239 ---- projects/source.test-hdr.mk | 67 - projects/source.test-hdr.offsetof.mk | 4 - tests/test-hdr/CMakeLists.txt | 71 - tests/test-hdr/map/hdr_cuckoo_map.cpp | 682 --------- tests/test-hdr/map/hdr_cuckoo_map.h | 421 ------ tests/test-hdr/map/hdr_feldman_hashmap.h | 827 ----------- .../test-hdr/map/hdr_feldman_hashmap_dhp.cpp | 226 --- tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp | 226 --- .../map/hdr_feldman_hashmap_rcu_gpb.cpp | 225 --- .../map/hdr_feldman_hashmap_rcu_gpi.cpp | 225 --- .../map/hdr_feldman_hashmap_rcu_gpt.cpp | 225 --- .../map/hdr_feldman_hashmap_rcu_shb.cpp | 251 ---- .../map/hdr_feldman_hashmap_rcu_sht.cpp | 251 ---- tests/test-hdr/map/hdr_map.h | 1273 ----------------- tests/test-hdr/map/hdr_michael_map_dhp.cpp | 115 -- tests/test-hdr/map/hdr_michael_map_hp.cpp | 118 -- .../test-hdr/map/hdr_michael_map_lazy_dhp.cpp | 115 -- .../test-hdr/map/hdr_michael_map_lazy_hp.cpp | 115 -- .../map/hdr_michael_map_lazy_nogc.cpp | 137 -- .../map/hdr_michael_map_lazy_rcu_gpb.cpp | 118 -- .../map/hdr_michael_map_lazy_rcu_gpi.cpp | 118 -- .../map/hdr_michael_map_lazy_rcu_gpt.cpp | 118 -- .../map/hdr_michael_map_lazy_rcu_shb.cpp | 124 -- .../map/hdr_michael_map_lazy_rcu_sht.cpp | 124 -- tests/test-hdr/map/hdr_michael_map_nogc.cpp | 113 -- .../test-hdr/map/hdr_michael_map_rcu_gpb.cpp | 118 -- .../test-hdr/map/hdr_michael_map_rcu_gpi.cpp | 118 -- .../test-hdr/map/hdr_michael_map_rcu_gpt.cpp | 118 -- .../test-hdr/map/hdr_michael_map_rcu_shb.cpp | 124 -- .../test-hdr/map/hdr_michael_map_rcu_sht.cpp | 124 -- .../hdr_refinable_hashmap_boost_flat_map.cpp | 206 --- .../map/hdr_refinable_hashmap_boost_list.cpp | 191 --- .../map/hdr_refinable_hashmap_boost_map.cpp | 195 --- ..._refinable_hashmap_boost_unordered_map.cpp | 174 --- .../map/hdr_refinable_hashmap_hashmap_std.cpp | 172 --- .../map/hdr_refinable_hashmap_list.cpp | 167 --- .../map/hdr_refinable_hashmap_map.cpp | 173 --- .../map/hdr_refinable_hashmap_slist.cpp | 191 --- tests/test-hdr/map/hdr_skiplist_map.h | 570 -------- tests/test-hdr/map/hdr_skiplist_map_dhp.cpp | 339 ----- tests/test-hdr/map/hdr_skiplist_map_hp.cpp | 341 ----- tests/test-hdr/map/hdr_skiplist_map_nogc.cpp | 339 ----- tests/test-hdr/map/hdr_skiplist_map_rcu.h | 546 ------- .../test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp | 345 ----- .../test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp | 347 ----- .../test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp | 345 ----- .../test-hdr/map/hdr_skiplist_map_rcu_shb.cpp | 396 ----- .../test-hdr/map/hdr_skiplist_map_rcu_sht.cpp | 396 ----- tests/test-hdr/map/hdr_splitlist_map_dhp.cpp | 189 --- tests/test-hdr/map/hdr_splitlist_map_hp.cpp | 190 --- .../map/hdr_splitlist_map_lazy_dhp.cpp | 189 --- .../map/hdr_splitlist_map_lazy_hp.cpp | 189 --- .../map/hdr_splitlist_map_lazy_nogc.cpp | 189 --- .../map/hdr_splitlist_map_lazy_rcu_gpb.cpp | 192 --- .../map/hdr_splitlist_map_lazy_rcu_gpi.cpp | 192 --- .../map/hdr_splitlist_map_lazy_rcu_gpt.cpp | 193 --- .../map/hdr_splitlist_map_lazy_rcu_shb.cpp | 202 --- .../map/hdr_splitlist_map_lazy_rcu_sht.cpp | 201 --- tests/test-hdr/map/hdr_splitlist_map_nogc.cpp | 190 --- .../map/hdr_splitlist_map_rcu_gpb.cpp | 192 --- .../map/hdr_splitlist_map_rcu_gpi.cpp | 193 --- .../map/hdr_splitlist_map_rcu_gpt.cpp | 192 --- .../map/hdr_splitlist_map_rcu_shb.cpp | 201 --- .../map/hdr_splitlist_map_rcu_sht.cpp | 201 --- .../hdr_striped_hashmap_boost_flat_map.cpp | 197 --- .../map/hdr_striped_hashmap_boost_list.cpp | 182 --- .../map/hdr_striped_hashmap_boost_map.cpp | 185 --- ...dr_striped_hashmap_boost_unordered_map.cpp | 162 --- .../map/hdr_striped_hashmap_hashmap_std.cpp | 162 --- .../test-hdr/map/hdr_striped_hashmap_list.cpp | 159 -- .../test-hdr/map/hdr_striped_hashmap_map.cpp | 162 --- .../map/hdr_striped_hashmap_slist.cpp | 181 --- tests/test-hdr/map/hdr_striped_map.h | 615 -------- tests/test-hdr/map/hdr_striped_map_reg.cpp | 33 - tests/test-hdr/map/print_skiplist_stat.h | 71 - 78 files changed, 18197 deletions(-) delete mode 100644 projects/Win/vc14/hdr-test-map.vcxproj delete mode 100644 projects/Win/vc14/hdr-test-map.vcxproj.filters delete mode 100644 tests/test-hdr/map/hdr_cuckoo_map.cpp delete mode 100644 tests/test-hdr/map/hdr_cuckoo_map.h delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap.h delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_map.h delete mode 100644 tests/test-hdr/map/hdr_michael_map_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_nogc.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_list.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_map.cpp delete mode 100644 tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map.h delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_nogc.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu.h delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_nogc.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp delete mode 100644 tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_list.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_map.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_hashmap_slist.cpp delete mode 100644 tests/test-hdr/map/hdr_striped_map.h delete mode 100644 tests/test-hdr/map/hdr_striped_map_reg.cpp delete mode 100644 tests/test-hdr/map/print_skiplist_stat.h diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index d2ff19a8..5041cf38 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -34,12 +34,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "single-threaded test", "sin ..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-map", "hdr-test-map.vcxproj", "{282E9A9A-386A-40FB-A483-994BACE24830}" - ProjectSection(ProjectDependencies) = postProject - {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} - {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-misc", "hdr-test-misc.vcxproj", "{C5E76975-B87B-4B9E-8596-B01DDA683FCA}" ProjectSection(ProjectDependencies) = postProject {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} @@ -264,18 +258,6 @@ Global {77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|Win32.Build.0 = Release|Win32 {77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|x64.ActiveCfg = Release|x64 {77350FDC-9E51-438B-9A8F-D2FEA11D46B2}.Release|x64.Build.0 = Release|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|Win32.ActiveCfg = Debug|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|Win32.Build.0 = Debug|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|x64.ActiveCfg = Debug|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.Debug|x64.Build.0 = Debug|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.Release|Win32.ActiveCfg = Release|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.Release|Win32.Build.0 = Release|Win32 - {282E9A9A-386A-40FB-A483-994BACE24830}.Release|x64.ActiveCfg = Release|x64 - {282E9A9A-386A-40FB-A483-994BACE24830}.Release|x64.Build.0 = Release|x64 {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|Win32.ActiveCfg = Debug|Win32 {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|Win32.Build.0 = Debug|Win32 {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Debug|x64.ActiveCfg = Debug|x64 @@ -571,7 +553,6 @@ Global GlobalSection(NestedProjects) = preSolution {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {B30CA283-1796-4763-92C3-2E4848D443F7} {77350FDC-9E51-438B-9A8F-D2FEA11D46B2} = {B30CA283-1796-4763-92C3-2E4848D443F7} - {282E9A9A-386A-40FB-A483-994BACE24830} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75} {C5E76975-B87B-4B9E-8596-B01DDA683FCA} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75} {6BB7A27F-FC59-4267-B6FA-D034176D1459} = {B30CA283-1796-4763-92C3-2E4848D443F7} {A64449B7-90FB-4E2B-A686-9EFC0E298644} = {B30CA283-1796-4763-92C3-2E4848D443F7} diff --git a/projects/Win/vc14/hdr-test-map.vcxproj b/projects/Win/vc14/hdr-test-map.vcxproj deleted file mode 100644 index 4c8406ce..00000000 --- a/projects/Win/vc14/hdr-test-map.vcxproj +++ /dev/null @@ -1,411 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {282E9A9A-386A-40FB-A483-994BACE24830} - hdrtestmap - Win32Proj - 8.1 - - - - Application - MultiByte - v140 - - - Application - MultiByte - true - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - true - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX64 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Full - AnySuitable - true - Speed - false - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - MultiThreadedDLL - StreamingSIMDExtensions2 - - - Level3 - ProgramDatabase - Cdecl - false - 4520 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - false - - - MachineX86 - true - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Full - AnySuitable - true - Speed - false - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - MultiThreadedDLL - - - Level3 - ProgramDatabase - Cdecl - false - 4520 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - UseLinkTimeCodeGeneration - false - - - MachineX64 - true - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX64 - MultiplyDefinedSymbolOnly - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/Win/vc14/hdr-test-map.vcxproj.filters b/projects/Win/vc14/hdr-test-map.vcxproj.filters deleted file mode 100644 index 2fe1b481..00000000 --- a/projects/Win/vc14/hdr-test-map.vcxproj.filters +++ /dev/null @@ -1,239 +0,0 @@ - - - - - cuckoo - - - michael - - - michael - - - michael - - - michael - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - skip_list - - - split_list - - - split_list - - - split_list - - - split_list - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - striped - - - michael - - - michael - - - michael - - - michael - - - michael - - - michael - - - split_list - - - split_list - - - split_list - - - split_list - - - split_list - - - split_list - - - skip_list - - - skip_list - - - skip_list - - - skip_list - - - striped - - - michael - - - michael - - - michael - - - michael - - - skip_list - - - skip_list - - - split_list - - - split_list - - - split_list - - - split_list - - - michael - - - michael - - - split_list - - - split_list - - - skip_list - - - multilvel_hashmap - - - multilvel_hashmap - - - multilvel_hashmap - - - multilvel_hashmap - - - multilvel_hashmap - - - multilvel_hashmap - - - multilvel_hashmap - - - - - - - skip_list - - - skip_list - - - striped - - - cuckoo - - - multilvel_hashmap - - - - - {9cc8e982-b321-4a7d-8362-7f1491ad445d} - - - {c524c47b-2087-42eb-b3b2-f70ed379e373} - - - {33452d52-b86d-4143-9f87-bf154d53f890} - - - {1f7bd2f3-a377-47a5-aaae-aaddd60cbedc} - - - {9318c3c0-92a3-4a5a-be2b-a47411a3e4c4} - - - {cf81877d-3069-48a6-a143-2281963e9c4f} - - - \ No newline at end of file diff --git a/projects/source.test-hdr.mk b/projects/source.test-hdr.mk index 981138d5..8ff1ee71 100644 --- a/projects/source.test-hdr.mk +++ b/projects/source.test-hdr.mk @@ -1,69 +1,3 @@ -CDS_TESTHDR_MAP := \ - tests/test-hdr/map/hdr_michael_map_hp.cpp \ - tests/test-hdr/map/hdr_michael_map_dhp.cpp \ - tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp \ - tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp \ - tests/test-hdr/map/hdr_michael_map_nogc.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp \ - tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp \ - tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_list.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_map.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp \ - tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp \ - tests/test-hdr/map/hdr_skiplist_map_hp.cpp \ - tests/test-hdr/map/hdr_skiplist_map_dhp.cpp \ - tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp \ - tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp \ - tests/test-hdr/map/hdr_skiplist_map_nogc.cpp \ - tests/test-hdr/map/hdr_splitlist_map_hp.cpp \ - tests/test-hdr/map/hdr_splitlist_map_dhp.cpp \ - tests/test-hdr/map/hdr_splitlist_map_nogc.cpp \ - tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp \ - tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp \ - tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_list.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_map.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp \ - tests/test-hdr/map/hdr_striped_hashmap_slist.cpp \ - tests/test-hdr/map/hdr_striped_map_reg.cpp - CDS_TESTHDR_TREE := \ tests/test-hdr/tree/hdr_tree_reg.cpp \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp.cpp \ @@ -112,7 +46,6 @@ CDS_TESTHDR_MISC := \ tests/test-hdr/misc/thread_init_fini.cpp CDS_TESTHDR_SOURCES := \ - $(CDS_TESTHDR_MAP) \ $(CDS_TESTHDR_TREE) \ $(CDS_TESTHDR_MISC) diff --git a/projects/source.test-hdr.offsetof.mk b/projects/source.test-hdr.offsetof.mk index ca559e89..3723e1b8 100644 --- a/projects/source.test-hdr.offsetof.mk +++ b/projects/source.test-hdr.offsetof.mk @@ -1,6 +1,3 @@ -CDS_TESTHDR_OFFSETOF_MAP := \ - tests/test-hdr/map/hdr_cuckoo_map.cpp - CDS_TESTHDR_OFFSETOF_TREE := \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp_member.cpp \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_dhp_member.cpp \ @@ -11,5 +8,4 @@ CDS_TESTHDR_OFFSETOF_TREE := \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp CDS_TESTHDR_OFFSETOF_SOURCES := \ - $(CDS_TESTHDR_OFFSETOF_MAP) \ $(CDS_TESTHDR_OFFSETOF_TREE) diff --git a/tests/test-hdr/CMakeLists.txt b/tests/test-hdr/CMakeLists.txt index ad887533..34808779 100644 --- a/tests/test-hdr/CMakeLists.txt +++ b/tests/test-hdr/CMakeLists.txt @@ -1,71 +1,5 @@ set(PACKAGE_NAME test-hdr) -set(CDS_TESTHDR_MAP - map/hdr_michael_map_hp.cpp - map/hdr_michael_map_dhp.cpp - map/hdr_michael_map_rcu_gpi.cpp - map/hdr_michael_map_rcu_gpb.cpp - map/hdr_michael_map_rcu_gpt.cpp - map/hdr_michael_map_rcu_shb.cpp - map/hdr_michael_map_rcu_sht.cpp - map/hdr_michael_map_nogc.cpp - map/hdr_michael_map_lazy_hp.cpp - map/hdr_michael_map_lazy_dhp.cpp - map/hdr_michael_map_lazy_rcu_gpi.cpp - map/hdr_michael_map_lazy_rcu_gpb.cpp - map/hdr_michael_map_lazy_rcu_gpt.cpp - map/hdr_michael_map_lazy_rcu_shb.cpp - map/hdr_michael_map_lazy_rcu_sht.cpp - map/hdr_michael_map_lazy_nogc.cpp - map/hdr_feldman_hashmap_hp.cpp - map/hdr_feldman_hashmap_dhp.cpp - map/hdr_feldman_hashmap_rcu_gpb.cpp - map/hdr_feldman_hashmap_rcu_gpi.cpp - map/hdr_feldman_hashmap_rcu_gpt.cpp - map/hdr_feldman_hashmap_rcu_shb.cpp - map/hdr_feldman_hashmap_rcu_sht.cpp - map/hdr_refinable_hashmap_hashmap_std.cpp - map/hdr_refinable_hashmap_boost_list.cpp - map/hdr_refinable_hashmap_list.cpp - map/hdr_refinable_hashmap_map.cpp - map/hdr_refinable_hashmap_boost_map.cpp - map/hdr_refinable_hashmap_boost_flat_map.cpp - map/hdr_refinable_hashmap_boost_unordered_map.cpp - map/hdr_refinable_hashmap_slist.cpp - map/hdr_skiplist_map_hp.cpp - map/hdr_skiplist_map_dhp.cpp - map/hdr_skiplist_map_rcu_gpi.cpp - map/hdr_skiplist_map_rcu_gpb.cpp - map/hdr_skiplist_map_rcu_gpt.cpp - map/hdr_skiplist_map_rcu_shb.cpp - map/hdr_skiplist_map_rcu_sht.cpp - map/hdr_skiplist_map_nogc.cpp - map/hdr_splitlist_map_hp.cpp - map/hdr_splitlist_map_dhp.cpp - map/hdr_splitlist_map_nogc.cpp - map/hdr_splitlist_map_rcu_gpi.cpp - map/hdr_splitlist_map_rcu_gpb.cpp - map/hdr_splitlist_map_rcu_gpt.cpp - map/hdr_splitlist_map_rcu_shb.cpp - map/hdr_splitlist_map_rcu_sht.cpp - map/hdr_splitlist_map_lazy_hp.cpp - map/hdr_splitlist_map_lazy_dhp.cpp - map/hdr_splitlist_map_lazy_nogc.cpp - map/hdr_splitlist_map_lazy_rcu_gpi.cpp - map/hdr_splitlist_map_lazy_rcu_gpb.cpp - map/hdr_splitlist_map_lazy_rcu_gpt.cpp - map/hdr_splitlist_map_lazy_rcu_sht.cpp - map/hdr_splitlist_map_lazy_rcu_shb.cpp - map/hdr_striped_hashmap_hashmap_std.cpp - map/hdr_striped_hashmap_boost_list.cpp - map/hdr_striped_hashmap_list.cpp - map/hdr_striped_hashmap_map.cpp - map/hdr_striped_hashmap_boost_map.cpp - map/hdr_striped_hashmap_boost_flat_map.cpp - map/hdr_striped_hashmap_boost_unordered_map.cpp - map/hdr_striped_hashmap_slist.cpp - map/hdr_striped_map_reg.cpp) - set(CDS_TESTHDR_TREE tree/hdr_tree_reg.cpp tree/hdr_intrusive_ellen_bintree_hp.cpp @@ -113,9 +47,6 @@ set(CDS_TESTHDR_MISC misc/permutation_generator.cpp misc/thread_init_fini.cpp) -set(CDS_TESTHDR_OFFSETOF_MAP - map/hdr_cuckoo_map.cpp) - set(CDS_TESTHDR_OFFSETOF_TREE tree/hdr_intrusive_ellen_bintree_hp_member.cpp tree/hdr_intrusive_ellen_bintree_dhp_member.cpp @@ -126,7 +57,6 @@ set(CDS_TESTHDR_OFFSETOF_TREE tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp) set(CDS_TESTHDR_OFFSETOF_SOURCES - ${CDS_TESTHDR_OFFSETOF_MAP} ${CDS_TESTHDR_OFFSETOF_TREE}) add_library(test-hdr-offsetof OBJECT ${CDS_TESTHDR_OFFSETOF_SOURCES}) @@ -136,7 +66,6 @@ if(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC) set(CDS_TESTHDR_SOURCES - ${CDS_TESTHDR_MAP} ${CDS_TESTHDR_TREE} ${CDS_TESTHDR_MISC}) diff --git a/tests/test-hdr/map/hdr_cuckoo_map.cpp b/tests/test-hdr/map/hdr_cuckoo_map.cpp deleted file mode 100644 index 643010a3..00000000 --- a/tests/test-hdr/map/hdr_cuckoo_map.cpp +++ /dev/null @@ -1,682 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_cuckoo_map.h" -#include - -namespace map { - - namespace { - typedef CuckooMapHdrTest::hash_int hash1; - struct hash2: private hash1 - { - typedef hash1 base_class; - - size_t operator()( int i ) const - { - size_t h = ~( base_class::operator()(i)); - return ~h + 0x9e3779b9 + (h << 6) + (h >> 2); - } - }; - } - - void CuckooMapHdrTest::Cuckoo_striped_list() - { - CPPUNIT_MESSAGE( "equal"); - { - struct map_traits : public cc::cuckoo::traits { - typedef std::equal_to equal_to; - typedef co::hash_tuple< hash1, hash2 > hash; - }; - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, map_traits > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - } - - - void CuckooMapHdrTest::Cuckoo_striped_vector() - { - CPPUNIT_MESSAGE( "equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::striping<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::striping<> > - ,co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - } - - - void CuckooMapHdrTest::Cuckoo_refinable_list() - { - CPPUNIT_MESSAGE( "equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::list > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - } - - - void CuckooMapHdrTest::Cuckoo_refinable_vector() - { - CPPUNIT_MESSAGE( "equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::mutex_policy< cc::cuckoo::refinable<> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< false > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,cc::cuckoo::store_hash< false > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::compare< CuckooMapHdrTest::cmp > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to > - ,co::hash< std::tuple< hash1, hash2 > > - ,co::mutex_policy< cc::cuckoo::refinable<> > - ,cc::cuckoo::store_hash< false > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - >::type - > map_t; - - test_cuckoo(); - } - - CPPUNIT_MESSAGE( "less+cmp+equal, store hash"); - { - typedef cc::CuckooMap< CuckooMapHdrTest::key_type, CuckooMapHdrTest::value_type, - cc::cuckoo::make_traits< - co::mutex_policy< cc::cuckoo::refinable<> > - ,co::less< std::less > - ,co::compare< CuckooMapHdrTest::cmp > - ,co::equal_to< std::equal_to< int > > - ,cc::cuckoo::store_hash< true > - ,cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - ,co::hash< std::tuple< hash1, hash2 > > - >::type - > map_t; - - test_cuckoo(); - } - } - -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::CuckooMapHdrTest); diff --git a/tests/test-hdr/map/hdr_cuckoo_map.h b/tests/test-hdr/map/hdr_cuckoo_map.h deleted file mode 100644 index 7135645a..00000000 --- a/tests/test-hdr/map/hdr_cuckoo_map.h +++ /dev/null @@ -1,421 +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 CDSTEST_HDR_CUCKOO_MAP_H -#define CDSTEST_HDR_CUCKOO_MAP_H -#include "size_check.h" - -#include "cppunit/cppunit_proxy.h" -#include -#include -#include // ref - -namespace cds { namespace container {}} - -namespace map { - using misc::check_size; - - namespace cc = cds::container; - namespace co = cds::opt; - - class CuckooMapHdrTest: public CppUnitMini::TestCase - { - public: - typedef int key_type; - - struct value_type { - int m_val; - - value_type() - : m_val(0) - {} - - value_type( int n ) - : m_val( n ) - {} - - value_type( value_type&& v ) - : m_val( v.m_val ) - {} - - value_type( value_type const& v ) - : m_val( v.m_val ) - {} - - value_type& operator=( value_type const& v ) - { - m_val = v.m_val; - return *this; - } - }; - - typedef std::pair pair_type; - - struct less - { - bool operator ()(int v1, int v2 ) const - { - return v1 < v2; - } - }; - - struct cmp { - int operator ()(int v1, int v2 ) const - { - if ( v1 < v2 ) - return -1; - return v1 > v2 ? 1 : 0; - } - }; - - struct equal { - bool operator ()(int v1, int v2 ) const - { - return v1 == v2; - } - }; - - struct hash_int { - size_t operator()( int i ) const - { - return co::v::hash()( i ); - } - }; - - struct simple_item_counter { - size_t m_nCount; - - simple_item_counter() - : m_nCount(0) - {} - - size_t operator ++() - { - return ++m_nCount; - } - - size_t operator --() - { - return --m_nCount; - } - - void reset() - { - m_nCount = 0; - } - - operator size_t() const - { - return m_nCount; - } - }; - - template - struct insert_functor - { - typedef typename Map::value_type pair_type; - - // insert ftor - void operator()( pair_type& item ) - { - item.second.m_val = item.first * 3; - } - - // update() ftor - void operator()( bool bNew, pair_type& item ) - { - if ( bNew ) - item.second.m_val = item.first * 2; - else - item.second.m_val = item.first * 5; - } - }; - - struct check_value { - int m_nExpected; - - check_value( int nExpected ) - : m_nExpected( nExpected ) - {} - - template - void operator ()( T& pair ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - template - void operator ()( T& pair, Q ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - }; - - struct extract_functor - { - int * m_pVal; - void operator()( pair_type const& val ) - { - *m_pVal = val.second.m_val; - } - }; - - /* - template - void test_iter( Map& s) - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - const int nMaxCount = 500; - for ( int i = 0; i < nMaxCount; ++i ) { - CPPUNIT_ASSERT( s.insert( i, i * 2 )); - } - - int nCount = 0; - for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first * 2 == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val ); - it->second.m_val = it->first; - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - - Map const& refSet = s; - nCount = 0; - for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - } - */ - - - template - void test_cuckoo() - { - Map m( 32, 4, 3 ); - CPPUNIT_ASSERT( m.bucket_count() == 32 ); - CPPUNIT_ASSERT( m.lock_count() == 32 ); - - test_cuckoo_with( m ); - - // Iterators is not yet supported for CuckooMap - //m.clear(); - //CPPUNIT_ASSERT( m.empty() ); - //CPPUNIT_ASSERT( check_size( m, 0 )); - //test_iter(m); - } - - //******************************************* - // If erase_with && find_with are supported - template - void test_int_with( Map& m ) - { - std::pair updateResult; - typedef typename std::conditional< Map::c_isSorted, less, equal >::type predicate; - - // insert - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0 - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(25) ); - - CPPUNIT_ASSERT( !m.insert( 25 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - - CPPUNIT_ASSERT( !m.contains(10, predicate()) ); - CPPUNIT_ASSERT( m.insert( 10, 10 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(10, predicate()) ); - - CPPUNIT_ASSERT( !m.insert( 10, 20 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - - CPPUNIT_ASSERT( !m.contains(30) ); - CPPUNIT_ASSERT( m.insert_with( 30, insert_functor() ) ) ; // value = 90 - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(30) ); - - CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor() ) ); - - // update (new key) - CPPUNIT_ASSERT( !m.contains(27) ); - updateResult = m.update(27, insert_functor(), false); - CPPUNIT_ASSERT(!updateResult.first); - CPPUNIT_ASSERT(!updateResult.second); - CPPUNIT_ASSERT(!m.contains(27)); - updateResult = m.update( 27, insert_functor() ) ; // value = 54 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( m.contains(27) ); - - // find test - check_value chk(10); - CPPUNIT_ASSERT( m.find( 10, std::ref(chk) )); - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find_with( 25, predicate(), std::ref(chk) )); - chk.m_nExpected = 90; - CPPUNIT_ASSERT( m.find( 30, std::ref(chk) )); - chk.m_nExpected = 54; - CPPUNIT_ASSERT( m.find( 27, std::ref(chk) )); - - updateResult = m.update( 10, insert_functor() ) ; // value = 50 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( !updateResult.second ); - chk.m_nExpected = 50; - CPPUNIT_ASSERT( m.find( 10, std::ref(chk) )); - - // erase test - CPPUNIT_ASSERT( !m.contains(100) ); - CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found - - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase( 25 )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( !m.erase( 25 )); - - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( m.insert(258)) - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.contains(258, predicate()) ); - CPPUNIT_ASSERT( m.erase_with( 258, predicate() )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( !m.erase_with( 258, predicate() )); - - int nVal; - extract_functor ext; - ext.m_pVal = &nVal; - - CPPUNIT_ASSERT( !m.contains(29) ); - CPPUNIT_ASSERT( m.insert(29, 290)) - CPPUNIT_ASSERT( m.erase_with( 29, predicate(), std::ref(ext))); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( nVal == 290 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( nVal == 90 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // emplace test - CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 - CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 - CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941 - - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - chk.m_nExpected = 731; - CPPUNIT_ASSERT( m.find_with( 137, predicate(), std::ref(chk) )); - chk.m_nExpected = 941; - CPPUNIT_ASSERT( m.find( 149, std::ref(chk) )); - - CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - } - - template - void test_cuckoo_with(Map& m) - { - cds::OS::Timer timer; - - test_int_with( m ); - - // Iterators is not yet supported - //m.clear(); - //CPPUNIT_ASSERT( m.empty() ); - //CPPUNIT_ASSERT( check_size( m, 0 )); - //test_iter(m); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // Resizing test - for ( int i = 0; i < 40000; i++ ) { - m.insert( i ); - } - - CPPUNIT_MSG( " Duration=" << timer.duration() ); - } - - void Cuckoo_striped_list(); - void Cuckoo_striped_vector(); - void Cuckoo_refinable_list(); - void Cuckoo_refinable_vector(); - - CPPUNIT_TEST_SUITE(CuckooMapHdrTest) - CPPUNIT_TEST(Cuckoo_striped_list) - CPPUNIT_TEST(Cuckoo_striped_vector) - CPPUNIT_TEST(Cuckoo_refinable_list) - CPPUNIT_TEST(Cuckoo_refinable_vector) - CPPUNIT_TEST_SUITE_END() - - }; -} // namespace map - -#endif // #ifndef CDSTEST_HDR_CUCKOO_MAP_H diff --git a/tests/test-hdr/map/hdr_feldman_hashmap.h b/tests/test-hdr/map/hdr_feldman_hashmap.h deleted file mode 100644 index a7bcbd2e..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap.h +++ /dev/null @@ -1,827 +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 CDSTEST_HDR_FELDMAN_HASHMAP_H -#define CDSTEST_HDR_FELDMAN_HASHMAP_H - -#include "cppunit/cppunit_proxy.h" - -// forward declaration -namespace cds { - namespace container {} - namespace opt {} -} - -namespace map { - namespace cc = cds::container; - namespace co = cds::opt; - - class FeldmanHashMapHdrTest : public CppUnitMini::TestCase - { - struct Item - { - unsigned int nInsertCall; - unsigned int nFindCall; - unsigned int nEraseCall; - mutable unsigned int nIteratorCall; - - Item() - : nInsertCall(0) - , nFindCall(0) - , nEraseCall(0) - , nIteratorCall(0) - {} - - explicit Item( unsigned int n ) - : nInsertCall(n) - , nFindCall(0) - , nEraseCall(0) - , nIteratorCall(0) - {} - }; - - struct hash128 - { - size_t lo; - size_t hi; - - hash128() {} - hash128(size_t l, size_t h) : lo(l), hi(h) {} - hash128( hash128 const& h) : lo(h.lo), hi(h.hi) {} - - struct make { - hash128 operator()( size_t n ) const - { - return hash128( std::hash()( n ), std::hash()( ~n )); - } - hash128 operator()( hash128 const& n ) const - { - return hash128( std::hash()( n.lo ), std::hash()( ~n.hi )); - } - }; - - struct less { - bool operator()( hash128 const& lhs, hash128 const& rhs ) const - { - if ( lhs.hi != rhs.hi ) - return lhs.hi < rhs.hi; - return lhs.lo < rhs.lo; - } - }; - - struct cmp { - int operator()( hash128 const& lhs, hash128 const& rhs ) const - { - if ( lhs.hi != rhs.hi ) - return lhs.hi < rhs.hi ? -1 : 1; - return lhs.lo < rhs.lo ? -1 : lhs.lo == rhs.lo ? 0 : 1; - } - }; - - friend bool operator==( hash128 const& lhs, hash128 const& rhs ) - { - return cmp()( lhs, rhs ) == 0; - } - friend bool operator!=(hash128 const& lhs, hash128 const& rhs) - { - return !( lhs == rhs ); - } - }; - - template - void test_hp( size_t nHeadBits, size_t nArrayBits ) - { - typedef typename Map::hash_type hash_type; - typedef typename Map::key_type key_type; - typedef typename Map::mapped_type mapped_type; - typedef typename Map::value_type value_type; - typedef typename Map::guarded_ptr guarded_ptr; - - size_t const capacity = 1000; - - Map m( nHeadBits, nArrayBits ); - CPPUNIT_MSG("Array size: head=" << m.head_size() << ", array_node=" << m.array_node_size()); - //CPPUNIT_ASSERT(m.head_size() >= (size_t(1) << nHeadBits)); - //CPPUNIT_ASSERT(m.array_node_size() == (size_t(1) << nArrayBits)); - - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // insert( key )/update()/get()/find() - for ( size_t i = 0; i < capacity; ++i ) { - size_t key = i * 57; - CPPUNIT_ASSERT(!m.contains( key )) - CPPUNIT_ASSERT(m.insert( key )); - CPPUNIT_ASSERT(m.contains( key )); - CPPUNIT_ASSERT(m.size() == i + 1); - - auto ret = m.update(key, [] ( value_type& v, value_type * old ) { - CPPUNIT_ASSERT_CURRENT( old != nullptr ); - ++v.second.nInsertCall; - }, false ); - CPPUNIT_ASSERT( ret.first ); - CPPUNIT_ASSERT( !ret.second ); - - CPPUNIT_ASSERT(m.find(key, [](value_type& v) { ++v.second.nFindCall;} )); - - guarded_ptr gp{ m.get( key ) }; - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( gp->first == key ); - CPPUNIT_ASSERT( gp->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( gp->second.nFindCall == 1 ); - } - CPPUNIT_ASSERT(!m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // iterator test - size_t nCount = 0; - for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->second.nIteratorCall == 0 ); - CPPUNIT_ASSERT( it->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( (*it).second.nFindCall == 1 ); - it->second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - nCount = 0; - for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( (*it).second.nFindCall == 1 ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 1 ); - (*it).second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - nCount = 0; - for ( auto it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( (*it).second.nFindCall == 1 ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 2 ); - (*it).second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - nCount = 0; - for ( auto it = m.crbegin(), itEnd = m.crend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( (*it).second.nFindCall == 1 ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 3 ); - (*it).second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - // find - for ( size_t i = 0; i < capacity; i++ ) { - size_t key = i * 57; - CPPUNIT_ASSERT( m.find( key, [key]( value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == key ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == 1 ); - CPPUNIT_ASSERT_CURRENT( v.second.nFindCall == 1 ); - CPPUNIT_ASSERT_CURRENT( v.second.nIteratorCall == 4 ); - })); - } - - // erase - for ( size_t i = capacity; i > 0; --i ) { - size_t key = (i -1) * 57; - guarded_ptr gp = m.get( key ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( gp->first == key ); - CPPUNIT_ASSERT( gp->second.nInsertCall == 1 ); - CPPUNIT_ASSERT( gp->second.nFindCall == 1 ); - CPPUNIT_ASSERT( (*gp).second.nIteratorCall == 4 ); - - CPPUNIT_ASSERT(m.erase( key )); - - gp = m.get( key ); - CPPUNIT_ASSERT( !gp ); - CPPUNIT_ASSERT(!m.contains( key )); - } - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // Iterators on empty map - CPPUNIT_ASSERT(m.begin() == m.end()); - CPPUNIT_ASSERT(m.cbegin() == m.cend()); - CPPUNIT_ASSERT(m.rbegin() == m.rend()); - CPPUNIT_ASSERT(m.crbegin() == m.crend()); - - // insert( key, val ) - for ( size_t i = 0; i < capacity; ++i ) { - CPPUNIT_ASSERT(!m.contains(i)); - CPPUNIT_ASSERT(m.insert( i, (unsigned int) i * 100)); - CPPUNIT_ASSERT( m.contains(i)); - CPPUNIT_ASSERT( m.find( i, [i]( value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == i ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i * 100 ); - })); - } - CPPUNIT_ASSERT( !m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // erase( key, func ) - for ( size_t i = 0; i < capacity; ++i ) { - CPPUNIT_ASSERT( m.contains(i)); - CPPUNIT_ASSERT( m.erase( i, [i]( value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == i ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i * 100 ); - v.second.nInsertCall = 0; - })); - } - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0 ); - - // insert_with - for ( size_t i = 0; i < capacity; ++i ) { - size_t key = i * 121; - CPPUNIT_ASSERT(!m.contains(key)); - CPPUNIT_ASSERT( m.insert_with( key, [key]( value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == key ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == 0 ); - v.second.nInsertCall = decltype(v.second.nInsertCall)( key ); - })); - CPPUNIT_ASSERT(m.find(key, [key] (value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == key ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == key ); - })); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT( !m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - nCount = 0; - for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.nInsertCall ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 0 ); - it->second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - nCount = 0; - for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.nInsertCall ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 1 ); - it->second.nIteratorCall += 1; - ++nCount; - } - CPPUNIT_ASSERT( nCount == capacity ); - - // erase_at( iterator ) - nCount = 0; - for ( auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.nInsertCall ); - CPPUNIT_ASSERT( it->second.nIteratorCall == 2 ); - CPPUNIT_ASSERT(m.erase_at( it )); - ++nCount; - CPPUNIT_ASSERT(!m.contains( it->first )); - } - CPPUNIT_ASSERT( nCount == capacity ); - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0 ); - - // emplace - for ( size_t i = 0; i < capacity; ++i ) { - size_t key = i * 1023; - CPPUNIT_ASSERT(!m.contains(key)); - CPPUNIT_ASSERT( m.emplace( key, (unsigned int) i )); - CPPUNIT_ASSERT(m.find(key, [key] (value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == key ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall * 1023 == key ); - })); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT( !m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // erase_at( reverse_iterator ) - nCount = 0; - for ( auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.nInsertCall * 1023 ); - CPPUNIT_ASSERT(m.erase_at( it )); - ++nCount; - CPPUNIT_ASSERT(!m.contains( it->first )); - } - CPPUNIT_ASSERT( nCount == capacity ); - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0 ); - - - // extract - for ( size_t i = 0; i < capacity; ++i ) { - size_t key = i * 711; - CPPUNIT_ASSERT(!m.contains(key)); - auto ret = m.update( key, [i]( value_type& v, value_type * old ) { - CPPUNIT_ASSERT_CURRENT( old == nullptr ); - v.second.nInsertCall = (unsigned int) i; - }); - CPPUNIT_ASSERT( ret.first ); - CPPUNIT_ASSERT( ret.second ); - CPPUNIT_ASSERT(m.find(key, [i, key] (value_type& v ) { - CPPUNIT_ASSERT_CURRENT( v.first == key ); - CPPUNIT_ASSERT_CURRENT( v.second.nInsertCall == i ); - })); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT( !m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - for ( size_t i = capacity; i > 0; --i ) { - size_t key = (i-1) * 711; - guarded_ptr gp{ m.extract(key) }; - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( gp->first == key ); - CPPUNIT_ASSERT((*gp).second.nInsertCall == i - 1 ); - gp = m.extract(key); - CPPUNIT_ASSERT( !gp ); - } - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0 ); - - // clear - for ( size_t i = 0; i < capacity; ++i ) { - CPPUNIT_ASSERT(!m.contains( i )) - CPPUNIT_ASSERT(m.insert( i )); - CPPUNIT_ASSERT(m.contains( i )); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT( !m.empty()); - CPPUNIT_ASSERT(m.size() == capacity ); - - m.clear(); - CPPUNIT_ASSERT( m.empty()); - CPPUNIT_ASSERT(m.size() == 0 ); - - - CPPUNIT_MSG( m.statistics() ); - } - - template - void test_rcu(size_t nHeadBits, size_t nArrayBits) - { - typedef typename Map::hash_type hash_type; - typedef typename Map::key_type key_type; - typedef typename Map::mapped_type mapped_type; - typedef typename Map::value_type value_type; - typedef typename Map::exempt_ptr exempt_ptr; - typedef typename Map::rcu_lock rcu_lock; - - size_t const capacity = 1000; - - Map m(nHeadBits, nArrayBits); - CPPUNIT_MSG("Array size: head=" << m.head_size() << ", array_node=" << m.array_node_size()); - CPPUNIT_ASSERT(m.head_size() >= (size_t(1) << nHeadBits)); - CPPUNIT_ASSERT(m.array_node_size() == (size_t(1) << nArrayBits)); - - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // insert( key )/update()/get()/find() - for (size_t i = 0; i < capacity; ++i) { - size_t key = i * 57; - CPPUNIT_ASSERT(!m.contains(key)) - CPPUNIT_ASSERT(m.insert(key)); - CPPUNIT_ASSERT(m.contains(key)); - CPPUNIT_ASSERT(m.size() == i + 1); - - auto ret = m.update(key, [](value_type& v, value_type * old) { - CPPUNIT_ASSERT_CURRENT(old != nullptr); - ++v.second.nInsertCall; - }, false); - CPPUNIT_ASSERT(ret.first); - CPPUNIT_ASSERT(!ret.second); - - CPPUNIT_ASSERT(m.find(key, [](value_type& v) { ++v.second.nFindCall;})); - - { - rcu_lock l; - value_type* p{ m.get(key) }; - CPPUNIT_ASSERT(p); - CPPUNIT_ASSERT(p->first == key); - CPPUNIT_ASSERT(p->second.nInsertCall == 1); - CPPUNIT_ASSERT(p->second.nFindCall == 1); - } - } - CPPUNIT_ASSERT(!m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // iterator test - size_t nCount = 0; - { - rcu_lock l; - for (auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->second.nIteratorCall == 0); - CPPUNIT_ASSERT(it->second.nInsertCall == 1); - CPPUNIT_ASSERT((*it).second.nFindCall == 1); - it->second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - nCount = 0; - { - rcu_lock l; - for (auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->second.nInsertCall == 1); - CPPUNIT_ASSERT((*it).second.nFindCall == 1); - CPPUNIT_ASSERT(it->second.nIteratorCall == 1); - (*it).second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - nCount = 0; - { - rcu_lock l; - for (auto it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->second.nInsertCall == 1); - CPPUNIT_ASSERT((*it).second.nFindCall == 1); - CPPUNIT_ASSERT(it->second.nIteratorCall == 2); - (*it).second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - nCount = 0; - { - rcu_lock l; - for (auto it = m.crbegin(), itEnd = m.crend(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->second.nInsertCall == 1); - CPPUNIT_ASSERT((*it).second.nFindCall == 1); - CPPUNIT_ASSERT(it->second.nIteratorCall == 3); - (*it).second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - // find - for (size_t i = 0; i < capacity; i++) { - size_t key = i * 57; - CPPUNIT_ASSERT(m.find(key, [key](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == key); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == 1); - CPPUNIT_ASSERT_CURRENT(v.second.nFindCall == 1); - CPPUNIT_ASSERT_CURRENT(v.second.nIteratorCall == 4); - })); - } - - // erase - for (size_t i = capacity; i > 0; --i) { - size_t key = (i - 1) * 57; - { - rcu_lock l; - value_type* p = m.get(key); - CPPUNIT_ASSERT(p); - CPPUNIT_ASSERT(p->first == key); - CPPUNIT_ASSERT(p->second.nInsertCall == 1); - CPPUNIT_ASSERT(p->second.nFindCall == 1); - CPPUNIT_ASSERT(p->second.nIteratorCall == 4); - } - - CPPUNIT_ASSERT(m.erase(key)); - - { - rcu_lock l; - value_type* p = m.get(key); - CPPUNIT_ASSERT(!p); - } - CPPUNIT_ASSERT(!m.contains(key)); - } - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // Iterators on empty map - { - rcu_lock l; - CPPUNIT_ASSERT(m.begin() == m.end()); - CPPUNIT_ASSERT(m.cbegin() == m.cend()); - CPPUNIT_ASSERT(m.rbegin() == m.rend()); - CPPUNIT_ASSERT(m.crbegin() == m.crend()); - } - - // insert( key, val ) - for (size_t i = 0; i < capacity; ++i) { - CPPUNIT_ASSERT(!m.contains(i)); - CPPUNIT_ASSERT(m.insert(i, (unsigned int)i * 100)); - CPPUNIT_ASSERT(m.contains(i)); - CPPUNIT_ASSERT(m.find(i, [i](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == i); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == i * 100); - })); - } - CPPUNIT_ASSERT(!m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // erase( key, func ) - for (size_t i = 0; i < capacity; ++i) { - CPPUNIT_ASSERT(m.contains(i)); - CPPUNIT_ASSERT(m.erase(i, [i](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == i); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == i * 100); - v.second.nInsertCall = 0; - })); - } - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // insert_with - for (size_t i = 0; i < capacity; ++i) { - size_t key = i * 121; - CPPUNIT_ASSERT(!m.contains(key)); - CPPUNIT_ASSERT(m.insert_with(key, [key](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == key); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == 0); - v.second.nInsertCall = decltype(v.second.nInsertCall)(key); - })); - CPPUNIT_ASSERT(m.find(key, [key](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == key); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall == key); - })); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT(!m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - nCount = 0; - { - rcu_lock l; - for (auto it = m.begin(), itEnd = m.end(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->first == it->second.nInsertCall); - CPPUNIT_ASSERT(it->second.nIteratorCall == 0); - it->second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - nCount = 0; - { - rcu_lock l; - for (auto it = m.rbegin(), itEnd = m.rend(); it != itEnd; ++it) { - CPPUNIT_ASSERT(it->first == it->second.nInsertCall); - CPPUNIT_ASSERT(it->second.nIteratorCall == 1); - it->second.nIteratorCall += 1; - ++nCount; - } - } - CPPUNIT_ASSERT(nCount == capacity); - - // clear() - m.clear(); - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - // emplace - for (size_t i = 0; i < capacity; ++i) { - size_t key = i * 1023; - CPPUNIT_ASSERT(!m.contains(key)); - CPPUNIT_ASSERT(m.emplace(key, static_cast(i))); - CPPUNIT_ASSERT(m.find(key, [key](value_type& v) { - CPPUNIT_ASSERT_CURRENT(v.first == key); - CPPUNIT_ASSERT_CURRENT(v.second.nInsertCall * 1023 == key); - })); - CPPUNIT_ASSERT(m.size() == i + 1); - } - CPPUNIT_ASSERT(!m.empty()); - CPPUNIT_ASSERT(m.size() == capacity); - - // extract - for (size_t i = capacity; i > 0; --i) { - size_t key = (i - 1) * 1023; - exempt_ptr xp{ m.extract(key) }; - CPPUNIT_ASSERT(xp); - CPPUNIT_ASSERT(xp->first == key); - CPPUNIT_ASSERT((*xp).second.nInsertCall == static_cast(i - 1)); - xp = m.extract(key); - CPPUNIT_ASSERT(!xp); - } - CPPUNIT_ASSERT(m.empty()); - CPPUNIT_ASSERT(m.size() == 0); - - CPPUNIT_MSG(m.statistics()); - } - - void hp_nohash(); - void hp_nohash_stat(); - void hp_nohash_5_3(); - void hp_nohash_5_3_stat(); - void hp_stdhash(); - void hp_stdhash_stat(); - void hp_stdhash_5_3(); - void hp_stdhash_5_3_stat(); - void hp_hash128(); - void hp_hash128_stat(); - void hp_hash128_4_3(); - void hp_hash128_4_3_stat(); - - void dhp_nohash(); - void dhp_nohash_stat(); - void dhp_nohash_5_3(); - void dhp_nohash_5_3_stat(); - void dhp_stdhash(); - void dhp_stdhash_stat(); - void dhp_stdhash_5_3(); - void dhp_stdhash_5_3_stat(); - void dhp_hash128(); - void dhp_hash128_stat(); - void dhp_hash128_4_3(); - void dhp_hash128_4_3_stat(); - - void rcu_gpb_nohash(); - void rcu_gpb_nohash_stat(); - void rcu_gpb_nohash_5_3(); - void rcu_gpb_nohash_5_3_stat(); - void rcu_gpb_stdhash(); - void rcu_gpb_stdhash_stat(); - void rcu_gpb_stdhash_5_3(); - void rcu_gpb_stdhash_5_3_stat(); - void rcu_gpb_hash128(); - void rcu_gpb_hash128_stat(); - void rcu_gpb_hash128_4_3(); - void rcu_gpb_hash128_4_3_stat(); - - void rcu_gpi_nohash(); - void rcu_gpi_nohash_stat(); - void rcu_gpi_nohash_5_3(); - void rcu_gpi_nohash_5_3_stat(); - void rcu_gpi_stdhash(); - void rcu_gpi_stdhash_stat(); - void rcu_gpi_stdhash_5_3(); - void rcu_gpi_stdhash_5_3_stat(); - void rcu_gpi_hash128(); - void rcu_gpi_hash128_stat(); - void rcu_gpi_hash128_4_3(); - void rcu_gpi_hash128_4_3_stat(); - - void rcu_gpt_nohash(); - void rcu_gpt_nohash_stat(); - void rcu_gpt_nohash_5_3(); - void rcu_gpt_nohash_5_3_stat(); - void rcu_gpt_stdhash(); - void rcu_gpt_stdhash_stat(); - void rcu_gpt_stdhash_5_3(); - void rcu_gpt_stdhash_5_3_stat(); - void rcu_gpt_hash128(); - void rcu_gpt_hash128_stat(); - void rcu_gpt_hash128_4_3(); - void rcu_gpt_hash128_4_3_stat(); - - void rcu_shb_nohash(); - void rcu_shb_nohash_stat(); - void rcu_shb_nohash_5_3(); - void rcu_shb_nohash_5_3_stat(); - void rcu_shb_stdhash(); - void rcu_shb_stdhash_stat(); - void rcu_shb_stdhash_5_3(); - void rcu_shb_stdhash_5_3_stat(); - void rcu_shb_hash128(); - void rcu_shb_hash128_stat(); - void rcu_shb_hash128_4_3(); - void rcu_shb_hash128_4_3_stat(); - - void rcu_sht_nohash(); - void rcu_sht_nohash_stat(); - void rcu_sht_nohash_5_3(); - void rcu_sht_nohash_5_3_stat(); - void rcu_sht_stdhash(); - void rcu_sht_stdhash_stat(); - void rcu_sht_stdhash_5_3(); - void rcu_sht_stdhash_5_3_stat(); - void rcu_sht_hash128(); - void rcu_sht_hash128_stat(); - void rcu_sht_hash128_4_3(); - void rcu_sht_hash128_4_3_stat(); - - CPPUNIT_TEST_SUITE(FeldmanHashMapHdrTest) - CPPUNIT_TEST(hp_nohash) - CPPUNIT_TEST(hp_nohash_stat) - CPPUNIT_TEST(hp_nohash_5_3) - CPPUNIT_TEST(hp_nohash_5_3_stat) - CPPUNIT_TEST(hp_stdhash) - CPPUNIT_TEST(hp_stdhash_stat) - CPPUNIT_TEST(hp_stdhash_5_3) - CPPUNIT_TEST(hp_stdhash_5_3_stat) - CPPUNIT_TEST(hp_hash128) - CPPUNIT_TEST(hp_hash128_stat) - CPPUNIT_TEST(hp_hash128_4_3) - CPPUNIT_TEST(hp_hash128_4_3_stat) - - CPPUNIT_TEST(dhp_nohash) - CPPUNIT_TEST(dhp_nohash_stat) - CPPUNIT_TEST(dhp_nohash_5_3) - CPPUNIT_TEST(dhp_nohash_5_3_stat) - CPPUNIT_TEST(dhp_stdhash) - CPPUNIT_TEST(dhp_stdhash_stat) - CPPUNIT_TEST(dhp_stdhash_5_3) - CPPUNIT_TEST(dhp_stdhash_5_3_stat) - CPPUNIT_TEST(dhp_hash128) - CPPUNIT_TEST(dhp_hash128_stat) - CPPUNIT_TEST(dhp_hash128_4_3) - CPPUNIT_TEST(dhp_hash128_4_3_stat) - - CPPUNIT_TEST(rcu_gpb_nohash) - CPPUNIT_TEST(rcu_gpb_nohash_stat) - CPPUNIT_TEST(rcu_gpb_nohash_5_3) - CPPUNIT_TEST(rcu_gpb_nohash_5_3_stat) - CPPUNIT_TEST(rcu_gpb_stdhash) - CPPUNIT_TEST(rcu_gpb_stdhash_stat) - CPPUNIT_TEST(rcu_gpb_stdhash_5_3) - CPPUNIT_TEST(rcu_gpb_stdhash_5_3_stat) - CPPUNIT_TEST(rcu_gpb_hash128) - CPPUNIT_TEST(rcu_gpb_hash128_stat) - CPPUNIT_TEST(rcu_gpb_hash128_4_3) - CPPUNIT_TEST(rcu_gpb_hash128_4_3_stat) - - CPPUNIT_TEST(rcu_gpi_nohash) - CPPUNIT_TEST(rcu_gpi_nohash_stat) - CPPUNIT_TEST(rcu_gpi_nohash_5_3) - CPPUNIT_TEST(rcu_gpi_nohash_5_3_stat) - CPPUNIT_TEST(rcu_gpi_stdhash) - CPPUNIT_TEST(rcu_gpi_stdhash_stat) - CPPUNIT_TEST(rcu_gpi_stdhash_5_3) - CPPUNIT_TEST(rcu_gpi_stdhash_5_3_stat) - CPPUNIT_TEST(rcu_gpi_hash128) - CPPUNIT_TEST(rcu_gpi_hash128_stat) - CPPUNIT_TEST(rcu_gpi_hash128_4_3) - CPPUNIT_TEST(rcu_gpi_hash128_4_3_stat) - - CPPUNIT_TEST(rcu_gpt_nohash) - CPPUNIT_TEST(rcu_gpt_nohash_stat) - CPPUNIT_TEST(rcu_gpt_nohash_5_3) - CPPUNIT_TEST(rcu_gpt_nohash_5_3_stat) - CPPUNIT_TEST(rcu_gpt_stdhash) - CPPUNIT_TEST(rcu_gpt_stdhash_stat) - CPPUNIT_TEST(rcu_gpt_stdhash_5_3) - CPPUNIT_TEST(rcu_gpt_stdhash_5_3_stat) - CPPUNIT_TEST(rcu_gpt_hash128) - CPPUNIT_TEST(rcu_gpt_hash128_stat) - CPPUNIT_TEST(rcu_gpt_hash128_4_3) - CPPUNIT_TEST(rcu_gpt_hash128_4_3_stat) - - CPPUNIT_TEST(rcu_shb_nohash) - CPPUNIT_TEST(rcu_shb_nohash_stat) - CPPUNIT_TEST(rcu_shb_nohash_5_3) - CPPUNIT_TEST(rcu_shb_nohash_5_3_stat) - CPPUNIT_TEST(rcu_shb_stdhash) - CPPUNIT_TEST(rcu_shb_stdhash_stat) - CPPUNIT_TEST(rcu_shb_stdhash_5_3) - CPPUNIT_TEST(rcu_shb_stdhash_5_3_stat) - CPPUNIT_TEST(rcu_shb_hash128) - CPPUNIT_TEST(rcu_shb_hash128_stat) - CPPUNIT_TEST(rcu_shb_hash128_4_3) - CPPUNIT_TEST(rcu_shb_hash128_4_3_stat) - - CPPUNIT_TEST(rcu_sht_nohash) - CPPUNIT_TEST(rcu_sht_nohash_stat) - CPPUNIT_TEST(rcu_sht_nohash_5_3) - CPPUNIT_TEST(rcu_sht_nohash_5_3_stat) - CPPUNIT_TEST(rcu_sht_stdhash) - CPPUNIT_TEST(rcu_sht_stdhash_stat) - CPPUNIT_TEST(rcu_sht_stdhash_5_3) - CPPUNIT_TEST(rcu_sht_stdhash_5_3_stat) - CPPUNIT_TEST(rcu_sht_hash128) - CPPUNIT_TEST(rcu_sht_hash128_stat) - CPPUNIT_TEST(rcu_sht_hash128_4_3) - CPPUNIT_TEST(rcu_sht_hash128_4_3_stat) - CPPUNIT_TEST_SUITE_END() - - }; - -} // namespace map - -#endif //#ifndef CDSTEST_HDR_FELDMAN_HASHMAP_H diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp deleted file mode 100644 index 10fe6bde..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_dhp.cpp +++ /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. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { - namespace { - typedef cds::gc::DHP gc_type; - } // namespace - - void FeldmanHashMapHdrTest::dhp_nohash() - { - typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type; - - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_stdhash() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_hash128() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_nohash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_stdhash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash< std::hash> - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_hash128_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::dhp_nohash_5_3() - { - typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type; - - test_hp(5, 3); - } - - - void FeldmanHashMapHdrTest::dhp_stdhash_5_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::dhp_nohash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(5, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::dhp_stdhash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(5, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::dhp_hash128_4_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_hp(4, 3); - } - - void FeldmanHashMapHdrTest::dhp_hash128_4_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_hp(4, 3); - } -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::FeldmanHashMapHdrTest); diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp deleted file mode 100644 index 0e6da12e..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_hp.cpp +++ /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. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { - namespace { - typedef cds::gc::HP gc_type; - } // namespace - - void FeldmanHashMapHdrTest::hp_nohash() - { - typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type; - - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_stdhash() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_hash128() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_nohash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_stdhash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash< std::hash> - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_hash128_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 2); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_hp(4, 2); - } - - void FeldmanHashMapHdrTest::hp_nohash_5_3() - { - typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type; - - test_hp(5, 3); - } - - - void FeldmanHashMapHdrTest::hp_stdhash_5_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::hp_nohash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(5, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::hp_stdhash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(5, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_hp(5, 3); - } - - void FeldmanHashMapHdrTest::hp_hash128_4_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_hp(4, 3); - } - - void FeldmanHashMapHdrTest::hp_hash128_4_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type; - test_hp(4, 3); - - typedef cc::FeldmanHashMap< gc_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_hp(4, 3); - } -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::FeldmanHashMapHdrTest); diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp deleted file mode 100644 index aca6ab90..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpb.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_buffered<>> rcu_type; - } // namespace - - void FeldmanHashMapHdrTest::rcu_gpb_nohash() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_stdhash() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_hash128() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_nohash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_stdhash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_hash128_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_rcu(4, 3); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp deleted file mode 100644 index db7ee4e1..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpi.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_instant<>> rcu_type; - } // namespace - - void FeldmanHashMapHdrTest::rcu_gpi_nohash() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_stdhash() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_hash128() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_nohash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_stdhash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_hash128_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpi_nohash_5_3() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpi_stdhash_5_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpi_nohash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpi_stdhash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpi_hash128_4_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpi_hash128_4_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_rcu(4, 3); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp deleted file mode 100644 index 9e5303f0..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_gpt.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_threaded<>> rcu_type; - } // namespace - - void FeldmanHashMapHdrTest::rcu_gpt_nohash() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_stdhash() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_hash128() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_nohash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_stdhash_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash> - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_hash128_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_rcu(4, 2); - } - - void FeldmanHashMapHdrTest::rcu_gpt_nohash_5_3() - { - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpt_stdhash_5_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpt_nohash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpt_stdhash_5_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_rcu(5, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpt_hash128_4_3() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 3); - } - - void FeldmanHashMapHdrTest::rcu_gpt_hash128_4_3_stat() - { - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_rcu(4, 3); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp deleted file mode 100644 index 980f0ffe..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_shb.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_buffered<>> rcu_type; - } // namespace -#endif - - void FeldmanHashMapHdrTest::rcu_shb_nohash() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_stdhash() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_hash128() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_nohash_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_stdhash_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash> - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_hash128_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_nohash_5_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_stdhash_5_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_nohash_5_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_stdhash_5_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_hash128_4_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_shb_hash128_4_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_rcu(4, 3); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp b/tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp deleted file mode 100644 index d24a2126..00000000 --- a/tests/test-hdr/map/hdr_feldman_hashmap_rcu_sht.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_feldman_hashmap.h" -#include -#include -#include "unit/print_feldman_hashset_stat.h" - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_threaded<>> rcu_type; - } // namespace -#endif - - void FeldmanHashMapHdrTest::rcu_sht_nohash() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_stdhash() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_hash128() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_nohash_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_stdhash_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::hash> - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_hash128_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef hash128::make hash; - typedef hash128::cmp compare; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 2); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::hash< hash128::make > - , co::compare< hash128::cmp > - >::type - > map_type2; - test_rcu(4, 2); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type; - - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - , co::back_off< cds::backoff::empty > - >::type - > map_type2; - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef cc::feldman_hashmap::stat<> stat; - typedef cds::backoff::empty back_off; - typedef std::hash hash; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(5, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::stat< cc::feldman_hashmap::stat<>> - ,co::back_off< cds::backoff::empty > - ,co::hash< std::hash> - >::type - > map_type2; - test_rcu(5, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - >::type - > map_type2; - test_rcu(4, 3); -#endif - } - - void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits : public cc::feldman_hashmap::traits { - typedef hash128::make hash; - typedef hash128::less less; - typedef cc::feldman_hashmap::stat<> stat; - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type; - test_rcu(4, 3); - - typedef cc::FeldmanHashMap< rcu_type, size_t, Item, - typename cc::feldman_hashmap::make_traits< - co::hash< hash128::make > - , co::less< hash128::less > - , co::stat< cc::feldman_hashmap::stat<>> - , co::memory_model< co::v::sequential_consistent > - >::type - > map_type2; - test_rcu(4, 3); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_map.h b/tests/test-hdr/map/hdr_map.h deleted file mode 100644 index 05f849f3..00000000 --- a/tests/test-hdr/map/hdr_map.h +++ /dev/null @@ -1,1273 +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 CDSTEST_HDR_MAP_H -#define CDSTEST_HDR_MAP_H -#include "size_check.h" - -#include "cppunit/cppunit_proxy.h" -#include -#include -#include // ref - -namespace cds { namespace container {}} - -namespace map { - using misc::check_size; - - namespace cc = cds::container; - namespace co = cds::opt; - - // MichaelHashSet based on MichaelList - class HashMapHdrTest: public CppUnitMini::TestCase - { - public: - typedef int key_type; - - struct value_type { - int m_val; - - value_type() - : m_val(0) - {} - - value_type( int n ) - : m_val( n ) - {} - - value_type( value_type&& v ) - : m_val( v.m_val ) - {} - - value_type( value_type const& v ) - : m_val( v.m_val ) - {} - - value_type& operator=( value_type const& v ) - { - m_val = v.m_val; - return *this; - } - }; - - typedef std::pair pair_type; - - struct less - { - bool operator ()(int v1, int v2 ) const - { - return v1 < v2; - } - }; - - struct cmp { - int operator ()(int v1, int v2 ) const - { - if ( v1 < v2 ) - return -1; - return v1 > v2 ? 1 : 0; - } - }; - - struct equal { - bool operator ()(int v1, int v2 ) const - { - return v1 == v2; - } - }; - - struct hash_int { - size_t operator()( int i ) const - { - return co::v::hash()( i ); - } - - template - size_t operator()( T const& i ) const - { - return co::v::hash()( i.nKey ); - } - }; - - struct simple_item_counter { - size_t m_nCount; - - simple_item_counter() - : m_nCount(0) - {} - - size_t operator ++() - { - return ++m_nCount; - } - - size_t operator --() - { - return --m_nCount; - } - - void reset() - { - m_nCount = 0; - } - - operator size_t() const - { - return m_nCount; - } - }; - - template - struct insert_functor - { - typedef typename Map::value_type pair_type; - - // insert ftor - void operator()( pair_type& item ) - { - item.second.m_val = item.first * 3; - } - - // update ftor - void operator()( bool bNew, pair_type& item ) - { - if ( bNew ) - item.second.m_val = item.first * 2; - else - item.second.m_val = item.first * 5; - } - }; - - struct check_value { - int m_nExpected; - - check_value( int nExpected ) - : m_nExpected( nExpected ) - {} - - template - void operator ()( T& pair ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - template - void operator ()( T& pair, Q ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - }; - - struct extract_functor - { - int * m_pVal; - void operator()( pair_type const& val ) - { - *m_pVal = val.second.m_val; - } - }; - - struct other_item { - int nKey; - - other_item( int key ) - : nKey(key) - {} - }; - - struct other_less - { - bool operator ()(int v1, other_item const& v2 ) const - { - return v1 < v2.nKey; - } - bool operator ()(other_item const& v1, int v2 ) const - { - return v1.nKey < v2; - } - }; - - - template - void test_int() - { - Map m( 100, 4 ); - - test_int_with(m); - - // extract/get test - CPPUNIT_ASSERT( m.empty() ); - { - const int nLimit = 100; - typename Map::guarded_ptr gp; - int arrRandom[nLimit]; - for ( int i = 0; i < nLimit; ++i ) - arrRandom[i] = i; - shuffle( arrRandom, arrRandom + nLimit ); - - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] )); - - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrRandom[i]; - gp = m.get( nKey ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - gp.release(); - - gp = m.extract( nKey ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - gp.release(); - - gp = m.get( nKey ); - CPPUNIT_CHECK( !gp ); - - CPPUNIT_CHECK( !m.extract(nKey)); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_ASSERT( m.empty() ); - - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] )); - - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrRandom[i]; - gp = m.get_with( other_item( nKey ), other_less() ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - gp.release(); - - gp = m.extract_with( other_item( nKey ), other_less() ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - gp.release(); - - gp = m.get_with( other_item( nKey ), other_less() ); - CPPUNIT_CHECK( !gp ); - - CPPUNIT_CHECK( !m.extract_with(other_item(nKey), other_less() )); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_ASSERT( m.empty() ); - } - - // iterator test - test_iter(); - } - - template - void test_rcu() - { - Map m( 52, 4 ); - - test_int_with(m); - - // extract/get test - { - typedef typename Map::gc rcu; - typedef typename Map::rcu_lock rcu_lock; - typedef typename Map::value_type value_type; - typename Map::exempt_ptr ep; - - static size_t const nLimit = 100; - int arr[nLimit]; - for ( size_t i = 0; i < nLimit; ++i ) - arr[i] = (int) i; - shuffle( arr, arr + nLimit ); - - for ( size_t i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert( arr[i], arr[i] )); - - for ( size_t i = 0; i < nLimit; i += 2 ) { - value_type * pVal; - int nKey = arr[i]; - { - rcu_lock l; - pVal = m.get( nKey ); - CPPUNIT_ASSERT( pVal != nullptr ); - CPPUNIT_CHECK( pVal->first == nKey ); - CPPUNIT_CHECK( pVal->second.m_val == nKey ); - - ep = m.extract( nKey ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( pVal->first == ep->first ); - CPPUNIT_CHECK( pVal->second.m_val == ep->second.m_val ); - } - ep.release(); - { - rcu_lock l; - CPPUNIT_CHECK( m.get( nKey ) == nullptr ); - ep = m.extract( nKey ); - CPPUNIT_CHECK( !ep ); - CPPUNIT_CHECK( ep.empty() ); - - nKey = arr[i+1]; - pVal = m.get_with( other_item(nKey), other_less() ); - CPPUNIT_ASSERT( pVal != nullptr ); - CPPUNIT_CHECK( pVal->first == nKey ); - CPPUNIT_CHECK( pVal->second.m_val == nKey ); - - ep = m.extract_with( other_item( nKey ), other_less() ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( pVal->first == ep->first ); - CPPUNIT_CHECK( pVal->second.m_val == (*ep).second.m_val ); - } - ep.release(); - { - rcu_lock l; - CPPUNIT_CHECK( m.get_with( other_item(nKey), other_less() ) == nullptr ); - CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() )); - CPPUNIT_CHECK( ep.empty() ); - } - } - CPPUNIT_CHECK( m.empty() ); - CPPUNIT_CHECK( check_size( m, 0 )); - { - rcu_lock l; - CPPUNIT_CHECK( m.get( int(nLimit / 2) ) == nullptr ); - ep = m.extract( int( nLimit / 2 ) ); - CPPUNIT_CHECK( !ep ); - CPPUNIT_CHECK( ep.empty() ); - } - } - - // iterator test - test_iter(); - } - - template - void test_rcu_michael_list() - { - Map m( 52, 4 ); - - test_int_with(m); - - // extract/get test - { - typedef typename Map::gc rcu; - typedef typename Map::rcu_lock rcu_lock; - typedef typename Map::value_type value_type; - typename Map::exempt_ptr ep; - typename Map::raw_ptr gp; - - static size_t const nLimit = 100; - int arr[nLimit]; - for ( size_t i = 0; i < nLimit; ++i ) - arr[i] = (int) i; - shuffle( arr, arr + nLimit ); - - for ( size_t i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert( arr[i], arr[i] )); - - for ( size_t i = 0; i < nLimit; i += 2 ) { - int nKey = arr[i]; - { - rcu_lock l; - gp = m.get( nKey ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - } - gp.release(); - - ep = m.extract( nKey ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( nKey == ep->first ); - CPPUNIT_CHECK( nKey == ep->second.m_val ); - ep.release(); - - { - rcu_lock l; - CPPUNIT_CHECK( !m.get( nKey )); - } - ep = m.extract( nKey ); - CPPUNIT_CHECK( !ep ); - CPPUNIT_CHECK( ep.empty() ); - - { - rcu_lock l; - nKey = arr[i+1]; - gp = m.get_with( other_item(nKey), other_less() ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey ); - } - gp.release(); - - ep = m.extract_with( other_item( nKey ), other_less() ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( nKey == ep->first ); - CPPUNIT_CHECK( nKey == (*ep).second.m_val ); - ep.release(); - - { - rcu_lock l; - CPPUNIT_CHECK( !m.get_with( other_item(nKey), other_less() )); - } - CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() )); - CPPUNIT_CHECK( ep.empty() ); - } - CPPUNIT_CHECK( m.empty() ); - CPPUNIT_CHECK( check_size( m, 0 )); - { - rcu_lock l; - CPPUNIT_CHECK( !m.get( int(nLimit / 2) )); - } - ep = m.extract( int( nLimit / 2 ) ); - CPPUNIT_CHECK( !ep ); - CPPUNIT_CHECK( ep.empty() ); - } - - // iterator test - test_iter(); - } - - template - void test_rcu_split_list() - { - test_rcu_michael_list(); - } - - template - void test_int_with( Map& m ) - { - std::pair updateResult; - - // insert - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0 - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(25) ); - - CPPUNIT_ASSERT( !m.insert( 25 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - - CPPUNIT_ASSERT( !m.contains(10, less()) ); - CPPUNIT_ASSERT( m.insert( 10, 10 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(10, less()) ); - - CPPUNIT_ASSERT( !m.insert( 10, 20 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - - CPPUNIT_ASSERT( !m.contains(30) ); - CPPUNIT_ASSERT( m.insert_with( 30, insert_functor() ) ) ; // value = 90 - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(30) ); - - CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor() ) ); - - // update (new key) - CPPUNIT_ASSERT( !m.contains(27) ); - updateResult = m.update(27, insert_functor(), false); - CPPUNIT_ASSERT(!updateResult.first); - CPPUNIT_ASSERT(!updateResult.second); - CPPUNIT_ASSERT(!m.contains(27)); - - updateResult = m.update( 27, insert_functor() ) ; // value = 54 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( m.contains(27) ); - - // find test - check_value chk(10); - CPPUNIT_ASSERT( m.find( 10, std::ref(chk) )); - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) ); - chk.m_nExpected = 90; - CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) ); - chk.m_nExpected = 54; - CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) ); - - updateResult = m.update( 10, insert_functor() ) ; // value = 50 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( !updateResult.second ); - chk.m_nExpected = 50; - CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) ); - - // erase test - CPPUNIT_ASSERT( !m.contains(100) ); - CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found - - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase( 25 )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( !m.erase( 25 )); - - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( m.insert(258)) - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.contains(258, less()) ); - CPPUNIT_ASSERT( m.erase_with( 258, less() )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( !m.erase_with( 258, less() )); - - int nVal; - extract_functor ext; - ext.m_pVal = &nVal; - - CPPUNIT_ASSERT( !m.contains(29) ); - CPPUNIT_ASSERT( m.insert(29, 290)); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( nVal == 290 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( nVal == 90 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // emplace test - CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 - CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 - CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941 - - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - chk.m_nExpected = 731; - CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) )); - chk.m_nExpected = 941; - CPPUNIT_ASSERT( m.find( 149, std::ref(chk) )); - - CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - } - - - template - void test_int_nogc() - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - { - Map m( 52, 4 ); - - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - CPPUNIT_ASSERT( m.contains(10) == m.end() ); - iterator it = m.insert( 10 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(10) == it ); - CPPUNIT_ASSERT( it->first == 10 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - CPPUNIT_ASSERT( m.contains(100) == m.end() ); - it = m.insert( 100, 200 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(100, less()) == it ); - CPPUNIT_ASSERT( it->first == 100 ); - CPPUNIT_ASSERT( it->second.m_val == 200 ); - - CPPUNIT_ASSERT( m.contains(55) == m.end() ); - it = m.insert_with( 55, insert_functor() ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(55) == it ); - CPPUNIT_ASSERT( it->first == 55 ); - CPPUNIT_ASSERT( it->second.m_val == 55 * 3 ); - - CPPUNIT_ASSERT( m.insert( 55 ) == m.end() ); - CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() ); - CPPUNIT_ASSERT( m.insert_with( 55, insert_functor()) == m.end() ); - - CPPUNIT_ASSERT( m.contains(10) != m.end() ); - std::pair updateResult = m.update(10, false); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( !updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(10) == updateResult.first ); - it = m.contains(10); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 50 ); - - CPPUNIT_ASSERT( m.contains(120) == m.end() ); - updateResult = m.update(120, false); - CPPUNIT_ASSERT(updateResult.first == m.end()); - CPPUNIT_ASSERT(!updateResult.second); - updateResult = m.update( 120 ); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 4 )); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( m.contains(120, less()) == updateResult.first ); - it = m.contains(120, less()); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 120 * 5 ); - CPPUNIT_ASSERT( m.contains(120, less()) == m.contains(120) ); - - // emplace test - it = m.emplace( 151 ) ; // key = 151, val = 0 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - it = m.emplace( 174, 471 ) ; // key == 174, val = 471 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.emplace( 151, 1051 ); - CPPUNIT_ASSERT( it == m.end()); - - it = m.contains( 174 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.contains( 190 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.contains( 151 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - } - - // iterator test - - { - Map m( 52, 4 ); - - for ( int i = 0; i < 500; ++i ) { - CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() ); - } - CPPUNIT_ASSERT( check_size( m, 500 )); - - { - typename Map::iterator it( m.begin() ); - typename Map::const_iterator cit( m.cbegin() ); - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - ++it; - CPPUNIT_CHECK( it != cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - ++cit; - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - } - - - for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - iterator it2 = it; - CPPUNIT_CHECK( it2 == it ); - CPPUNIT_CHECK( it2 != itEnd ); - CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val ); - it->second = it->first; - } - - Map const& refMap = m; - for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - } - } - } - - template - void test_int_nogc_unordered() - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - { - Map m( 52, 4 ); - - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - CPPUNIT_ASSERT( m.contains(10) == m.end() ); - iterator it = m.insert( 10 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(10) == it ); - CPPUNIT_ASSERT( it->first == 10 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - CPPUNIT_ASSERT( m.contains(100) == m.end() ); - it = m.insert( 100, 200 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(100, equal()) == it ); - CPPUNIT_ASSERT( it->first == 100 ); - CPPUNIT_ASSERT( it->second.m_val == 200 ); - - CPPUNIT_ASSERT( m.contains(55) == m.end() ); - it = m.insert_with( 55, insert_functor() ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(55) == it ); - CPPUNIT_ASSERT( it->first == 55 ); - CPPUNIT_ASSERT( it->second.m_val == 55 * 3 ); - - CPPUNIT_ASSERT( m.insert( 55 ) == m.end() ); - CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() ); - CPPUNIT_ASSERT( m.insert_with( 55, insert_functor()) == m.end() ); - - CPPUNIT_ASSERT( m.contains(10) != m.end() ); - std::pair updateResult = m.update( 10 ); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( !updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(10) == updateResult.first ); - it = m.contains(10); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 50 ); - - CPPUNIT_ASSERT( m.contains(120) == m.end() ); - updateResult = m.update(120, false); - CPPUNIT_ASSERT(updateResult.first == m.end()); - CPPUNIT_ASSERT(!updateResult.second); - updateResult = m.update( 120, true ); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 4 )); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( m.contains(120, equal()) == updateResult.first ); - it = m.contains(120, equal()); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 120 * 5 ); - CPPUNIT_ASSERT( m.contains(120, equal()) == m.contains(120) ); - - // emplace test - it = m.emplace( 151 ) ; // key = 151, val = 0 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - it = m.emplace( 174, 471 ) ; // key == 174, val = 471 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.emplace( 151, 1051 ); - CPPUNIT_ASSERT( it == m.end()); - - it = m.contains( 174 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.contains( 190 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.contains( 151 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - } - - // iterator test - - { - Map m( 52, 4 ); - - for ( int i = 0; i < 500; ++i ) { - CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() ); - } - CPPUNIT_ASSERT( check_size( m, 500 )); - - { - typename Map::iterator it( m.begin() ); - typename Map::const_iterator cit( m.cbegin() ); - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - ++it; - CPPUNIT_CHECK( it != cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - ++cit; - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != m.end() ); - CPPUNIT_CHECK( it != m.cend() ); - CPPUNIT_CHECK( cit != m.end() ); - CPPUNIT_CHECK( cit != m.cend() ); - } - - - for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - iterator it2 = it; - CPPUNIT_CHECK( it2 == it ); - CPPUNIT_CHECK( it2 != itEnd ); - CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val ); - it->second = it->first; - } - - Map const& refMap = m; - for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - } - } - } - - template - void test_iter() - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - Map s( 100, 4 ); - - const int nMaxCount = 500; - for ( int i = 0; i < nMaxCount; ++i ) { - CPPUNIT_ASSERT( s.insert( i, i * 2 )); - } - - { - typename Map::iterator it( s.begin() ); - typename Map::const_iterator cit( s.cbegin() ); - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != s.end() ); - CPPUNIT_CHECK( it != s.cend() ); - CPPUNIT_CHECK( cit != s.end() ); - CPPUNIT_CHECK( cit != s.cend() ); - ++it; - CPPUNIT_CHECK( it != cit ); - CPPUNIT_CHECK( it != s.end() ); - CPPUNIT_CHECK( it != s.cend() ); - CPPUNIT_CHECK( cit != s.end() ); - CPPUNIT_CHECK( cit != s.cend() ); - ++cit; - CPPUNIT_CHECK( it == cit ); - CPPUNIT_CHECK( it != s.end() ); - CPPUNIT_CHECK( it != s.cend() ); - CPPUNIT_CHECK( cit != s.end() ); - CPPUNIT_CHECK( cit != s.cend() ); - } - - int nCount = 0; - for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first * 2 == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val ); - it->second.m_val = it->first; - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - - Map const& refSet = s; - nCount = 0; - for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - } - - - void Michael_HP_cmp(); - void Michael_HP_less(); - void Michael_HP_cmpmix(); - - void Michael_DHP_cmp(); - void Michael_DHP_less(); - void Michael_DHP_cmpmix(); - - void Michael_RCU_GPI_cmp(); - void Michael_RCU_GPI_less(); - void Michael_RCU_GPI_cmpmix(); - - void Michael_RCU_GPB_cmp(); - void Michael_RCU_GPB_less(); - void Michael_RCU_GPB_cmpmix(); - - void Michael_RCU_GPT_cmp(); - void Michael_RCU_GPT_less(); - void Michael_RCU_GPT_cmpmix(); - - void Michael_RCU_SHB_cmp(); - void Michael_RCU_SHB_less(); - void Michael_RCU_SHB_cmpmix(); - - void Michael_RCU_SHT_cmp(); - void Michael_RCU_SHT_less(); - void Michael_RCU_SHT_cmpmix(); - - void Michael_nogc_cmp(); - void Michael_nogc_less(); - void Michael_nogc_cmpmix(); - - void Lazy_HP_cmp(); - void Lazy_HP_less(); - void Lazy_HP_cmpmix(); - - void Lazy_DHP_cmp(); - void Lazy_DHP_less(); - void Lazy_DHP_cmpmix(); - - void Lazy_RCU_GPI_cmp(); - void Lazy_RCU_GPI_less(); - void Lazy_RCU_GPI_cmpmix(); - - void Lazy_RCU_GPB_cmp(); - void Lazy_RCU_GPB_less(); - void Lazy_RCU_GPB_cmpmix(); - - void Lazy_RCU_GPT_cmp(); - void Lazy_RCU_GPT_less(); - void Lazy_RCU_GPT_cmpmix(); - - void Lazy_RCU_SHB_cmp(); - void Lazy_RCU_SHB_less(); - void Lazy_RCU_SHB_cmpmix(); - - void Lazy_RCU_SHT_cmp(); - void Lazy_RCU_SHT_less(); - void Lazy_RCU_SHT_cmpmix(); - - void Lazy_nogc_cmp(); - void Lazy_nogc_less(); - void Lazy_nogc_equal(); - void Lazy_nogc_cmpmix(); - - void Split_HP_cmp(); - void Split_HP_less(); - void Split_HP_cmpmix(); - void Split_HP_cmpmix_stat(); - - void Split_DHP_cmp(); - void Split_DHP_less(); - void Split_DHP_cmpmix(); - void Split_DHP_cmpmix_stat(); - - void Split_RCU_GPI_cmp(); - void Split_RCU_GPI_less(); - void Split_RCU_GPI_cmpmix(); - void Split_RCU_GPI_cmpmix_stat(); - - void Split_RCU_GPB_cmp(); - void Split_RCU_GPB_less(); - void Split_RCU_GPB_cmpmix(); - void Split_RCU_GPB_cmpmix_stat(); - - void Split_RCU_GPT_cmp(); - void Split_RCU_GPT_less(); - void Split_RCU_GPT_cmpmix(); - void Split_RCU_GPT_cmpmix_stat(); - - void Split_RCU_SHB_cmp(); - void Split_RCU_SHB_less(); - void Split_RCU_SHB_cmpmix(); - void Split_RCU_SHB_cmpmix_stat(); - - void Split_RCU_SHT_cmp(); - void Split_RCU_SHT_less(); - void Split_RCU_SHT_cmpmix(); - void Split_RCU_SHT_cmpmix_stat(); - - void Split_nogc_cmp(); - void Split_nogc_less(); - void Split_nogc_cmpmix(); - void Split_nogc_cmpmix_stat(); - - void Split_Lazy_HP_cmp(); - void Split_Lazy_HP_less(); - void Split_Lazy_HP_cmpmix(); - void Split_Lazy_HP_cmpmix_stat(); - - void Split_Lazy_DHP_cmp(); - void Split_Lazy_DHP_less(); - void Split_Lazy_DHP_cmpmix(); - void Split_Lazy_DHP_cmpmix_stat(); - - void Split_Lazy_RCU_GPI_cmp(); - void Split_Lazy_RCU_GPI_less(); - void Split_Lazy_RCU_GPI_cmpmix(); - void Split_Lazy_RCU_GPI_cmpmix_stat(); - - void Split_Lazy_RCU_GPB_cmp(); - void Split_Lazy_RCU_GPB_less(); - void Split_Lazy_RCU_GPB_cmpmix(); - void Split_Lazy_RCU_GPB_cmpmix_stat(); - - void Split_Lazy_RCU_GPT_cmp(); - void Split_Lazy_RCU_GPT_less(); - void Split_Lazy_RCU_GPT_cmpmix(); - void Split_Lazy_RCU_GPT_cmpmix_stat(); - - void Split_Lazy_RCU_SHB_cmp(); - void Split_Lazy_RCU_SHB_less(); - void Split_Lazy_RCU_SHB_cmpmix(); - void Split_Lazy_RCU_SHB_cmpmix_stat(); - - void Split_Lazy_RCU_SHT_cmp(); - void Split_Lazy_RCU_SHT_less(); - void Split_Lazy_RCU_SHT_cmpmix(); - void Split_Lazy_RCU_SHT_cmpmix_stat(); - - void Split_Lazy_nogc_cmp(); - void Split_Lazy_nogc_less(); - void Split_Lazy_nogc_cmpmix(); - void Split_Lazy_nogc_cmpmix_stat(); - - CPPUNIT_TEST_SUITE(HashMapHdrTest) - CPPUNIT_TEST(Michael_HP_cmp) - CPPUNIT_TEST(Michael_HP_less) - CPPUNIT_TEST(Michael_HP_cmpmix) - - CPPUNIT_TEST(Michael_DHP_cmp) - CPPUNIT_TEST(Michael_DHP_less) - CPPUNIT_TEST(Michael_DHP_cmpmix) - - CPPUNIT_TEST(Michael_RCU_GPI_cmp) - CPPUNIT_TEST(Michael_RCU_GPI_less) - CPPUNIT_TEST(Michael_RCU_GPI_cmpmix) - - CPPUNIT_TEST(Michael_RCU_GPB_cmp) - CPPUNIT_TEST(Michael_RCU_GPB_less) - CPPUNIT_TEST(Michael_RCU_GPB_cmpmix) - - CPPUNIT_TEST(Michael_RCU_SHT_cmp) - CPPUNIT_TEST(Michael_RCU_SHT_less) - CPPUNIT_TEST(Michael_RCU_SHT_cmpmix) - - CPPUNIT_TEST(Michael_RCU_SHB_cmp) - CPPUNIT_TEST(Michael_RCU_SHB_less) - CPPUNIT_TEST(Michael_RCU_SHB_cmpmix) - - CPPUNIT_TEST(Michael_RCU_GPT_cmp) - CPPUNIT_TEST(Michael_RCU_GPT_less) - CPPUNIT_TEST(Michael_RCU_GPT_cmpmix) - - CPPUNIT_TEST(Michael_nogc_cmp) - CPPUNIT_TEST(Michael_nogc_less) - CPPUNIT_TEST(Michael_nogc_cmpmix) - - CPPUNIT_TEST(Lazy_HP_cmp) - CPPUNIT_TEST(Lazy_HP_less) - CPPUNIT_TEST(Lazy_HP_cmpmix) - - CPPUNIT_TEST(Lazy_DHP_cmp) - CPPUNIT_TEST(Lazy_DHP_less) - CPPUNIT_TEST(Lazy_DHP_cmpmix) - - CPPUNIT_TEST(Lazy_RCU_GPI_cmp) - CPPUNIT_TEST(Lazy_RCU_GPI_less) - CPPUNIT_TEST(Lazy_RCU_GPI_cmpmix) - - CPPUNIT_TEST(Lazy_RCU_GPB_cmp) - CPPUNIT_TEST(Lazy_RCU_GPB_less) - CPPUNIT_TEST(Lazy_RCU_GPB_cmpmix) - - CPPUNIT_TEST(Lazy_RCU_GPT_cmp) - CPPUNIT_TEST(Lazy_RCU_GPT_less) - CPPUNIT_TEST(Lazy_RCU_GPT_cmpmix) - - CPPUNIT_TEST(Lazy_RCU_SHB_cmp) - CPPUNIT_TEST(Lazy_RCU_SHB_less) - CPPUNIT_TEST(Lazy_RCU_SHB_cmpmix) - - CPPUNIT_TEST(Lazy_RCU_SHT_cmp) - CPPUNIT_TEST(Lazy_RCU_SHT_less) - CPPUNIT_TEST(Lazy_RCU_SHT_cmpmix) - - CPPUNIT_TEST(Lazy_nogc_cmp) - CPPUNIT_TEST(Lazy_nogc_less) - CPPUNIT_TEST(Lazy_nogc_equal) - CPPUNIT_TEST(Lazy_nogc_cmpmix) - - CPPUNIT_TEST(Split_HP_cmp) - CPPUNIT_TEST(Split_HP_less) - CPPUNIT_TEST(Split_HP_cmpmix) - CPPUNIT_TEST( Split_HP_cmpmix_stat ) - - CPPUNIT_TEST(Split_DHP_cmp) - CPPUNIT_TEST(Split_DHP_less) - CPPUNIT_TEST(Split_DHP_cmpmix) - CPPUNIT_TEST( Split_DHP_cmpmix_stat ) - - CPPUNIT_TEST(Split_RCU_GPI_cmp) - CPPUNIT_TEST(Split_RCU_GPI_less) - CPPUNIT_TEST(Split_RCU_GPI_cmpmix) - CPPUNIT_TEST( Split_RCU_GPI_cmpmix_stat ) - - CPPUNIT_TEST(Split_RCU_GPB_cmp) - CPPUNIT_TEST(Split_RCU_GPB_less) - CPPUNIT_TEST(Split_RCU_GPB_cmpmix) - CPPUNIT_TEST( Split_RCU_GPB_cmpmix_stat ) - - CPPUNIT_TEST(Split_RCU_GPT_cmp) - CPPUNIT_TEST(Split_RCU_GPT_less) - CPPUNIT_TEST(Split_RCU_GPT_cmpmix) - CPPUNIT_TEST( Split_RCU_GPT_cmpmix_stat ) - - CPPUNIT_TEST(Split_RCU_SHB_cmp) - CPPUNIT_TEST(Split_RCU_SHB_less) - CPPUNIT_TEST(Split_RCU_SHB_cmpmix) - CPPUNIT_TEST( Split_RCU_SHB_cmpmix_stat ) - - CPPUNIT_TEST(Split_RCU_SHT_cmp) - CPPUNIT_TEST(Split_RCU_SHT_less) - CPPUNIT_TEST(Split_RCU_SHT_cmpmix) - CPPUNIT_TEST( Split_RCU_SHT_cmpmix_stat ) - - CPPUNIT_TEST(Split_nogc_cmp) - CPPUNIT_TEST(Split_nogc_less) - CPPUNIT_TEST(Split_nogc_cmpmix) - CPPUNIT_TEST( Split_nogc_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_HP_cmp) - CPPUNIT_TEST(Split_Lazy_HP_less) - CPPUNIT_TEST(Split_Lazy_HP_cmpmix) - CPPUNIT_TEST( Split_Lazy_HP_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_DHP_cmp) - CPPUNIT_TEST(Split_Lazy_DHP_less) - CPPUNIT_TEST(Split_Lazy_DHP_cmpmix) - CPPUNIT_TEST( Split_Lazy_DHP_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmp) - CPPUNIT_TEST(Split_Lazy_RCU_GPI_less) - CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmpmix) - CPPUNIT_TEST( Split_Lazy_RCU_GPI_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmp) - CPPUNIT_TEST(Split_Lazy_RCU_GPB_less) - CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmpmix) - CPPUNIT_TEST( Split_Lazy_RCU_GPB_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmp) - CPPUNIT_TEST(Split_Lazy_RCU_GPT_less) - CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmpmix) - CPPUNIT_TEST( Split_Lazy_RCU_GPT_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmp) - CPPUNIT_TEST(Split_Lazy_RCU_SHB_less) - CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmpmix) - CPPUNIT_TEST( Split_Lazy_RCU_SHB_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmp) - CPPUNIT_TEST(Split_Lazy_RCU_SHT_less) - CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmpmix) - CPPUNIT_TEST( Split_Lazy_RCU_SHT_cmpmix_stat ) - - CPPUNIT_TEST(Split_Lazy_nogc_cmp) - CPPUNIT_TEST(Split_Lazy_nogc_less) - CPPUNIT_TEST(Split_Lazy_nogc_cmpmix) - CPPUNIT_TEST( Split_Lazy_nogc_cmpmix_stat ) - CPPUNIT_TEST_SUITE_END() - - }; -} // namespace map - -#endif // #ifndef CDSTEST_HDR_MAP_H diff --git a/tests/test-hdr/map/hdr_michael_map_dhp.cpp b/tests/test-hdr/map/hdr_michael_map_dhp.cpp deleted file mode 100644 index 26a5f474..00000000 --- a/tests/test-hdr/map/hdr_michael_map_dhp.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - struct DHP_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct DHP_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct DHP_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_DHP_cmp() - { - typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Michael_DHP_less() - { - typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Michael_DHP_cmpmix() - { - typedef cc::MichaelKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_hp.cpp b/tests/test-hdr/map/hdr_michael_map_hp.cpp deleted file mode 100644 index 47e673cd..00000000 --- a/tests/test-hdr/map/hdr_michael_map_hp.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - - struct HP_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct HP_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct HP_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_HP_cmp() - { - typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Michael_HP_less() - { - typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Michael_HP_cmpmix() - { - typedef cc::MichaelKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::HashMapHdrTest); - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp deleted file mode 100644 index ae6e2445..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_dhp.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - struct DHP_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct DHP_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct DHP_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Lazy_DHP_cmp() - { - typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Lazy_DHP_less() - { - typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Lazy_DHP_cmpmix() - { - typedef cc::LazyKVList< cds::gc::DHP, int, HashMapHdrTest::value_type, DHP_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::DHP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp deleted file mode 100644 index 49f15d21..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_hp.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - struct HP_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct HP_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct HP_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Lazy_HP_cmp() - { - typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Lazy_HP_less() - { - typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Lazy_HP_cmpmix() - { - typedef cc::LazyKVList< cds::gc::HP, int, HashMapHdrTest::value_type, HP_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, map_traits > map; - test_int< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::HP, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp deleted file mode 100644 index 669697d7..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_nogc.cpp +++ /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. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - struct nogc_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct nogc_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct nogc_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - - struct nogc_equal_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::equal equal_to; - static const bool sort = false; - }; - } - - void HashMapHdrTest::Lazy_nogc_cmp() - { - typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Lazy_nogc_less() - { - typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Lazy_nogc_equal() - { - typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_equal_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc_unordered< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc_unordered< opt_map >(); - } - - void HashMapHdrTest::Lazy_nogc_cmpmix() - { - typedef cc::LazyKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp deleted file mode 100644 index 7e1f0255..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpb.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - - struct RCU_GPB_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPB_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPB_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Lazy_RCU_GPB_cmp() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPB_less() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPB_cmpmix() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp deleted file mode 100644 index a62d9fe5..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpi.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - - struct RCU_GPI_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPI_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPI_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Lazy_RCU_GPI_cmp() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPI_less() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPI_cmpmix() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp deleted file mode 100644 index aca21938..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_gpt.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - - struct RCU_GPT_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPT_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPT_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Lazy_RCU_GPT_cmp() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPT_less() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Lazy_RCU_GPT_cmpmix() - { - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp deleted file mode 100644 index 8cb31656..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_shb.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - - struct RCU_SHB_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_SHB_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } -#endif - - void HashMapHdrTest::Lazy_RCU_SHB_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Lazy_RCU_SHB_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Lazy_RCU_SHB_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp b/tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp deleted file mode 100644 index 7e3cf443..00000000 --- a/tests/test-hdr/map/hdr_michael_map_lazy_rcu_sht.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - - struct RCU_SHT_cmp_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_SHT_less_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } -#endif - - void HashMapHdrTest::Lazy_RCU_SHT_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Lazy_RCU_SHT_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Lazy_RCU_SHT_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_michael_map_nogc.cpp b/tests/test-hdr/map/hdr_michael_map_nogc.cpp deleted file mode 100644 index c32e2703..00000000 --- a/tests/test-hdr/map/hdr_michael_map_nogc.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - struct nogc_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct nogc_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct nogc_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_nogc_cmp() - { - typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Michael_nogc_less() - { - typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Michael_nogc_cmpmix() - { - typedef cc::MichaelKVList< cds::gc::nogc, int, HashMapHdrTest::value_type, nogc_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, map_traits > map; - test_int_nogc< map >(); - - // option-based version - typedef cc::MichaelHashMap< cds::gc::nogc, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp b/tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp deleted file mode 100644 index 219adfc5..00000000 --- a/tests/test-hdr/map/hdr_michael_map_rcu_gpb.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - - struct RCU_GPB_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPB_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPB_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_RCU_GPB_cmp() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPB_less() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPB_cmpmix() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp b/tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp deleted file mode 100644 index b4d53d18..00000000 --- a/tests/test-hdr/map/hdr_michael_map_rcu_gpi.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - - struct RCU_GPI_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPI_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPI_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_RCU_GPI_cmp() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPI_less() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPI_cmpmix() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPI_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp b/tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp deleted file mode 100644 index 1bf0d872..00000000 --- a/tests/test-hdr/map/hdr_michael_map_rcu_gpt.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - - struct RCU_GPT_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_GPT_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_GPT_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } - - void HashMapHdrTest::Michael_RCU_GPT_cmp() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPT_less() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - void HashMapHdrTest::Michael_RCU_GPT_cmpmix() - { - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_GPT_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); - } - - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp b/tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp deleted file mode 100644 index eccce320..00000000 --- a/tests/test-hdr/map/hdr_michael_map_rcu_shb.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - - struct RCU_SHB_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_SHB_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } -#endif - - void HashMapHdrTest::Michael_RCU_SHB_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Michael_RCU_SHB_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Michael_RCU_SHB_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp b/tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp deleted file mode 100644 index 185dff65..00000000 --- a/tests/test-hdr/map/hdr_michael_map_rcu_sht.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - struct map_traits: public cc::michael_map::traits - { - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - }; - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - - struct RCU_SHT_cmp_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - - struct RCU_SHT_less_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - - struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef HashMapHdrTest::less less; - }; - } -#endif - - void HashMapHdrTest::Michael_RCU_SHT_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Michael_RCU_SHT_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_less_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Michael_RCU_SHT_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelKVList< rcu_type, int, HashMapHdrTest::value_type, RCU_SHT_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashMap< rcu_type, list, map_traits > map; - test_rcu_michael_list< map >(); - - // option-based version - typedef cc::MichaelHashMap< rcu_type, list, - cc::michael_map::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_map; - test_rcu_michael_list< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp deleted file mode 100644 index b696697b..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_boost_flat_map.cpp +++ /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. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Refinable_boost_flat_map() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_map you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::flat_map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Refinable_boost_flat_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } -} // namespace map - -/* -#else - namespace map { - void StripedMapHdrTest::Refinable_boost_flat_map() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map is not compatible with MS VC++ 11" ); - } - } -#endif -*/ - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Refinable_boost_flat_map() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp deleted file mode 100644 index 2a111feb..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_boost_list.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Refinable_boost_list() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::list you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::list< StripedMapHdrTest::pair_type > sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second )); - } - }; - } - - void StripedMapHdrTest::Refinable_boost_list() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } - -} // namespace map - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Refinable_boost_list() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::list you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp deleted file mode 100644 index 4346a9d9..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_boost_map.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Refinable_boost_map() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::map you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Refinable_boost_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } -} // namespace map - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Refinable_boost_map() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::map you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp deleted file mode 100644 index aa0347f6..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_boost_unordered_map.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef boost::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( std::make_pair(itWhat->first, itWhat->second ) ); - } - }; - } - - void StripedMapHdrTest::Refinable_boost_unordered_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp deleted file mode 100644 index 7ff3793a..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_hashmap_std.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( std::make_pair(itWhat->first, itWhat->second ) ); - } - }; - } - - void StripedMapHdrTest::Refinable_hashmap() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp deleted file mode 100644 index 5dbfc4b5..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_list.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::list sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second )); - } - }; - } - - void StripedMapHdrTest::Refinable_list() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } -} // namespace map diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_map.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_map.cpp deleted file mode 100644 index 273452d6..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_map.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Refinable_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp b/tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp deleted file mode 100644 index 93026aad..00000000 --- a/tests/test-hdr/map/hdr_refinable_hashmap_slist.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Refinable_slist() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::slist you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - - -namespace map { - - namespace { - typedef boost::container::slist sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert_after( itInsert, StripedMapHdrTest::pair_type( std::make_pair(itWhat->first, itWhat->second ))); - } - }; - } - - void StripedMapHdrTest::Refinable_slist() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::mutex_policy< cc::striped_set::refinable > - , co::hash< hash_int > - , co::less< less > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::refinable<> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } -} // namespace map -#else - -namespace map { - void StripedMapHdrTest::Refinable_slist() - { - CPPUNIT_MESSAGE("Skipped; for boost::container::slist you should use boost version 1.48 or above"); - } -} // namespace map - -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_skiplist_map.h b/tests/test-hdr/map/hdr_skiplist_map.h deleted file mode 100644 index 147f6993..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map.h +++ /dev/null @@ -1,570 +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 CDSTEST_HDR_SKIPLIST_MAP_H -#define CDSTEST_HDR_SKIPLIST_MAP_H - -#include "map/hdr_map.h" - -namespace map { - - class SkipListMapHdrTest: public HashMapHdrTest - { - typedef HashMapHdrTest base_class; - typedef base_class::other_item wrapped_item; - typedef base_class::other_less wrapped_less; - - template - void test() - { - Map m; - test_int_with( m ); - - static int const nLimit = 10000; - typedef typename Map::iterator set_iterator; - typedef typename Map::const_iterator const_set_iterator; - - int nCount = 0; - int nPrevKey = 0; - - // Test iterator - ascending order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - - for ( int i = 0; i < nLimit; ++i ) { - CPPUNIT_ASSERT( m.insert(i, i) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, ascending insert order") ); - - nCount = 0; - nPrevKey = 0; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first * 2; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - // Test iterator - descending order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - - for ( int i = nLimit; i > 0; --i ) { - CPPUNIT_ASSERT( m.insert( i - 1, (i-1) * 2) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, descending insert order") ); - - nCount = 0; - nPrevKey = 0; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - // Test iterator - random order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - { - int nRand[nLimit]; - for ( int i = 0; i < nLimit; ++i ) { - nRand[i] = i; - } - shuffle( nRand, nRand + nLimit ); - - for ( int i = 0; i < nLimit; ++i ) { - CPPUNIT_ASSERT( m.insert( nRand[i], nRand[i]) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, random insert order") ); - } - - nCount = 0; - nPrevKey = 0; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first * 2; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - CPPUNIT_ASSERT( nCount == nLimit ); - - { - typename Map::guarded_ptr gp; - int arrItem[nLimit]; - for ( int i = 0; i < nLimit; ++i ) - arrItem[i] = i; - shuffle( arrItem, arrItem + nLimit ); - - typedef base_class::less less; - - // extract/get - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrItem[i]; - gp = m.get( nKey ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey * 2 ); - gp.release(); - - gp = m.extract( nKey ); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey * 2 ); - gp.release(); - - gp = m.get( nKey ); - CPPUNIT_CHECK( !gp ); - CPPUNIT_CHECK( !m.extract(nKey)); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_ASSERT( m.empty()); - - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - - // extract_with/get_with - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrItem[i]; - gp = m.get_with( wrapped_item( nKey ), wrapped_less()); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey * 2 ); - gp.release(); - - gp = m.extract_with( wrapped_item( nKey ), wrapped_less()); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == nKey ); - CPPUNIT_CHECK( gp->second.m_val == nKey * 2 ); - gp.release(); - - gp = m.get_with( wrapped_item( nKey ), wrapped_less() ); - CPPUNIT_CHECK( !gp ); - CPPUNIT_CHECK( !m.extract_with( wrapped_item(nKey), wrapped_less())); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_ASSERT( m.empty()); - - //extract_min - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - - for ( int i = 0; i < nLimit; ++i ) { - gp = m.extract_min(); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == i ); - CPPUNIT_CHECK( gp->second.m_val == i * 2 ); - gp.release(); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_CHECK( !m.extract_min()); - - // extract_max - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - - for ( int i = nLimit - 1; i >= 0; --i ) { - gp = m.extract_max(); - CPPUNIT_ASSERT( gp ); - CPPUNIT_ASSERT( !gp.empty()); - CPPUNIT_CHECK( gp->first == i ); - CPPUNIT_CHECK( gp->second.m_val == i * 2 ); - gp.release(); - CPPUNIT_CHECK( gp.empty()); - } - CPPUNIT_CHECK( !m.extract_max()); - CPPUNIT_CHECK( gp.empty()); - CPPUNIT_ASSERT( m.empty()); - } - - CPPUNIT_MSG( PrintStat()(m, nullptr) ); - } - - template - void test_nogc() - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - Map m; - - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - CPPUNIT_ASSERT( m.contains(10) == m.end() ); - iterator it = m.insert( 10 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 10 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(10) == it ); - CPPUNIT_ASSERT( it->first == 10 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - CPPUNIT_ASSERT( m.contains(100) == m.end() ); - it = m.insert( 100, 200 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(100) == it ); - CPPUNIT_ASSERT( it->first == 100 ); - CPPUNIT_ASSERT( it->second.m_val == 200 ); - - CPPUNIT_ASSERT( m.contains(55) == m.end() ); - it = m.insert_with( 55, insert_functor() ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(55) == it ); - CPPUNIT_ASSERT( it->first == 55 ); - CPPUNIT_ASSERT( it->second.m_val == 55 * 3 ); - - CPPUNIT_ASSERT( m.insert( 55 ) == m.end() ); - CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() ); - CPPUNIT_ASSERT( m.insert_with( 55, insert_functor()) == m.end() ); - - CPPUNIT_ASSERT( m.contains(10) != m.end() ); - std::pair updateResult = m.update( 10, false ); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( !updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(10) == updateResult.first ); - it = m.contains( 10, typename base_class::less() ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 50 ); - - CPPUNIT_ASSERT( m.contains(120, base_class::less()) == m.end() ); - updateResult = m.update(120, false); - CPPUNIT_ASSERT(updateResult.first == m.end()); - CPPUNIT_ASSERT(!updateResult.second); - updateResult = m.update( 120 ); - CPPUNIT_ASSERT( updateResult.first != m.end() ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 4 )); - updateResult.first->second.m_val = updateResult.first->first * 5; - CPPUNIT_ASSERT( m.contains(120, base_class::less()) == updateResult.first ); - it = m.contains(120, base_class::less()); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->second.m_val == 120 * 5 ); - - // emplace test - it = m.emplace( 151 ) ; // key = 151, val = 0 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - it = m.emplace( 174, 471 ) ; // key == 174, val = 471 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19 - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.emplace( 151, 1051 ); - CPPUNIT_ASSERT( it == m.end()); - - it = m.contains( 174 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 174 ); - CPPUNIT_ASSERT( it->second.m_val == 471 ); - - it = m.contains( 190 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 190 ); - CPPUNIT_ASSERT( it->second.m_val == 91 ); - - it = m.contains( 151 ); - CPPUNIT_ASSERT( it != m.end() ); - CPPUNIT_ASSERT( it->first == 151 ); - CPPUNIT_ASSERT( it->second.m_val == 0 ); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // get_min test - for ( int i = 500; i > 0; --i ) { - CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() ); - - typename Map::value_type * pVal = m.get_min(); - CPPUNIT_ASSERT( pVal != nullptr ); - CPPUNIT_CHECK( pVal->first == i ); - CPPUNIT_CHECK( pVal->second.m_val == i * 2 ); - } - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - CPPUNIT_CHECK( m.get_min() == nullptr ); - CPPUNIT_CHECK( m.get_max() == nullptr ); - - // iterator test - - for ( int i = 0; i < 500; ++i ) { - CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() ); - - typename Map::value_type * pVal = m.get_max(); - CPPUNIT_ASSERT( pVal != nullptr ); - CPPUNIT_CHECK( pVal->first == i ); - CPPUNIT_CHECK( pVal->second.m_val == i * 2 ); - } - CPPUNIT_ASSERT( check_size( m, 500 )); - - for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val ); - it->second = it->first; - } - - Map const& refMap = m; - for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - } - - CPPUNIT_MSG( PrintStat()(m, "SkipListMap statistics") ); - } - - public: - void SkipList_HP_less(); - void SkipList_HP_cmp(); - void SkipList_HP_cmpless(); - void SkipList_HP_less_stat(); - void SkipList_HP_cmp_stat(); - void SkipList_HP_cmpless_stat(); - void SkipList_HP_xorshift_less(); - void SkipList_HP_xorshift_cmp(); - void SkipList_HP_xorshift_cmpless(); - void SkipList_HP_xorshift_less_stat(); - void SkipList_HP_xorshift_cmp_stat(); - void SkipList_HP_xorshift_cmpless_stat(); - void SkipList_HP_turbopas_less(); - void SkipList_HP_turbopas_cmp(); - void SkipList_HP_turbopas_cmpless(); - void SkipList_HP_turbopas_less_stat(); - void SkipList_HP_turbopas_cmp_stat(); - void SkipList_HP_turbopas_cmpless_stat(); - void SkipList_HP_michaelalloc_less(); - void SkipList_HP_michaelalloc_cmp(); - void SkipList_HP_michaelalloc_cmpless(); - void SkipList_HP_michaelalloc_less_stat(); - void SkipList_HP_michaelalloc_cmp_stat(); - void SkipList_HP_michaelalloc_cmpless_stat(); - - void SkipList_DHP_less(); - void SkipList_DHP_cmp(); - void SkipList_DHP_cmpless(); - void SkipList_DHP_less_stat(); - void SkipList_DHP_cmp_stat(); - void SkipList_DHP_cmpless_stat(); - void SkipList_DHP_xorshift_less(); - void SkipList_DHP_xorshift_cmp(); - void SkipList_DHP_xorshift_cmpless(); - void SkipList_DHP_xorshift_less_stat(); - void SkipList_DHP_xorshift_cmp_stat(); - void SkipList_DHP_xorshift_cmpless_stat(); - void SkipList_DHP_turbopas_less(); - void SkipList_DHP_turbopas_cmp(); - void SkipList_DHP_turbopas_cmpless(); - void SkipList_DHP_turbopas_less_stat(); - void SkipList_DHP_turbopas_cmp_stat(); - void SkipList_DHP_turbopas_cmpless_stat(); - void SkipList_DHP_michaelalloc_less(); - void SkipList_DHP_michaelalloc_cmp(); - void SkipList_DHP_michaelalloc_cmpless(); - void SkipList_DHP_michaelalloc_less_stat(); - void SkipList_DHP_michaelalloc_cmp_stat(); - void SkipList_DHP_michaelalloc_cmpless_stat(); - - void SkipList_NOGC_less(); - void SkipList_NOGC_cmp(); - void SkipList_NOGC_cmpless(); - void SkipList_NOGC_less_stat(); - void SkipList_NOGC_cmp_stat(); - void SkipList_NOGC_cmpless_stat(); - void SkipList_NOGC_xorshift_less(); - void SkipList_NOGC_xorshift_cmp(); - void SkipList_NOGC_xorshift_cmpless(); - void SkipList_NOGC_xorshift_less_stat(); - void SkipList_NOGC_xorshift_cmp_stat(); - void SkipList_NOGC_xorshift_cmpless_stat(); - void SkipList_NOGC_turbopas_less(); - void SkipList_NOGC_turbopas_cmp(); - void SkipList_NOGC_turbopas_cmpless(); - void SkipList_NOGC_turbopas_less_stat(); - void SkipList_NOGC_turbopas_cmp_stat(); - void SkipList_NOGC_turbopas_cmpless_stat(); - void SkipList_NOGC_michaelalloc_less(); - void SkipList_NOGC_michaelalloc_cmp(); - void SkipList_NOGC_michaelalloc_cmpless(); - void SkipList_NOGC_michaelalloc_less_stat(); - void SkipList_NOGC_michaelalloc_cmp_stat(); - void SkipList_NOGC_michaelalloc_cmpless_stat(); - - CPPUNIT_TEST_SUITE(SkipListMapHdrTest) - CPPUNIT_TEST(SkipList_HP_less) - CPPUNIT_TEST(SkipList_HP_cmp) - CPPUNIT_TEST(SkipList_HP_cmpless) - CPPUNIT_TEST(SkipList_HP_less_stat) - CPPUNIT_TEST(SkipList_HP_cmp_stat) - CPPUNIT_TEST(SkipList_HP_cmpless_stat) - CPPUNIT_TEST(SkipList_HP_xorshift_less) - CPPUNIT_TEST(SkipList_HP_xorshift_cmp) - CPPUNIT_TEST(SkipList_HP_xorshift_cmpless) - CPPUNIT_TEST(SkipList_HP_xorshift_less_stat) - CPPUNIT_TEST(SkipList_HP_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_HP_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_HP_turbopas_less) - CPPUNIT_TEST(SkipList_HP_turbopas_cmp) - CPPUNIT_TEST(SkipList_HP_turbopas_cmpless) - CPPUNIT_TEST(SkipList_HP_turbopas_less_stat) - CPPUNIT_TEST(SkipList_HP_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_HP_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_HP_michaelalloc_less) - CPPUNIT_TEST(SkipList_HP_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_HP_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_HP_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_HP_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_HP_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_DHP_less) - CPPUNIT_TEST(SkipList_DHP_cmp) - CPPUNIT_TEST(SkipList_DHP_cmpless) - CPPUNIT_TEST(SkipList_DHP_less_stat) - CPPUNIT_TEST(SkipList_DHP_cmp_stat) - CPPUNIT_TEST(SkipList_DHP_cmpless_stat) - CPPUNIT_TEST(SkipList_DHP_xorshift_less) - CPPUNIT_TEST(SkipList_DHP_xorshift_cmp) - CPPUNIT_TEST(SkipList_DHP_xorshift_cmpless) - CPPUNIT_TEST(SkipList_DHP_xorshift_less_stat) - CPPUNIT_TEST(SkipList_DHP_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_DHP_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_DHP_turbopas_less) - CPPUNIT_TEST(SkipList_DHP_turbopas_cmp) - CPPUNIT_TEST(SkipList_DHP_turbopas_cmpless) - CPPUNIT_TEST(SkipList_DHP_turbopas_less_stat) - CPPUNIT_TEST(SkipList_DHP_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_DHP_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_less) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_DHP_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_NOGC_less) - CPPUNIT_TEST(SkipList_NOGC_cmp) - CPPUNIT_TEST(SkipList_NOGC_cmpless) - CPPUNIT_TEST(SkipList_NOGC_less_stat) - CPPUNIT_TEST(SkipList_NOGC_cmp_stat) - CPPUNIT_TEST(SkipList_NOGC_cmpless_stat) - CPPUNIT_TEST(SkipList_NOGC_xorshift_less) - CPPUNIT_TEST(SkipList_NOGC_xorshift_cmp) - CPPUNIT_TEST(SkipList_NOGC_xorshift_cmpless) - CPPUNIT_TEST(SkipList_NOGC_xorshift_less_stat) - CPPUNIT_TEST(SkipList_NOGC_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_NOGC_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_NOGC_turbopas_less) - CPPUNIT_TEST(SkipList_NOGC_turbopas_cmp) - CPPUNIT_TEST(SkipList_NOGC_turbopas_cmpless) - CPPUNIT_TEST(SkipList_NOGC_turbopas_less_stat) - CPPUNIT_TEST(SkipList_NOGC_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_NOGC_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_less) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_NOGC_michaelalloc_cmpless_stat) - - CPPUNIT_TEST_SUITE_END() - - }; - -} // namespace map - -#endif // #ifndef CDSTEST_HDR_SKIPLIST_MAP_H diff --git a/tests/test-hdr/map/hdr_skiplist_map_dhp.cpp b/tests/test-hdr/map/hdr_skiplist_map_dhp.cpp deleted file mode 100644 index 92b3a7f0..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_dhp.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map.h" -#include -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - - void SkipListMapHdrTest::SkipList_DHP_less() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_cmp() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_cmpless() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_less_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_less() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_cmp() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_cmpless() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_less_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_less() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_cmp() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_cmpless() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_less_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_less() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmp() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmpless() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_less_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_DHP_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::DHP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } -} // namespace map diff --git a/tests/test-hdr/map/hdr_skiplist_map_hp.cpp b/tests/test-hdr/map/hdr_skiplist_map_hp.cpp deleted file mode 100644 index a7a50942..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_hp.cpp +++ /dev/null @@ -1,341 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map.h" -#include -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - - void SkipListMapHdrTest::SkipList_HP_less() - { - struct map_traits : public cc::skip_list::traits - { - typedef SkipListMapHdrTest::less less; - typedef simple_item_counter item_counter; - }; - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, map_traits > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_cmp() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_cmpless() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_less_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_less() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_cmp() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_less_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_less() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_cmp() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_less_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_less() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_less_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::SkipListMapHdrTest); diff --git a/tests/test-hdr/map/hdr_skiplist_map_nogc.cpp b/tests/test-hdr/map/hdr_skiplist_map_nogc.cpp deleted file mode 100644 index 2fff67ef..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_nogc.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map.h" -#include -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - - void SkipListMapHdrTest::SkipList_NOGC_less() - { - struct map_traits : public cc::skip_list::traits - { - typedef SkipListMapHdrTest::less less; - typedef simple_item_counter item_counter; - }; - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, map_traits > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_cmp() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_cmpless() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_less_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_less() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_less_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_less() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_less_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } - - void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test_nogc< set, misc::print_skiplist_stat >(); - } -} // namespace map diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu.h b/tests/test-hdr/map/hdr_skiplist_map_rcu.h deleted file mode 100644 index 6075655c..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu.h +++ /dev/null @@ -1,546 +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 CDSTEST_HDR_SKIPLIST_MAP_RCU_H -#define CDSTEST_HDR_SKIPLIST_MAP_RCU_H - -#include "map/hdr_map.h" - -namespace map { - - class SkipListMapRCUHdrTest: public HashMapHdrTest - { - typedef HashMapHdrTest base_class; - typedef base_class::other_item wrapped_item; - typedef base_class::other_less wrapped_less; - - template - void test() - { - Map m; - test_int_with( m ); - - static int const nLimit = 10000; - typedef typename Map::iterator set_iterator; - typedef typename Map::const_iterator const_set_iterator; - typedef typename Map::gc::scoped_lock rcu_lock; - - int nCount = 0; - int nPrevKey = 0; - - // Test iterator - ascending order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - - for ( int i = 0; i < nLimit; ++i ) { - CPPUNIT_ASSERT( m.insert(i, i) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, ascending insert order") ); - - nCount = 0; - nPrevKey = 0; - { - rcu_lock sl; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first * 2; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - { - rcu_lock sl; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - // Test iterator - descending order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - - for ( int i = nLimit; i > 0; --i ) { - CPPUNIT_ASSERT( m.insert( i - 1, (i-1) * 2) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, descending insert order") ); - - nCount = 0; - nPrevKey = 0; - { - rcu_lock sl; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - { - rcu_lock sl; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - // Test iterator - random order - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - { - int nRand[nLimit]; - for ( int i = 0; i < nLimit; ++i ) { - nRand[i] = i; - } - shuffle( nRand, nRand + nLimit ); - - for ( int i = 0; i < nLimit; ++i ) { - CPPUNIT_ASSERT( m.insert(i, i) ); - } - CPPUNIT_MSG( PrintStat()(m, "Iterator test, random insert order") ); - } - - nCount = 0; - nPrevKey = 0; - { - rcu_lock sl; - for ( set_iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first == it->second.m_val ); - CPPUNIT_ASSERT( m.contains( it->first )); - it->second.m_val = (*it).first * 2; - ++nCount; - if ( it != m.begin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - nCount = 0; - { - rcu_lock sl; - for ( const_set_iterator it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( (*it).first * 2 == it->second.m_val ); - ++nCount; - if ( it != m.cbegin() ) { - CPPUNIT_ASSERT( nPrevKey + 1 == it->first ); - } - nPrevKey = it->first; - } - } - CPPUNIT_ASSERT( nCount == nLimit ); - - { - int arrItem[nLimit]; - for ( int i = 0; i < nLimit; ++i ) - arrItem[i] = i; - shuffle( arrItem, arrItem + nLimit ); - - typedef typename Map::value_type value_type; - typename Map::exempt_ptr ep; - typename Map::raw_ptr rp; - - // extract/get - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrItem[i]; - { - rcu_lock l; - rp = m.get( nKey ); - CPPUNIT_ASSERT( rp ); - CPPUNIT_CHECK( rp->first == nKey ); - CPPUNIT_CHECK( rp->second.m_val == nKey * 2 ); - } - rp.release(); - - ep = m.extract( nKey ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( ep->first == nKey ); - CPPUNIT_CHECK( ep->second.m_val == nKey * 2 ); - ep.release(); - - { - rcu_lock l; - CPPUNIT_CHECK( !m.get( nKey )); - } - ep = m.extract( nKey ); - CPPUNIT_CHECK( !ep ); - } - CPPUNIT_ASSERT( m.empty() ); - - // extract_with/get_with - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - - for ( int i = 0; i < nLimit; ++i ) { - int nKey = arrItem[i]; - { - rcu_lock l; - rp = m.get_with( wrapped_item(nKey), wrapped_less() ); - CPPUNIT_ASSERT( rp ); - CPPUNIT_CHECK( rp->first == nKey ); - CPPUNIT_CHECK( rp->second.m_val == nKey * 2 ); - } - rp.release(); - - ep = m.extract_with( wrapped_item( nKey ), wrapped_less() ); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( ep->first == nKey ); - CPPUNIT_CHECK( ep->second.m_val == nKey * 2 ); - ep.release(); - - { - rcu_lock l; - CPPUNIT_CHECK( !m.get_with( wrapped_item(nKey), wrapped_less() )); - } - ep = m.extract_with( wrapped_item( nKey ), wrapped_less() ); - CPPUNIT_CHECK( !ep ); - } - CPPUNIT_ASSERT( m.empty() ); - - // extract_min - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - for ( int i = 0; i < nLimit; ++i ) { - ep = m.extract_min(); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( ep->first == i ); - CPPUNIT_CHECK( ep->second.m_val == i * 2 ); - ep.release(); - } - CPPUNIT_ASSERT( m.empty() ); - ep = m.extract_min(); - CPPUNIT_CHECK( !ep ); - - // extract_max - for ( int i = 0; i < nLimit; ++i ) - CPPUNIT_ASSERT( m.insert(arrItem[i], arrItem[i]*2) ); - for ( int i = nLimit-1; i >= 0; --i ) { - ep = m.extract_max(); - CPPUNIT_ASSERT( ep ); - CPPUNIT_ASSERT( !ep.empty() ); - CPPUNIT_CHECK( ep->first == i ); - CPPUNIT_CHECK( ep->second.m_val == i * 2 ); - ep.release(); - } - CPPUNIT_ASSERT( m.empty() ); - ep = m.extract_max(); - CPPUNIT_CHECK( !ep ); - } - - CPPUNIT_MSG( PrintStat()(m, nullptr) ); - } - - public: - void SkipList_RCU_GPI_less(); - void SkipList_RCU_GPI_cmp(); - void SkipList_RCU_GPI_cmpless(); - void SkipList_RCU_GPI_less_stat(); - void SkipList_RCU_GPI_cmp_stat(); - void SkipList_RCU_GPI_cmpless_stat(); - void SkipList_RCU_GPI_xorshift_less(); - void SkipList_RCU_GPI_xorshift_cmp(); - void SkipList_RCU_GPI_xorshift_cmpless(); - void SkipList_RCU_GPI_xorshift_less_stat(); - void SkipList_RCU_GPI_xorshift_cmp_stat(); - void SkipList_RCU_GPI_xorshift_cmpless_stat(); - void SkipList_RCU_GPI_turbopas_less(); - void SkipList_RCU_GPI_turbopas_cmp(); - void SkipList_RCU_GPI_turbopas_cmpless(); - void SkipList_RCU_GPI_turbopas_less_stat(); - void SkipList_RCU_GPI_turbopas_cmp_stat(); - void SkipList_RCU_GPI_turbopas_cmpless_stat(); - void SkipList_RCU_GPI_michaelalloc_less(); - void SkipList_RCU_GPI_michaelalloc_cmp(); - void SkipList_RCU_GPI_michaelalloc_cmpless(); - void SkipList_RCU_GPI_michaelalloc_less_stat(); - void SkipList_RCU_GPI_michaelalloc_cmp_stat(); - void SkipList_RCU_GPI_michaelalloc_cmpless_stat(); - - void SkipList_RCU_GPB_less(); - void SkipList_RCU_GPB_cmp(); - void SkipList_RCU_GPB_cmpless(); - void SkipList_RCU_GPB_less_stat(); - void SkipList_RCU_GPB_cmp_stat(); - void SkipList_RCU_GPB_cmpless_stat(); - void SkipList_RCU_GPB_xorshift_less(); - void SkipList_RCU_GPB_xorshift_cmp(); - void SkipList_RCU_GPB_xorshift_cmpless(); - void SkipList_RCU_GPB_xorshift_less_stat(); - void SkipList_RCU_GPB_xorshift_cmp_stat(); - void SkipList_RCU_GPB_xorshift_cmpless_stat(); - void SkipList_RCU_GPB_turbopas_less(); - void SkipList_RCU_GPB_turbopas_cmp(); - void SkipList_RCU_GPB_turbopas_cmpless(); - void SkipList_RCU_GPB_turbopas_less_stat(); - void SkipList_RCU_GPB_turbopas_cmp_stat(); - void SkipList_RCU_GPB_turbopas_cmpless_stat(); - void SkipList_RCU_GPB_michaelalloc_less(); - void SkipList_RCU_GPB_michaelalloc_cmp(); - void SkipList_RCU_GPB_michaelalloc_cmpless(); - void SkipList_RCU_GPB_michaelalloc_less_stat(); - void SkipList_RCU_GPB_michaelalloc_cmp_stat(); - void SkipList_RCU_GPB_michaelalloc_cmpless_stat(); - - void SkipList_RCU_GPT_less(); - void SkipList_RCU_GPT_cmp(); - void SkipList_RCU_GPT_cmpless(); - void SkipList_RCU_GPT_less_stat(); - void SkipList_RCU_GPT_cmp_stat(); - void SkipList_RCU_GPT_cmpless_stat(); - void SkipList_RCU_GPT_xorshift_less(); - void SkipList_RCU_GPT_xorshift_cmp(); - void SkipList_RCU_GPT_xorshift_cmpless(); - void SkipList_RCU_GPT_xorshift_less_stat(); - void SkipList_RCU_GPT_xorshift_cmp_stat(); - void SkipList_RCU_GPT_xorshift_cmpless_stat(); - void SkipList_RCU_GPT_turbopas_less(); - void SkipList_RCU_GPT_turbopas_cmp(); - void SkipList_RCU_GPT_turbopas_cmpless(); - void SkipList_RCU_GPT_turbopas_less_stat(); - void SkipList_RCU_GPT_turbopas_cmp_stat(); - void SkipList_RCU_GPT_turbopas_cmpless_stat(); - void SkipList_RCU_GPT_michaelalloc_less(); - void SkipList_RCU_GPT_michaelalloc_cmp(); - void SkipList_RCU_GPT_michaelalloc_cmpless(); - void SkipList_RCU_GPT_michaelalloc_less_stat(); - void SkipList_RCU_GPT_michaelalloc_cmp_stat(); - void SkipList_RCU_GPT_michaelalloc_cmpless_stat(); - - void SkipList_RCU_SHB_less(); - void SkipList_RCU_SHB_cmp(); - void SkipList_RCU_SHB_cmpless(); - void SkipList_RCU_SHB_less_stat(); - void SkipList_RCU_SHB_cmp_stat(); - void SkipList_RCU_SHB_cmpless_stat(); - void SkipList_RCU_SHB_xorshift_less(); - void SkipList_RCU_SHB_xorshift_cmp(); - void SkipList_RCU_SHB_xorshift_cmpless(); - void SkipList_RCU_SHB_xorshift_less_stat(); - void SkipList_RCU_SHB_xorshift_cmp_stat(); - void SkipList_RCU_SHB_xorshift_cmpless_stat(); - void SkipList_RCU_SHB_turbopas_less(); - void SkipList_RCU_SHB_turbopas_cmp(); - void SkipList_RCU_SHB_turbopas_cmpless(); - void SkipList_RCU_SHB_turbopas_less_stat(); - void SkipList_RCU_SHB_turbopas_cmp_stat(); - void SkipList_RCU_SHB_turbopas_cmpless_stat(); - void SkipList_RCU_SHB_michaelalloc_less(); - void SkipList_RCU_SHB_michaelalloc_cmp(); - void SkipList_RCU_SHB_michaelalloc_cmpless(); - void SkipList_RCU_SHB_michaelalloc_less_stat(); - void SkipList_RCU_SHB_michaelalloc_cmp_stat(); - void SkipList_RCU_SHB_michaelalloc_cmpless_stat(); - - void SkipList_RCU_SHT_less(); - void SkipList_RCU_SHT_cmp(); - void SkipList_RCU_SHT_cmpless(); - void SkipList_RCU_SHT_less_stat(); - void SkipList_RCU_SHT_cmp_stat(); - void SkipList_RCU_SHT_cmpless_stat(); - void SkipList_RCU_SHT_xorshift_less(); - void SkipList_RCU_SHT_xorshift_cmp(); - void SkipList_RCU_SHT_xorshift_cmpless(); - void SkipList_RCU_SHT_xorshift_less_stat(); - void SkipList_RCU_SHT_xorshift_cmp_stat(); - void SkipList_RCU_SHT_xorshift_cmpless_stat(); - void SkipList_RCU_SHT_turbopas_less(); - void SkipList_RCU_SHT_turbopas_cmp(); - void SkipList_RCU_SHT_turbopas_cmpless(); - void SkipList_RCU_SHT_turbopas_less_stat(); - void SkipList_RCU_SHT_turbopas_cmp_stat(); - void SkipList_RCU_SHT_turbopas_cmpless_stat(); - void SkipList_RCU_SHT_michaelalloc_less(); - void SkipList_RCU_SHT_michaelalloc_cmp(); - void SkipList_RCU_SHT_michaelalloc_cmpless(); - void SkipList_RCU_SHT_michaelalloc_less_stat(); - void SkipList_RCU_SHT_michaelalloc_cmp_stat(); - void SkipList_RCU_SHT_michaelalloc_cmpless_stat(); - - CPPUNIT_TEST_SUITE(SkipListMapRCUHdrTest) - CPPUNIT_TEST(SkipList_RCU_GPI_less) - CPPUNIT_TEST(SkipList_RCU_GPI_cmp) - CPPUNIT_TEST(SkipList_RCU_GPI_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPI_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_less) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmp) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_less) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmp) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_less) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPI_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_RCU_GPB_less) - CPPUNIT_TEST(SkipList_RCU_GPB_cmp) - CPPUNIT_TEST(SkipList_RCU_GPB_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPB_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_less) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmp) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_less) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmp) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_less) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPB_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_RCU_GPT_less) - CPPUNIT_TEST(SkipList_RCU_GPT_cmp) - CPPUNIT_TEST(SkipList_RCU_GPT_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPT_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_less) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmp) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_less) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmp) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_less) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_GPT_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_RCU_SHB_less) - CPPUNIT_TEST(SkipList_RCU_SHB_cmp) - CPPUNIT_TEST(SkipList_RCU_SHB_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHB_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_less) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmp) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_less) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmp) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_less) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHB_michaelalloc_cmpless_stat) - - CPPUNIT_TEST(SkipList_RCU_SHT_less) - CPPUNIT_TEST(SkipList_RCU_SHT_cmp) - CPPUNIT_TEST(SkipList_RCU_SHT_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHT_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_less) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmp) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_xorshift_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_less) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmp) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_turbopas_cmpless_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_less) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmp) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmpless) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_less_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmp_stat) - CPPUNIT_TEST(SkipList_RCU_SHT_michaelalloc_cmpless_stat) - - CPPUNIT_TEST_SUITE_END() - - }; - -} // namespace map - -#endif // #ifndef CDSTEST_HDR_SKIPLIST_MAP_RCU_H diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp b/tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp deleted file mode 100644 index 7b5436a4..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpb.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map_rcu.h" - -#include -#include - -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_less() - { - struct map_traits : public cc::skip_list::traits - { - typedef SkipListMapRCUHdrTest::less less; - typedef simple_item_counter item_counter; - }; - typedef cc::SkipListMap< rcu_type, key_type, value_type, map_traits > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPB_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } -} // namespace map diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp b/tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp deleted file mode 100644 index da2ff6d5..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpi.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map_rcu.h" - -#include -#include - -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPI_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } -} // namespace map - -CPPUNIT_TEST_SUITE_REGISTRATION(map::SkipListMapRCUHdrTest); diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp b/tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp deleted file mode 100644 index c0ef3dd6..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu_gpt.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map_rcu.h" - -#include -#include - -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { - namespace { - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_xorshift_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_turbopas_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_less() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmp() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmpless() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_less_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmp_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } - - void SkipListMapRCUHdrTest::SkipList_RCU_GPT_michaelalloc_cmpless_stat() - { - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); - } -} // namespace map diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp b/tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp deleted file mode 100644 index 0ecb1da6..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu_shb.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map_rcu.h" - -#include -#include - -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - } -#endif - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_xorshift_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_turbopas_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHB_michaelalloc_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp b/tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp deleted file mode 100644 index 528ad10c..00000000 --- a/tests/test-hdr/map/hdr_skiplist_map_rcu_sht.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_skiplist_map_rcu.h" - -#include -#include - -#include "unit/michael_alloc.h" -#include "map/print_skiplist_stat.h" - -namespace map { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - } -#endif - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_xorshift_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_turbopas_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmpless() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_less_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmp_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - - void SkipListMapRCUHdrTest::SkipList_RCU_SHT_michaelalloc_cmpless_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::SkipListMap< rcu_type, key_type, value_type, - cc::skip_list::make_traits< - co::less< less > - ,co::compare< cmp > - ,co::item_counter< simple_item_counter > - ,co::stat< cc::skip_list::stat<> > - ,co::allocator< memory::MichaelAllocator > - >::type - > set; - test< set, misc::print_skiplist_stat >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_splitlist_map_dhp.cpp b/tests/test-hdr/map/hdr_splitlist_map_dhp.cpp deleted file mode 100644 index a4aa3c0c..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_dhp.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct DHP_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct DHP_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct DHP_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct DHP_cmpmix_stat_traits : public DHP_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_DHP_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_DHP_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_less_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_DHP_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_DHP_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_stat_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_hp.cpp b/tests/test-hdr/map/hdr_splitlist_map_hp.cpp deleted file mode 100644 index 36bd1d4e..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_hp.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct HP_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct HP_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct HP_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct HP_cmpmix_stat_traits : public HP_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - - } - - void HashMapHdrTest::Split_HP_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_HP_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_HP_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_HP_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_stat_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - ,cds::opt::stat< cc::split_list::stat<>> - >::type - > opt_map; - test_int< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp deleted file mode 100644 index 6335aa5b..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_dhp.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct DHP_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct DHP_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct DHP_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct DHP_cmpmix_stat_traits : public DHP_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_Lazy_DHP_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_DHP_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_less_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_DHP_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_DHP_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::DHP, key_type, value_type, DHP_cmpmix_stat_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::DHP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - ,cc::opt::stat< cc::split_list::stat<>> - >::type - > opt_map; - test_int< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp deleted file mode 100644 index 81646bc2..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_hp.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct HP_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct HP_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct HP_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct HP_cmpmix_stat_traits : public HP_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_Lazy_HP_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_HP_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_HP_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_HP_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_stat_traits > map_type; - test_int< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::HP, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - ,cc::opt::stat< cc::split_list::stat<>> - >::type - > opt_map; - test_int< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp deleted file mode 100644 index f17442f4..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_nogc.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct nogc_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct nogc_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct nogc_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct nogc_cmpmix_stat_traits : public nogc_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_Lazy_nogc_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmp_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_nogc_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_less_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_nogc_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_nogc_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_stat_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cds::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp deleted file mode 100644 index 790c30db..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpb.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - - struct RCU_GPB_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPB_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_Lazy_RCU_GPB_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPB_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_less_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPB_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPB_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp deleted file mode 100644 index 30499b14..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpi.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - - struct RCU_GPI_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPI_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_Lazy_RCU_GPI_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPI_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_less_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPI_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPI_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp deleted file mode 100644 index 23f0fd13..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_gpt.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - - struct RCU_GPT_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPT_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - - } - - void HashMapHdrTest::Split_Lazy_RCU_GPT_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPT_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_less_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPT_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - - void HashMapHdrTest::Split_Lazy_RCU_GPT_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp deleted file mode 100644 index 095176c1..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_shb.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - - struct RCU_SHB_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_SHB_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - - } -#endif - - void HashMapHdrTest::Split_Lazy_RCU_SHB_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHB_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_less_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHB_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHB_cmpmix_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp b/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp deleted file mode 100644 index 2fbf190b..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_lazy_rcu_sht.cpp +++ /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. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - - struct RCU_SHT_cmp_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_SHT_less_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::lazy_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::lazy_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; -} -#endif - - void HashMapHdrTest::Split_Lazy_RCU_SHT_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHT_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_less_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHT_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_Lazy_RCU_SHT_cmpmix_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::lazy_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_splitlist_map_nogc.cpp b/tests/test-hdr/map/hdr_splitlist_map_nogc.cpp deleted file mode 100644 index efb62e67..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_nogc.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include - -namespace map { - - namespace { - struct nogc_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct nogc_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct nogc_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct nogc_cmpmix_stat_traits : public nogc_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_nogc_cmp() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmp_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_nogc_less() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_less_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_nogc_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - , cc::opt::stat< cc::split_list::empty_stat > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - - void HashMapHdrTest::Split_nogc_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< cds::gc::nogc, key_type, value_type, nogc_cmpmix_stat_traits > map_type; - test_int_nogc< map_type >(); - - // option-based version - typedef cc::SplitListMap< cds::gc::nogc, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_int_nogc< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp b/tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp deleted file mode 100644 index ae2ae562..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpb.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - - struct RCU_GPB_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPB_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_RCU_GPB_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPB_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPB_less_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPB_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPB_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cds::opt::stat< cc::split_list::stat<>> - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp b/tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp deleted file mode 100644 index df9d8267..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpi.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - - struct RCU_GPI_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPI_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - - } - - void HashMapHdrTest::Split_RCU_GPI_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPI_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPI_less_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPI_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPI_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cds::opt::stat< cc::split_list::stat<>> - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp b/tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp deleted file mode 100644 index 1c9aa644..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_rcu_gpt.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - - struct RCU_GPT_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_GPT_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } - - void HashMapHdrTest::Split_RCU_GPT_cmp() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPT_less() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_GPT_less_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPT_cmpmix() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - - void HashMapHdrTest::Split_RCU_GPT_cmpmix_stat() - { - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cds::opt::stat< cc::split_list::stat<>> - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); - } - -} // namespace map - diff --git a/tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp b/tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp deleted file mode 100644 index 9ecb759a..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_rcu_shb.cpp +++ /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. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - - struct RCU_SHB_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_SHB_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } -#endif - - void HashMapHdrTest::Split_RCU_SHB_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHB_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_less_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHB_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHB_cmpmix_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat> - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp b/tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp deleted file mode 100644 index 19e06dd9..00000000 --- a/tests/test-hdr/map/hdr_splitlist_map_rcu_sht.cpp +++ /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. -*/ - -#include "map/hdr_map.h" -#include -#include -#include - -namespace map { - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - namespace { - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - - struct RCU_SHT_cmp_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::relaxed_ordering memory_model; - enum { dynamic_bucket_table = false }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - }; - }; - - struct RCU_SHT_less_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - typedef cc::opt::v::sequential_consistent memory_model; - enum { dynamic_bucket_table = true }; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::less less; - }; - }; - - struct RCU_cmpmix_traits: public cc::split_list::traits - { - typedef cc::michael_list_tag ordered_list; - typedef HashMapHdrTest::hash_int hash; - typedef HashMapHdrTest::simple_item_counter item_counter; - - struct ordered_list_traits: public cc::michael_list::traits - { - typedef HashMapHdrTest::cmp compare; - typedef std::less less; - }; - }; - - struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits - { - typedef cc::split_list::stat<> stat; - }; - } -#endif - - void HashMapHdrTest::Split_RCU_SHT_cmp() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< true > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHT_less() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_less_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::memory_model< cc::opt::v::relaxed_ordering > - ,cc::split_list::dynamic_bucket_table< false > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< less > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHT_cmpmix() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - - void HashMapHdrTest::Split_RCU_SHT_cmpmix_stat() - { -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - // traits-based version - typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type; - test_rcu_split_list< map_type >(); - - // option-based version - typedef cc::SplitListMap< rcu_type, - key_type, - value_type, - cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - ,cc::opt::stat> - ,cc::split_list::ordered_list_traits< - cc::michael_list::make_traits< - cc::opt::less< std::less > - ,cc::opt::compare< cmp > - >::type - > - >::type - > opt_map; - test_rcu_split_list< opt_map >(); -#endif - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp b/tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp deleted file mode 100644 index a19d6dec..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_boost_flat_map.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Striped_boost_flat_map() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_map you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::flat_map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Striped_boost_flat_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - - } - -} // namespace map - -/* -#else - namespace map { - void StripedMapHdrTest::Striped_boost_flat_map() - { - CPPUNIT_MESSAGE( "Skipped; to use boost::container::flat_map is not compatible with MS VC++ 11" ); - } - } -#endif -*/ - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Striped_boost_flat_map() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::flat_map you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp b/tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp deleted file mode 100644 index 0ae8cbc7..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_boost_list.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Striped_boost_list() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::list you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::list< StripedMapHdrTest::pair_type > sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second )); - } - }; - } - - void StripedMapHdrTest::Striped_boost_list() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - - } - -} // namespace map - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Striped_boost_list() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::list you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp b/tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp deleted file mode 100644 index 9c97b54e..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_boost_map.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Striped_boost_map() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::map you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& map, iterator itWhat ) - { - map.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Striped_boost_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - } - -} // namespace map - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Striped_boost_map() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::map you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp b/tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp deleted file mode 100644 index 918df866..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_boost_unordered_map.cpp +++ /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. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef boost::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( std::make_pair(itWhat->first, itWhat->second ) ); - } - }; - } - - void StripedMapHdrTest::Striped_boost_unordered_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp b/tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp deleted file mode 100644 index 59a4fa7b..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_hashmap_std.cpp +++ /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. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::unordered_map< StripedMapHdrTest::key_type, StripedMapHdrTest::value_type > map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( std::make_pair(itWhat->first, itWhat->second ) ); - } - }; - } - - void StripedMapHdrTest::Striped_hashmap() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_striped_hashmap_list.cpp b/tests/test-hdr/map/hdr_striped_hashmap_list.cpp deleted file mode 100644 index 95c348bd..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_list.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::list sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert( itInsert, std::make_pair(itWhat->first, itWhat->second )); - } - - }; - } - - void StripedMapHdrTest::Striped_list() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_striped_hashmap_map.cpp b/tests/test-hdr/map/hdr_striped_hashmap_map.cpp deleted file mode 100644 index 3802e038..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_map.cpp +++ /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. -*/ - -#include "map/hdr_striped_map.h" -#include -#include -#include - -namespace map { - - namespace { - typedef std::map map_t; - - struct my_copy_policy { - typedef map_t::iterator iterator; - - void operator()( map_t& m, iterator /*itInsert*/, iterator itWhat ) - { - m.insert( *itWhat ); - } - }; - } - - void StripedMapHdrTest::Striped_map() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > map_less_resizing_lf; - map_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - > map_less_resizing_lf16; - test_striped< map_less_resizing_lf16 >(); - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(1024)"); - { - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::compare< cmp > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(1024)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<256>"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<256> > - > map_less_resizing_sbt16; - test_striped< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "load_factor_resizing<256>, copy_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped< set_copy_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, swap_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped< set_swap_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, move_item"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped< set_move_item >(); - - CPPUNIT_MESSAGE( "load_factor_resizing<256>, special copy_policy"); - typedef cc::StripedMap< map_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<256> > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped< set_special_copy_item >(); - } - -} // namespace map diff --git a/tests/test-hdr/map/hdr_striped_hashmap_slist.cpp b/tests/test-hdr/map/hdr_striped_hashmap_slist.cpp deleted file mode 100644 index e1d1ad04..00000000 --- a/tests/test-hdr/map/hdr_striped_hashmap_slist.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -#include -#include -#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION <= 105500 -namespace map { - void StripedMapHdrTest::Striped_slist() - { - CPPUNIT_MESSAGE("Skipped; for Microsoft Visual C++ 2013 and boost::container::slist you should use boost version 1.56 or above"); - } -} - -#elif BOOST_VERSION >= 104800 - -#include -#include -#include - -namespace map { - - namespace { - typedef boost::container::slist sequence_t; - - struct my_copy_policy { - typedef sequence_t::iterator iterator; - - void operator()( sequence_t& list, iterator itInsert, iterator itWhat ) - { - list.insert_after( itInsert, StripedMapHdrTest::pair_type( std::make_pair(itWhat->first, itWhat->second ))); - } - }; - } - - void StripedMapHdrTest::Striped_slist() - { - CPPUNIT_MESSAGE( "cmp"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - ,co::mutex_policy< cc::striped_set::striping<> > - > map_cmp; - test_striped2< map_cmp >(); - - CPPUNIT_MESSAGE( "less"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - > map_less; - test_striped2< map_less >(); - - CPPUNIT_MESSAGE( "cmpmix"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::less< less > - > map_cmpmix; - test_striped2< map_cmpmix >(); - - // Spinlock as lock policy - CPPUNIT_MESSAGE( "spinlock"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::mutex_policy< cc::striped_set::striping > - > map_spin; - test_striped2< map_spin >(); - - // Resizing policy - CPPUNIT_MESSAGE( "load_factor_resizing<0>(8)"); - { - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<0> > - > pair_type_less_resizing_lf; - pair_type_less_resizing_lf m(30, cc::striped_set::load_factor_resizing<0>(8) ); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "load_factor_resizing<4>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::load_factor_resizing<4> > - > map_less_resizing_lf16; - test_striped2< map_less_resizing_lf16 >(); - - { - CPPUNIT_MESSAGE( "single_bucket_size_threshold<0>(8)"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<0> > - > map_less_resizing_sbt; - map_less_resizing_sbt m(30, cc::striped_set::single_bucket_size_threshold<0>(8)); - test_striped_with(m); - } - - CPPUNIT_MESSAGE( "single_bucket_size_threshold<6>"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::resizing_policy< cc::striped_set::single_bucket_size_threshold<6> > - > map_less_resizing_sbt16; - test_striped2< map_less_resizing_sbt16 >(); - - // Copy policy - CPPUNIT_MESSAGE( "copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::copy_item > - > set_copy_item; - test_striped2< set_copy_item >(); - - CPPUNIT_MESSAGE( "swap_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::swap_item > - > set_swap_item; - test_striped2< set_swap_item >(); - - CPPUNIT_MESSAGE( "move_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::less< less > - , co::copy_policy< cc::striped_set::move_item > - > set_move_item; - test_striped2< set_move_item >(); - - CPPUNIT_MESSAGE( "special copy_item"); - typedef cc::StripedMap< sequence_t - , co::hash< hash_int > - , co::compare< cmp > - , co::copy_policy< my_copy_policy > - > set_special_copy_item; - test_striped2< set_special_copy_item >(); - } - -} // namespace map - -#else // BOOST_VERSION < 104800 - -namespace map { - void StripedMapHdrTest::Striped_slist() - { - CPPUNIT_MESSAGE( "Skipped; for boost::container::slist you should use boost version 1.48 or above" ); - } -} -#endif // BOOST_VERSION diff --git a/tests/test-hdr/map/hdr_striped_map.h b/tests/test-hdr/map/hdr_striped_map.h deleted file mode 100644 index 211cfeb4..00000000 --- a/tests/test-hdr/map/hdr_striped_map.h +++ /dev/null @@ -1,615 +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 CDSTEST_HDR_STRIPED_MAP_H -#define CDSTEST_HDR_STRIPED_MAP_H -#include "size_check.h" - -#include "cppunit/cppunit_proxy.h" -#include -#include -#include // ref - -namespace cds { namespace container {}} - -namespace map { - using misc::check_size; - - namespace cc = cds::container; - namespace co = cds::opt; - - class StripedMapHdrTest: public CppUnitMini::TestCase - { - public: - typedef int key_type; - - struct value_type { - int m_val; - - value_type() - : m_val(0) - {} - - value_type( int n ) - : m_val( n ) - {} - - value_type( value_type&& v ) - : m_val( v.m_val ) - {} - - value_type( value_type const& v ) - : m_val( v.m_val ) - {} - - value_type& operator=( value_type const& v ) - { - m_val = v.m_val; - return *this; - } - }; - - typedef std::pair pair_type; - - struct less - { - bool operator ()(int v1, int v2 ) const - { - return v1 < v2; - } - }; - - struct cmp { - int operator ()(int v1, int v2 ) const - { - if ( v1 < v2 ) - return -1; - return v1 > v2 ? 1 : 0; - } - }; - - struct equal { - bool operator ()(int v1, int v2 ) const - { - return v1 == v2; - } - }; - - struct hash_int { - size_t operator()( int i ) const - { - return co::v::hash()( i ); - } - }; - - struct simple_item_counter { - size_t m_nCount; - - simple_item_counter() - : m_nCount(0) - {} - - size_t operator ++() - { - return ++m_nCount; - } - - size_t operator --() - { - return --m_nCount; - } - - void reset() - { - m_nCount = 0; - } - - operator size_t() const - { - return m_nCount; - } - }; - - template - struct insert_functor - { - typedef typename Map::value_type pair_type; - - // insert ftor - void operator()( pair_type& item ) - { - item.second.m_val = item.first * 3; - } - - // update() ftor - void operator()( bool bNew, pair_type& item ) - { - if ( bNew ) - item.second.m_val = item.first * 2; - else - item.second.m_val = item.first * 5; - } - }; - - struct check_value { - int m_nExpected; - - check_value( int nExpected ) - : m_nExpected( nExpected ) - {} - - template - void operator ()( T& pair ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - template - void operator ()( T& pair, Q ) - { - CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected ); - } - }; - - struct extract_functor - { - int * m_pVal; - void operator()( pair_type const& val ) - { - *m_pVal = val.second.m_val; - } - }; - - template - void test_int_with( Map& m ) - { - std::pair updateResult; - - // insert - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0 - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(25) ); - - CPPUNIT_ASSERT( !m.insert( 25 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - - CPPUNIT_ASSERT( !m.contains(10) ); - CPPUNIT_ASSERT( m.insert( 10, 10 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(10) ); - - CPPUNIT_ASSERT( !m.insert( 10, 20 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - - CPPUNIT_ASSERT( !m.contains(30) ); - CPPUNIT_ASSERT( m.insert_with( 30, insert_functor() ) ) ; // value = 90 - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(30) ); - - CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor() ) ); - - // update() (new key) - CPPUNIT_ASSERT( !m.contains(27) ); - updateResult = m.update(27, insert_functor(), false); - CPPUNIT_ASSERT(!updateResult.first); - CPPUNIT_ASSERT(!updateResult.second); - CPPUNIT_ASSERT(check_size(m, 3)); - CPPUNIT_ASSERT(!m.contains(27)); - updateResult = m.update( 27, insert_functor() ) ; // value = 54 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.contains(27) ); - - // find test - check_value chk(10); - CPPUNIT_ASSERT( m.find( 10, std::ref(chk) )); - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 25, std::ref( chk ) ) ); - chk.m_nExpected = 90; - CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) ); - chk.m_nExpected = 54; - CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) ); - - updateResult = m.update( 10, insert_functor() ) ; // value = 50 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( !updateResult.second ); - chk.m_nExpected = 50; - CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) ); - - // erase test - CPPUNIT_ASSERT( !m.contains(100) ); - CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found - - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase( 25 )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( !m.erase( 25 )); - - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( m.insert(258)) - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.contains(258) ); - CPPUNIT_ASSERT( m.erase( 258 )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( !m.erase( 258 )); - - int nVal; - extract_functor ext; - ext.m_pVal = &nVal; - - CPPUNIT_ASSERT( !m.contains(29) ); - CPPUNIT_ASSERT( m.insert(29, 290)); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase( 29, std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( nVal == 290 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase( 29, std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( nVal == 90 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // emplace test - CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 - CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 - CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941 - - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - chk.m_nExpected = 731; - CPPUNIT_ASSERT( m.find( 137, std::ref(chk) )); - chk.m_nExpected = 941; - CPPUNIT_ASSERT( m.find( 149, std::ref(chk) )); - - CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - } - - template - void test_iter( Map& s) - { - typedef typename Map::iterator iterator; - typedef typename Map::const_iterator const_iterator; - - const int nMaxCount = 500; - for ( int i = 0; i < nMaxCount; ++i ) { - CPPUNIT_ASSERT( s.insert( i, i * 2 )); - } - - int nCount = 0; - for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first * 2 == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val ); - it->second.m_val = it->first; - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - - Map const& refSet = s; - nCount = 0; - for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) { - CPPUNIT_ASSERT( it->first == it->second.m_val ); - CPPUNIT_ASSERT( (*it).first == (*it).second.m_val ); - ++nCount; - } - CPPUNIT_ASSERT( nCount == nMaxCount ); - } - - template - void test_striped() - { - Map m( 30 ); - CPPUNIT_ASSERT( m.bucket_count() == 32 ); - CPPUNIT_ASSERT( m.lock_count() == 32 ); - - test_striped_with(m); - } - - template - void test_striped_with(Map& m) - { - cds::OS::Timer timer; - - test_int_with( m ); - - // Iterators is not yet supported - //m.clear(); - //CPPUNIT_ASSERT( m.empty() ); - //CPPUNIT_ASSERT( check_size( m, 0 )); - //test_iter(m); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // Resizing test - for ( int i = 0; i < 40000; i++ ) { - m.insert( i ); - } - - CPPUNIT_MSG( " Duration=" << timer.duration() ); - } - - //******************************************* - // If erase_with && find_with are supported - template - void test_int_with2( Map& m ) - { - std::pair updateResult; - - // insert - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0 - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - CPPUNIT_ASSERT( m.contains(25) ); - - CPPUNIT_ASSERT( !m.insert( 25 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 1 )); - - CPPUNIT_ASSERT( !m.contains(10, less()) ); - CPPUNIT_ASSERT( m.insert( 10, 10 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( m.contains(10, less()) ); - - CPPUNIT_ASSERT( !m.insert( 10, 20 ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - - CPPUNIT_ASSERT( !m.contains(30) ); - CPPUNIT_ASSERT( m.insert_with( 30, insert_functor() ) ) ; // value = 90 - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( m.contains(30) ); - - CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor() ) ); - CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor() ) ); - - // update() (new key) - CPPUNIT_ASSERT( !m.contains(27) ); - updateResult = m.update(27, insert_functor(), false); - CPPUNIT_ASSERT(!updateResult.first); - CPPUNIT_ASSERT(!updateResult.second); - CPPUNIT_ASSERT(!m.contains(27)); - updateResult = m.update( 27, insert_functor() ) ; // value = 54 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( updateResult.second ); - CPPUNIT_ASSERT( m.contains(27) ); - - // find test - check_value chk(10); - CPPUNIT_ASSERT( m.find( 10, std::ref(chk) )); - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) ); - chk.m_nExpected = 90; - CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) ); - chk.m_nExpected = 54; - CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) ); - - updateResult = m.update( 10, insert_functor(), false ) ; // value = 50 - CPPUNIT_ASSERT( updateResult.first ); - CPPUNIT_ASSERT( !updateResult.second ); - chk.m_nExpected = 50; - CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) ); - - // erase test - CPPUNIT_ASSERT( !m.contains(100) ); - CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found - - CPPUNIT_ASSERT( m.contains(25) ); - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.erase( 25 )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(25) ); - CPPUNIT_ASSERT( !m.erase( 25 )); - - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( m.insert(258)) - CPPUNIT_ASSERT( check_size( m, 4 )); - CPPUNIT_ASSERT( m.contains(258, less()) ); - CPPUNIT_ASSERT( m.erase_with( 258, less() )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( !m.contains(258) ); - CPPUNIT_ASSERT( !m.erase_with( 258, less() )); - - int nVal; - extract_functor ext; - ext.m_pVal = &nVal; - - CPPUNIT_ASSERT( !m.contains(29) ); - CPPUNIT_ASSERT( m.insert(29, 290)) - CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - CPPUNIT_ASSERT( nVal == 290 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 2 )); - CPPUNIT_ASSERT( nVal == 90 ); - nVal = -1; - CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) ); - CPPUNIT_ASSERT( nVal == -1 ); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // emplace test - CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 - CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 - CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941 - - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - chk.m_nExpected = 731; - CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) )); - chk.m_nExpected = 941; - CPPUNIT_ASSERT( m.find( 149, std::ref(chk) )); - - CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map - chk.m_nExpected = 0; - CPPUNIT_ASSERT( m.find( 126, std::ref(chk) )); - CPPUNIT_ASSERT( !m.empty() ); - CPPUNIT_ASSERT( check_size( m, 3 )); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - } - - template - void test_striped_with2(Map& m) - { - cds::OS::Timer timer; - - test_int_with2( m ); - - // Iterators is not yet supported - //m.clear(); - //CPPUNIT_ASSERT( m.empty() ); - //CPPUNIT_ASSERT( check_size( m, 0 )); - //test_iter(m); - - m.clear(); - CPPUNIT_ASSERT( m.empty() ); - CPPUNIT_ASSERT( check_size( m, 0 )); - - // Resizing test - for ( int i = 0; i < 40000; i++ ) { - m.insert( i ); - } - - CPPUNIT_MSG( " Duration=" << timer.duration() ); - } - - template - void test_striped2() - { - Map m( 30 ); - CPPUNIT_ASSERT( m.bucket_count() == 32 ); - CPPUNIT_ASSERT( m.lock_count() == 32 ); - - test_striped_with2(m); - } - - void Striped_hashmap(); - void Striped_list(); - void Striped_map(); - void Striped_slist(); - void Striped_boost_list(); - void Striped_boost_flat_map(); - void Striped_boost_map(); - void Striped_boost_unordered_map(); - - void Refinable_hashmap(); - void Refinable_list(); - void Refinable_map(); - void Refinable_slist(); - void Refinable_boost_list(); - void Refinable_boost_flat_map(); - void Refinable_boost_map(); - void Refinable_boost_unordered_map(); - - CPPUNIT_TEST_SUITE(StripedMapHdrTest) - CPPUNIT_TEST(Striped_hashmap) - CPPUNIT_TEST(Striped_list) - CPPUNIT_TEST(Striped_map) - CPPUNIT_TEST(Striped_slist) - CPPUNIT_TEST(Striped_boost_list) - CPPUNIT_TEST(Striped_boost_flat_map) - CPPUNIT_TEST(Striped_boost_map) - CPPUNIT_TEST(Striped_boost_unordered_map) - - CPPUNIT_TEST(Refinable_hashmap) - CPPUNIT_TEST(Refinable_list) - CPPUNIT_TEST(Refinable_map) - CPPUNIT_TEST(Refinable_slist) - CPPUNIT_TEST(Refinable_boost_list) - CPPUNIT_TEST(Refinable_boost_flat_map) - CPPUNIT_TEST(Refinable_boost_map) - CPPUNIT_TEST(Refinable_boost_unordered_map) - CPPUNIT_TEST_SUITE_END() - - }; -} // namespace map - -#endif // #ifndef CDSTEST_HDR_STRIPED_MAP_H diff --git a/tests/test-hdr/map/hdr_striped_map_reg.cpp b/tests/test-hdr/map/hdr_striped_map_reg.cpp deleted file mode 100644 index f4c2973b..00000000 --- a/tests/test-hdr/map/hdr_striped_map_reg.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "map/hdr_striped_map.h" - -CPPUNIT_TEST_SUITE_REGISTRATION(map::StripedMapHdrTest); diff --git a/tests/test-hdr/map/print_skiplist_stat.h b/tests/test-hdr/map/print_skiplist_stat.h deleted file mode 100644 index 48e8b952..00000000 --- a/tests/test-hdr/map/print_skiplist_stat.h +++ /dev/null @@ -1,71 +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 CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H -#define CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H - -#include "unit/print_skip_list_stat.h" - -namespace misc { - - template - struct print_skiplist_stat; - - template <> - struct print_skiplist_stat< cds::intrusive::skip_list::stat<> > - { - template - std::string operator()( Set const& s, const char * pszHdr ) - { - std::stringstream st; - if ( pszHdr ) { - st << "\t\t" << pszHdr << "\n" - << s.statistics(); - } - else { - st << s.statistics(); - } - return st.str(); - } - }; - - template<> - struct print_skiplist_stat< cds::intrusive::skip_list::empty_stat > - { - template - std::string operator()( Set const& /*s*/, const char * /*pszHdr*/ ) - { - return std::string(); - } - }; - -} // namespace misc - -#endif // #ifndef CDSTEST_HDR_MAP_PRINT_SKIPLIST_STAT_H -- 2.34.1