Migrated map_find_int stress test to gtest
authorkhizmax <libcds.dev@gmail.com>
Sat, 21 May 2016 16:04:17 +0000 (19:04 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 21 May 2016 16:04:17 +0000 (19:04 +0300)
25 files changed:
projects/Win/vc14/cds.sln
projects/Win/vc14/stress-map-find_int.vcxproj [new file with mode: 0644]
projects/Win/vc14/stress-map-find_int.vcxproj.filters [new file with mode: 0644]
projects/source.unit.map.mk
test/include/cds_test/fixture.h
test/stress/data/test-debug.conf
test/stress/data/test-express.conf
test/stress/data/test.conf
test/stress/map/CMakeLists.txt
test/stress/map/find_int/CMakeLists.txt [new file with mode: 0644]
test/stress/map/find_int/map_find_int.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int.h [new file with mode: 0644]
test/stress/map/find_int/map_find_int_bronsonavltree.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_cuckoo.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_ellentree.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_feldman_hashset.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_michael.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_skip.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_split.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_std.cpp [new file with mode: 0644]
test/stress/map/find_int/map_find_int_striped.cpp [new file with mode: 0644]
test/stress/map/map_type_split_list.h
test/stress/map/map_type_std.h [new file with mode: 0644]
test/stress/map/map_type_striped.h [new file with mode: 0644]
tests/unit/map2/map_find_int.h

index b82ce5cb046540b8b14f95fe65627e288a0b79ce..a36390d6af272664a4f03cd349f3dce335ed56ee 100644 (file)
@@ -223,10 +223,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Header Files", "Header File
                ..\..\..\test\stress\map\map_type_michael_list.h = ..\..\..\test\stress\map\map_type_michael_list.h\r
                ..\..\..\test\stress\map\map_type_skip_list.h = ..\..\..\test\stress\map\map_type_skip_list.h\r
                ..\..\..\test\stress\map\map_type_split_list.h = ..\..\..\test\stress\map\map_type_split_list.h\r
+               ..\..\..\test\stress\map\map_type_std.h = ..\..\..\test\stress\map\map_type_std.h\r
+               ..\..\..\test\stress\map\map_type_striped.h = ..\..\..\test\stress\map\map_type_striped.h\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-map-delodd", "stress-map-delodd.vcxproj", "{DD432BE7-0CA8-47C6-B861-943A036C18EF}"\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-map-find_int", "stress-map-find_int.vcxproj", "{3F36B97B-8028-4335-ADDD-20B6B81F87AF}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -585,6 +589,18 @@ Global
                {DD432BE7-0CA8-47C6-B861-943A036C18EF}.Release|Win32.Build.0 = Release|Win32\r
                {DD432BE7-0CA8-47C6-B861-943A036C18EF}.Release|x64.ActiveCfg = Release|x64\r
                {DD432BE7-0CA8-47C6-B861-943A036C18EF}.Release|x64.Build.0 = Release|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Debug|Win32.Build.0 = Debug|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Debug|x64.ActiveCfg = Debug|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Debug|x64.Build.0 = Debug|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Release|Win32.ActiveCfg = Release|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Release|Win32.Build.0 = Release|Win32\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Release|x64.ActiveCfg = Release|x64\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF}.Release|x64.Build.0 = Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -623,6 +639,7 @@ Global
                {7D3EE35B-185D-40B5-88C2-7F9933426978} = {10E1FAF2-904D-405E-8AB5-6878A1B03346}\r
                {2C41747C-6CC6-4AE8-9EB8-EB8B954BBDB4} = {7D3EE35B-185D-40B5-88C2-7F9933426978}\r
                {DD432BE7-0CA8-47C6-B861-943A036C18EF} = {7D3EE35B-185D-40B5-88C2-7F9933426978}\r
+               {3F36B97B-8028-4335-ADDD-20B6B81F87AF} = {7D3EE35B-185D-40B5-88C2-7F9933426978}\r
        EndGlobalSection\r
        GlobalSection(DPCodeReviewSolutionGUID) = preSolution\r
                DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\r
diff --git a/projects/Win/vc14/stress-map-find_int.vcxproj b/projects/Win/vc14/stress-map-find_int.vcxproj
new file mode 100644 (file)
index 0000000..65d0f60
--- /dev/null
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="DebugVLD|Win32">
+      <Configuration>DebugVLD</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugVLD|x64">
+      <Configuration>DebugVLD</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\..\test\stress\main.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_bronsonavltree.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_cuckoo.cpp">
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_ellentree.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_feldman_hashset.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_michael.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_skip.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_split.cpp">
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_std.cpp" />
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_striped.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\test\stress\map\find_int\map_find_int.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <Text Include="..\..\..\test\stress\map\find_int\CMakeLists.txt" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{3F36B97B-8028-4335-ADDD-20B6B81F87AF}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>stress_map_find_int</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+    <ProjectName>stress-map-find_int</ProjectName>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)_d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)_d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)_d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)_d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/projects/Win/vc14/stress-map-find_int.vcxproj.filters b/projects/Win/vc14/stress-map-find_int.vcxproj.filters
new file mode 100644 (file)
index 0000000..86d671d
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\..\test\stress\main.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_bronsonavltree.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_cuckoo.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_ellentree.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_feldman_hashset.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_michael.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_skip.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_split.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_std.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\stress\map\find_int\map_find_int_striped.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\test\stress\map\find_int\map_find_int.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Text Include="..\..\..\test\stress\map\find_int\CMakeLists.txt" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
index 1db4e0e24ce3f37536e0196d203e5149c3b89b29..cfe0ed6017baacc9d23603e5115a3704bbfe34f7 100644 (file)
@@ -1,15 +1,5 @@
 
 CDSUNIT_MAP_SOURCES := \
-    tests/unit/map2/map_find_int.cpp \
-    tests/unit/map2/map_find_int_bronsonavltree.cpp \
-    tests/unit/map2/map_find_int_cuckoo.cpp \
-    tests/unit/map2/map_find_int_ellentree.cpp \
-    tests/unit/map2/map_find_int_michael.cpp \
-    tests/unit/map2/map_find_int_feldmanhashmap.cpp \
-    tests/unit/map2/map_find_int_skip.cpp \
-    tests/unit/map2/map_find_int_split.cpp \
-    tests/unit/map2/map_find_int_striped.cpp \
-    tests/unit/map2/map_find_int_std.cpp \
     tests/unit/map2/map_find_string.cpp \
     tests/unit/map2/map_find_string_bronsonavltree.cpp \
     tests/unit/map2/map_find_string_cuckoo.cpp \
@@ -87,11 +77,3 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_insdelfind_split.cpp \
     tests/unit/map2/map_insdelfind_striped.cpp \
     tests/unit/map2/map_insdelfind_std.cpp \
-    tests/unit/map2/map_delodd.cpp \
-    tests/unit/map2/map_delodd_bronsonavltree.cpp \
-    tests/unit/map2/map_delodd_cuckoo.cpp \
-    tests/unit/map2/map_delodd_ellentree.cpp \
-    tests/unit/map2/map_delodd_michael.cpp \
-    tests/unit/map2/map_delodd_feldmanhashmap.cpp \
-    tests/unit/map2/map_delodd_skip.cpp \
-    tests/unit/map2/map_delodd_split.cpp \
index f8835e3a969658ecba9d029ba04a807259db783e..ec56e3276764abc7951c3e7192050d072153a407 100644 (file)
@@ -52,6 +52,13 @@ namespace cds_test {
 
             std::shuffle( first, last, random_gen );
         }
+
+        static inline unsigned int rand( unsigned int nMax )
+        {
+            double rnd = double( std::rand() ) / double( RAND_MAX );
+            unsigned int n = (unsigned int)(rnd * nMax);
+            return n < nMax ? n : (n - 1);
+        }
     };
 
 } // namespace cds_test
index 82fae8db36171e965482b39ebb89d24ea2115792..f49868f9b59f62ba901ac9a3c51ccb34ede338ab 100644 (file)
@@ -165,13 +165,13 @@ MapSize=1000000
 ThreadCount=4\r
 MapSize=1000000\r
 \r
-[Map_find_int]\r
+[map_find_int]\r
 ThreadCount=2\r
 MapSize=10000\r
 PercentExists=50\r
 PassCount=2\r
 MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
 # *** Cuckoo map properties\r
 CuckooInitialSize=256\r
 CuckooProbesetSize=8\r
index 04e7a10cc5f92adb0fdbefd63907e6e38be3c4e0..3450eaf5d02976a4900752b2b8f7c45a05bb058c 100644 (file)
@@ -159,13 +159,13 @@ PushThreadCount=4
 PopThreadCount=4\r
 QueueSize=500000\r
 \r
-[Map_find_int]\r
+[map_find_int]\r
 ThreadCount=8\r
 MapSize=100000\r
 PercentExists=50\r
 PassCount=2\r
 MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
 # *** Cuckoo map properties\r
 CuckooInitialSize=1024\r
 CuckooProbesetSize=16\r
index 50aa398f505a44c24e925a7020a78509a8c40bf6..0b3d3dcc50bc34bfa814ef0614509a8964e5e1b4 100644 (file)
@@ -158,13 +158,13 @@ PushThreadCount=4
 PopThreadCount=4\r
 QueueSize=10000000\r
 \r
-[Map_find_int]\r
+[map_find_int]\r
 ThreadCount=8\r
 MapSize=2000000\r
 PercentExists=50\r
 PassCount=1\r
 MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
 # *** Cuckoo map properties\r
 CuckooInitialSize=1024\r
 CuckooProbesetSize=16\r
index ff70393fcbdb4f3243cd12a947dcb8b18c513b91..1f821d07fa33f3dd49461e81a4400c93c5005edc 100644 (file)
@@ -2,6 +2,7 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU")
 
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/find_int)
 #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find)
 #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func)
 #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string)
@@ -9,4 +10,5 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd)
 add_custom_target( stress-map
     DEPENDS
         stress-map-delodd
+        stress-map-find-int
 )
diff --git a/test/stress/map/find_int/CMakeLists.txt b/test/stress/map/find_int/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3ec07ce
--- /dev/null
@@ -0,0 +1,31 @@
+set(PACKAGE_NAME stress-map-find-int)
+
+set(CDSSTRESS_MAP_FIND_INT_SOURCES
+    ../../main.cpp
+    map_find_int.cpp
+    map_find_int_bronsonavltree.cpp
+    map_find_int_cuckoo.cpp
+    map_find_int_ellentree.cpp
+    map_find_int_feldman_hashset.cpp
+    map_find_int_michael.cpp
+    map_find_int_skip.cpp
+    map_find_int_split.cpp
+    map_find_int_std.cpp
+    map_find_int_striped.cpp
+)
+
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}/..
+)
+
+add_executable(${PACKAGE_NAME} ${CDSSTRESS_MAP_FIND_INT_SOURCES} $<TARGET_OBJECTS:${CDSSTRESS_FRAMEWORK_LIBRARY}>)
+target_link_libraries(${PACKAGE_NAME} 
+    ${CDS_SHARED_LIBRARY}
+    ${GTEST_LIBRARY}
+    ${Boost_THREAD_LIBRARY}
+    ${Boost_SYSTEM_LIBRARY}
+    ${CMAKE_THREAD_LIBS_INIT}
+)
+
+add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
\ No newline at end of file
diff --git a/test/stress/map/find_int/map_find_int.cpp b/test/stress/map/find_int/map_find_int.cpp
new file mode 100644 (file)
index 0000000..17b473c
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+    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_find_int.h"
+
+namespace map {
+    
+    size_t Map_find_int::s_nThreadCount = 8;
+    size_t Map_find_int::s_nMapSize = 10000000;
+    size_t Map_find_int::s_nMaxLoadFactor = 8;
+    size_t Map_find_int::s_nPercentExists = 50;
+    size_t Map_find_int::s_nPassCount = 2;
+
+    size_t Map_find_int::s_nCuckooInitialSize = 1024;
+    size_t Map_find_int::s_nCuckooProbesetSize = 16;
+    size_t Map_find_int::s_nCuckooProbesetThreshold = 0;
+
+    size_t Map_find_int::s_nFeldmanMap_HeadBits = 10;
+    size_t Map_find_int::s_nFeldmanMap_ArrayBits = 4;
+
+
+    size_t Map_find_int::s_nLoadFactor = 1;
+    size_t Map_find_int::s_nRealMapSize = 0;
+    Map_find_int::value_vector Map_find_int::s_Data;
+
+    void Map_find_int::generateSequence()
+    {
+        size_t nPercent = s_nPercentExists;
+
+        if ( nPercent > 100 )
+            nPercent = 100;
+        else if ( nPercent < 1 )
+            nPercent = 1;
+        
+        s_nRealMapSize = 0;
+
+        s_Data.resize( s_nMapSize );
+        for ( size_t i = 0; i < s_nMapSize; ++i ) {
+            s_Data[i].nKey = i * 13;
+            s_Data[i].bExists = rand( 100 ) <= nPercent;
+            if ( s_Data[i].bExists )
+                ++s_nRealMapSize;
+        }
+        shuffle( s_Data.begin(), s_Data.end() );
+    }
+
+    void Map_find_int::SetUpTestCase()
+    {
+        cds_test::config const& cfg = get_config( "map_find_int" );
+
+        s_nMapSize = cfg.get_size_t( "MapSize", s_nMapSize );
+        if ( s_nMapSize < 1000 )
+            s_nMapSize = 1000;
+
+        s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
+        if ( s_nThreadCount == 0 )
+            s_nThreadCount = 1;
+
+        s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
+        if ( s_nMaxLoadFactor == 0 )
+            s_nMaxLoadFactor = 1;
+
+        s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
+        if ( s_nCuckooInitialSize < 256 )
+            s_nCuckooInitialSize = 256;
+
+        s_nCuckooProbesetSize = cfg.get_size_t( "CuckooProbesetSize", s_nCuckooProbesetSize );
+        if ( s_nCuckooProbesetSize < 8 )
+            s_nCuckooProbesetSize = 8;
+
+        s_nCuckooProbesetThreshold = cfg.get_size_t( "CuckooProbesetThreshold", s_nCuckooProbesetThreshold );
+
+        s_nFeldmanMap_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanMap_HeadBits );
+        if ( s_nFeldmanMap_HeadBits == 0 )
+            s_nFeldmanMap_HeadBits = 2;
+
+        s_nFeldmanMap_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanMap_ArrayBits );
+        if ( s_nFeldmanMap_ArrayBits == 0 )
+            s_nFeldmanMap_ArrayBits = 2;
+
+        generateSequence();
+    }
+
+    void Map_find_int::TearDownTestCase()
+    {
+        s_Data.clear();
+    }
+
+    std::vector<size_t> Map_find_int_LF::get_load_factors()
+    {
+        cds_test::config const& cfg = get_config( "map_find_int" );
+
+        s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
+        if ( s_nMaxLoadFactor == 0 )
+            s_nMaxLoadFactor = 1;
+
+        std::vector<size_t> lf;
+        for ( size_t n = 1; n <= s_nMaxLoadFactor; n *= 2 )
+            lf.push_back( n );
+
+        return lf;
+    }
+
+    INSTANTIATE_TEST_CASE_P( a, Map_find_int_LF, ::testing::ValuesIn( Map_find_int_LF::get_load_factors() ) );
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int.h b/test/stress/map/find_int/map_find_int.h
new file mode 100644 (file)
index 0000000..f54c308
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+    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_type.h"
+
+// find int test in map<int> in mutithreaded mode
+namespace map {
+
+    class Map_find_int: public cds_test::stress_fixture
+    {
+    public:
+        static size_t s_nThreadCount;       // thread count
+        static size_t s_nMapSize;           // map size (count of searching item)
+        static size_t s_nPercentExists;     // percent of existing keys in searching sequence
+        static size_t s_nPassCount;
+        static size_t s_nMaxLoadFactor;     // maximum load factor
+
+        static size_t s_nCuckooInitialSize;         // initial size for CuckooMap
+        static size_t s_nCuckooProbesetSize;        // CuckooMap probeset size (only for list-based probeset)
+        static size_t s_nCuckooProbesetThreshold;   // CUckooMap probeset threshold (o - use default)
+
+        static size_t s_nFeldmanMap_HeadBits;
+        static size_t s_nFeldmanMap_ArrayBits;
+
+        static size_t s_nLoadFactor;  // current load factor
+
+        typedef size_t   key_type;
+        struct value_type {
+            key_type    nKey;   // key
+            bool        bExists;   // true - key in map, false - key not in map
+        };
+
+        typedef std::vector<value_type> value_vector;
+        static value_vector s_Data;
+
+        static void SetUpTestCase();
+        static void TearDownTestCase();
+
+    private:
+        static size_t s_nRealMapSize;
+
+        static void generateSequence();
+
+        template <typename Iterator, typename Map>
+        static bool check_result( Iterator const& it, Map const& map )
+        {
+            return it != map.end();
+        }
+        template <typename Map>
+        static bool check_result( bool b, Map const& )
+        {
+            return b;
+        }
+
+        template <class Map>
+        class Worker: public cds_test::thread
+        {
+            typedef cds_test::thread base_class;
+            Map&  m_Map;
+
+        public:
+            struct Stat {
+                size_t      nSuccess = 0;
+                size_t      nFailed = 0;
+            };
+
+            Stat    m_KeyExists;
+            Stat    m_KeyNotExists;
+
+        public:
+            Worker( cds_test::thread_pool& pool, Map& map )
+                : base_class( pool )
+                , m_Map( map )
+            {}
+
+            Worker( Worker& src )
+                : base_class( src )
+                , m_Map( src.m_Map )
+            {}
+
+            virtual thread * clone()
+            {
+                return new Worker( *this );
+            }
+
+            virtual void test()
+            {
+                size_t const nPassCount = s_nPassCount;
+
+                Map& rMap = m_Map;
+                for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
+                    if ( id() & 1 ) {
+                        auto itEnd = s_Data.cend();
+                        for ( auto it = s_Data.cbegin(); it != itEnd; ++it ) {
+                            auto bFound = rMap.contains( it->nKey );
+                            if ( it->bExists ) {
+                                if ( check_result( bFound, rMap ))
+                                    ++m_KeyExists.nSuccess;
+                                else
+                                    ++m_KeyExists.nFailed;
+                            }
+                            else {
+                                if ( check_result( bFound, rMap ))
+                                    ++m_KeyNotExists.nFailed;
+                                else
+                                    ++m_KeyNotExists.nSuccess;
+                            }
+                        }
+                    }
+                    else {
+                        auto itEnd = s_Data.crend();
+                        for ( auto it = s_Data.crbegin(); it != itEnd; ++it ) {
+                            auto bFound = rMap.contains( it->nKey );
+                            if ( it->bExists ) {
+                                if ( check_result( bFound, rMap ))
+                                    ++m_KeyExists.nSuccess;
+                                else
+                                    ++m_KeyExists.nFailed;
+                            }
+                            else {
+                                if ( check_result( bFound, rMap ))
+                                    ++m_KeyNotExists.nFailed;
+                                else
+                                    ++m_KeyNotExists.nSuccess;
+                            }
+                        }
+                    }
+                }
+            }
+        };
+
+    protected:
+
+        template <class Map>
+        void test( Map& testMap )
+        {
+            typedef Worker<Map> worker;
+
+            // Fill the map
+            for ( auto const& it: s_Data ) {
+                if ( it.bExists ) {
+                    EXPECT_TRUE( check_result( testMap.insert( it.nKey, it ), testMap ));
+                }
+            }
+
+            propout() << std::make_pair( "thread_count", s_nThreadCount )
+                << std::make_pair( "map_size", s_nMapSize )
+                << std::make_pair( "percent_exist", s_nPercentExists )
+                << std::make_pair( "pass_count", s_nPassCount );
+
+            cds_test::thread_pool& pool = get_pool();
+            pool.add( new worker( pool, testMap ), s_nThreadCount );
+
+            std::chrono::milliseconds duration = pool.run();
+
+            propout() << std::make_pair( "duration", duration );
+
+            size_t nExistSuccess = 0;
+            size_t nExistFailed = 0;
+            size_t nMissingSuccess = 0;
+            size_t nMissingFailed = 0;
+
+            for ( size_t i = 0; i < pool.size(); ++i ) {
+                worker& w = static_cast<worker&>( pool.get( i ));
+                nExistSuccess += w.m_KeyExists.nSuccess;
+                nExistFailed += w.m_KeyExists.nFailed;
+                nMissingSuccess += w.m_KeyNotExists.nSuccess;
+                nMissingFailed += w.m_KeyNotExists.nFailed;
+
+                EXPECT_EQ( w.m_KeyExists.nFailed, 0 ) << "thread " << i;
+                EXPECT_EQ( w.m_KeyExists.nSuccess, s_nRealMapSize * s_nPassCount ) << "thread " << i;
+                EXPECT_EQ( w.m_KeyNotExists.nFailed, 0 ) << "thread " << i;
+                EXPECT_EQ( w.m_KeyNotExists.nSuccess, (s_Data.size() - s_nRealMapSize) * s_nPassCount ) << "thread " << i;
+            }
+
+            propout() 
+                << std::make_pair( "exist_found", nExistSuccess )
+                << std::make_pair( "exist_not_found",  nExistFailed )  // must = 0
+                << std::make_pair( "missing_not_found", nMissingSuccess )
+                << std::make_pair( "missing_found", nMissingFailed );  // must = 0
+
+            check_before_cleanup( testMap );
+
+            testMap.clear();
+            additional_check( testMap );
+            print_stat( propout(), testMap );
+            additional_cleanup( testMap );
+        }
+
+        template <class Map>
+        void run_test()
+        {
+            Map testMap( *this );
+            test( testMap );
+        }
+    };
+
+    class Map_find_int_LF: public Map_find_int
+        , public ::testing::WithParamInterface<size_t>
+    {
+    public:
+        template <class Map>
+        void run_test()
+        {
+            s_nLoadFactor = GetParam();
+            propout() << std::make_pair( "load_factor", s_nLoadFactor );
+            Map_find_int::run_test<Map>();
+        }
+
+        static std::vector<size_t> get_load_factors();
+    };
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_bronsonavltree.cpp b/test/stress/map/find_int/map_find_int_bronsonavltree.cpp
new file mode 100644 (file)
index 0000000..5fa22a9
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    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_find_int.h"
+#include "map_type_bronson_avltree.h"
+
+namespace map {
+
+    CDSSTRESS_BronsonAVLTreeMap( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_cuckoo.cpp b/test/stress/map/find_int/map_find_int_cuckoo.cpp
new file mode 100644 (file)
index 0000000..8c036aa
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    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_find_int.h"
+#include "map_type_cuckoo.h"
+
+namespace map {
+
+    CDSSTRESS_CuckooMap( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_ellentree.cpp b/test/stress/map/find_int/map_find_int_ellentree.cpp
new file mode 100644 (file)
index 0000000..a820bdc
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    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_find_int.h"
+#include "map_type_ellen_bintree.h"
+
+namespace map {
+
+    CDSSTRESS_EllenBinTreeMap( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_feldman_hashset.cpp b/test/stress/map/find_int/map_find_int_feldman_hashset.cpp
new file mode 100644 (file)
index 0000000..56b9cc4
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    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_find_int.h"
+#include "map_type_feldman_hashmap.h"
+
+namespace map {
+
+    CDSSTRESS_FeldmanHashMap_fixed( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_michael.cpp b/test/stress/map/find_int/map_find_int_michael.cpp
new file mode 100644 (file)
index 0000000..8f7a717
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    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_find_int.h"
+#include "map_type_michael.h"
+
+namespace map {
+
+    CDSSTRESS_MichaelMap( Map_find_int_LF, run_test, size_t, Map_find_int::value_type )
+    CDSSTRESS_MichaelMap_nogc( Map_find_int_LF, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_skip.cpp b/test/stress/map/find_int/map_find_int_skip.cpp
new file mode 100644 (file)
index 0000000..fe19b43
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    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_find_int.h"
+#include "map_type_skip_list.h"
+
+namespace map {
+
+    CDSSTRESS_SkipListMap( Map_find_int, run_test, size_t, Map_find_int::value_type )
+    CDSSTRESS_SkipListMap_nogc( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_split.cpp b/test/stress/map/find_int/map_find_int_split.cpp
new file mode 100644 (file)
index 0000000..59bdd93
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    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_find_int.h"
+#include "map_type_split_list.h"
+
+namespace map {
+
+    CDSSTRESS_SplitListMap( Map_find_int_LF, run_test, size_t, Map_find_int::value_type )
+    CDSSTRESS_SplitListMap_nogc( Map_find_int_LF, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_std.cpp b/test/stress/map/find_int/map_find_int_std.cpp
new file mode 100644 (file)
index 0000000..a3557cd
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    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_find_int.h"
+#include "map_type_std.h"
+
+namespace map {
+
+    CDSSTRESS_StdMap( Map_find_int, run_test, size_t, Map_find_int::value_type )
+    CDSSTRESS_StdMap_nolock( Map_find_int, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
diff --git a/test/stress/map/find_int/map_find_int_striped.cpp b/test/stress/map/find_int/map_find_int_striped.cpp
new file mode 100644 (file)
index 0000000..be5c0a1
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    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_find_int.h"
+#include "map_type_striped.h"
+
+namespace map {
+
+    CDSSTRESS_StripedMap( Map_find_int_LF, run_test, size_t, Map_find_int::value_type )
+
+} // namespace map
index 10e4d6b6374e8be86a9ae155aae5e773dfe2cfd2..b419e7bffb14ae1e7d8190a7a2acf2babbc98bc5 100644 (file)
@@ -74,7 +74,7 @@ namespace map {
     public:
         template <typename Config>
         SplitListMap( Config const& cfg)
-            : base_class( cfg.c_nMapSize, cfg.c_nLoadFactor )
+            : base_class( cfg.s_nMapSize, cfg.s_nLoadFactor )
         {}
 
         template <typename K>
diff --git a/test/stress/map/map_type_std.h b/test/stress/map/map_type_std.h
new file mode 100644 (file)
index 0000000..30ce916
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#ifndef CDSUNIT_MAP_TYPE_STD_H
+#define CDSUNIT_MAP_TYPE_STD_H
+
+#include "map_type.h"
+
+#include <map>
+#include <unordered_map>
+
+namespace map {
+
+    struct empty_lock
+    {
+        void lock() {}
+        void unlock() {}
+    };
+
+    template <typename Key, typename Value, typename Lock,
+        class Alloc = typename CDS_DEFAULT_ALLOCATOR::template rebind<std::pair<Key const, Value> >::other
+    >
+        class StdMap: public std::map<Key, Value, std::less<Key>, Alloc>
+    {
+        Lock m_lock;
+        typedef std::unique_lock<Lock> scoped_lock;
+        typedef std::map<Key, Value, std::less<Key>, Alloc> base_class;
+    public:
+        typedef typename base_class::mapped_type value_type;
+        typedef typename base_class::value_type  pair_type;
+        typedef size_t      item_counter;
+
+        StdMap()
+        {}
+
+        template <class Config>
+        StdMap( Config const& )
+        {}
+
+        bool contains( const Key& key )
+        {
+            scoped_lock al( m_lock );
+            return base_class::find( key ) != base_class::end();
+        }
+
+        bool insert( const Key& key, const Value& val )
+        {
+            scoped_lock al( m_lock );
+            return base_class::insert( typename base_class::value_type( key, val ) ).second;
+        }
+
+        template <typename T, typename Func>
+        bool insert( const Key& key, const T& val, Func func )
+        {
+            scoped_lock al( m_lock );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+            if ( pRet.second ) {
+                func( pRet.first->second, val );
+                return true;
+            }
+            return false;
+        }
+
+        template <typename T, typename Func>
+        std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
+        {
+            scoped_lock al( m_lock );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+            if ( pRet.second ) {
+                func( true, *pRet.first );
+                return std::make_pair( true, true );
+            }
+            else {
+                func( false, *pRet.first );
+                return std::make_pair( true, false );
+            }
+        }
+
+        bool erase( const Key& key )
+        {
+            scoped_lock al( m_lock );
+            return base_class::erase( key ) != 0;
+        }
+
+        template <typename T, typename Func>
+        bool erase( const T& key, Func func )
+        {
+            scoped_lock al( m_lock );
+            typename base_class::iterator it = base_class::find( key );
+            if ( it != base_class::end() ) {
+                func( (*it) );
+                base_class::erase( it );
+                return true;
+            }
+            return false;
+        }
+
+        std::ostream& dump( std::ostream& stm ) { return stm; }
+
+
+        // for testing
+        static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+        static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+        static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+    };
+
+    template <typename Key, typename Value, typename Lock,
+        class Alloc = typename CDS_DEFAULT_ALLOCATOR::template rebind<std::pair<Key const, Value> >::other
+    >
+    class StdHashMap
+        : public std::unordered_map<
+            Key, Value
+            , std::hash<Key>
+            , std::equal_to<Key>
+            , Alloc
+        >
+    {
+    public:
+        Lock m_lock;
+        typedef std::unique_lock<Lock> scoped_lock;
+        typedef std::unordered_map<
+            Key, Value
+            , std::hash<Key>
+            , std::equal_to<Key>
+            , Alloc
+        >   base_class;
+    public:
+        typedef typename base_class::mapped_type value_type;
+        typedef size_t      item_counter;
+
+        StdHashMap()
+        {}
+
+        template <class Config>
+        StdHashMap( Config const& )
+        {}
+
+        bool contains( const Key& key )
+        {
+            scoped_lock al( m_lock );
+            return base_class::find( key ) != base_class::end();
+        }
+
+        bool insert( const Key& key, const Value& val )
+        {
+            scoped_lock al( m_lock );
+            return base_class::insert( typename base_class::value_type(key, val)).second;
+        }
+
+        template <typename T, typename Func>
+        bool insert( const Key& key, const T& val, Func func )
+        {
+            scoped_lock al( m_lock );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
+            if ( pRet.second ) {
+                func( pRet.first->second, val );
+                return true;
+            }
+            return false;
+        }
+
+        template <typename T, typename Func>
+        std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
+        {
+            scoped_lock al( m_lock );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ));
+            if ( pRet.second ) {
+                func( true, *pRet.first );
+                return std::make_pair( true, true );
+            }
+            else {
+                func( false, *pRet.first );
+                return std::make_pair( true, false );
+            }
+        }
+
+        bool erase( const Key& key )
+        {
+            scoped_lock al( m_lock );
+            return base_class::erase( key ) != 0;
+        }
+
+        template <typename T, typename Func>
+        bool erase( const T& key, Func func )
+        {
+            scoped_lock al( m_lock );
+            typename base_class::iterator it = base_class::find( key );
+            if ( it != base_class::end() ) {
+                func( *it );
+                return base_class::erase( key ) != 0;
+            }
+            return false;
+        }
+
+        std::ostream& dump( std::ostream& stm ) { return stm; }
+
+
+        // for testing
+        static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+        static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+        static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+    }; 
+
+    struct tag_StdMap;
+
+    template <typename Key, typename Value>
+    struct map_type< tag_StdMap, Key, Value >: public map_type_base< Key, Value >
+    {
+        typedef map_type_base< Key, Value >      base_class;
+        typedef typename base_class::key_compare compare;
+        typedef typename base_class::key_less    less;
+
+        typedef StdMap< Key, Value, cds::sync::spin > StdMap_Spin;
+        typedef StdMap< Key, Value, std::mutex >      StdMap_Mutex;
+        typedef StdMap< Key, Value, empty_lock>       StdMap_NoLock;
+
+        typedef StdHashMap< Key, Value, cds::sync::spin > StdHashMap_Spin;
+        typedef StdHashMap< Key, Value, std::mutex >      StdHashMap_Mutex;
+        typedef StdHashMap< Key, Value, empty_lock >      StdHashMap_NoLock;
+    };
+}   // namespace map
+
+#define CDSSTRESS_StdMap_case( fixture, test_case, std_map_type, key_type, value_type ) \
+    TEST_F( fixture, std_map_type ) \
+    { \
+        typedef map::map_type< tag_StdMap, key_type, value_type >::std_map_type map_type; \
+        test_case<map_type>(); \
+    }
+
+#define CDSSTRESS_StdMap( fixture, test_case, key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdMap_Spin,      key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdMap_Mutex,     key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdHashMap_Spin,  key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdHashMap_Mutex, key_type, value_type )
+
+#define CDSSTRESS_StdMap_nolock( fixture, test_case, key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdMap_NoLock,      key_type, value_type ) \
+    CDSSTRESS_StdMap_case( fixture, test_case, StdHashMap_NoLock,  key_type, value_type )
+
+#endif // ifndef CDSUNIT_MAP_TYPE_STD_H
diff --git a/test/stress/map/map_type_striped.h b/test/stress/map/map_type_striped.h
new file mode 100644 (file)
index 0000000..44773db
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#ifndef CDSUNIT_MAP_TYPE_STRIPED_H
+#define CDSUNIT_MAP_TYPE_STRIPED_H
+
+#include "map_type.h"
+#include <cds/container/striped_map/std_list.h>
+#include <cds/container/striped_map/std_map.h>
+#include <cds/container/striped_map/std_hash_map.h>
+
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 104800
+#   include <cds/container/striped_map/boost_list.h>
+#   include <cds/container/striped_map/boost_slist.h>
+#   include <cds/container/striped_map/boost_map.h>
+#   include <cds/container/striped_map/boost_flat_map.h>
+#endif
+#include <cds/container/striped_map/boost_unordered_map.h>
+#include <cds/container/striped_map.h>
+
+namespace map {
+
+    struct tag_StripedMap;
+
+    template <typename Key, typename Value>
+    struct map_type< tag_StripedMap, Key, Value >: public map_type_base< Key, Value >
+    {
+        typedef map_type_base< Key, Value >      base_class;
+        typedef typename base_class::key_compare compare;
+        typedef typename base_class::key_less    less;
+        typedef typename base_class::equal_to    equal_to;
+        typedef typename base_class::key_hash    hash;
+        typedef typename base_class::hash2       hash2;
+
+        // for sequential containers
+        template <class BucketEntry, typename... Options>
+        class StripedHashMap_seq:
+            public cc::StripedMap< BucketEntry,
+                co::mutex_policy< cc::striped_set::striping<> >
+                ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                , Options...
+            >
+        {
+            typedef cc::StripedMap< BucketEntry,
+                co::mutex_policy< cc::striped_set::striping<> >
+                ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                , Options...
+            > base_class;
+            typedef typename base_class::resizing_policy resizing_policy_t;
+
+            resizing_policy_t   m_placeHolder;
+        public:
+            template <class Config>
+            StripedHashMap_seq( Config const& cfg )
+                : base_class( cfg.s_nMapSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nLoadFactor )) )
+            {}
+
+            // for testing
+            static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+            static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+        };
+
+        // for non-sequential ordered containers
+        template <class BucketEntry, typename... Options>
+        class StripedHashMap_ord:
+            public cc::StripedMap< BucketEntry,
+                co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::striping<> >
+                , Options...
+            >
+        {
+            typedef cc::StripedMap< BucketEntry,
+               co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::striping<> >
+                , Options...
+            > base_class;
+            typedef typename base_class::resizing_policy resizing_policy_t;
+
+            resizing_policy_t   m_placeHolder;
+        public:
+            template <class Config>
+            StripedHashMap_ord( Config const& cfg )
+                : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nMaxLoadFactor * 1024 )) )
+            {}
+
+            // for testing
+            static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+            static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+        };
+
+
+        typedef StripedHashMap_seq<
+            std::list< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > StripedMap_list;
+
+        typedef StripedHashMap_ord<
+            std::unordered_map< Key, Value, hash, equal_to >
+            , co::hash< hash2 >
+        > StripedMap_hashmap;
+
+        typedef StripedHashMap_ord<
+            std::map< Key, Value, less >
+            , co::hash< hash2 >
+        > StripedMap_map;
+
+        typedef StripedHashMap_ord<
+            boost::unordered_map< Key, Value, hash, equal_to >
+            , co::hash< hash2 >
+        > StripedMap_boost_unordered_map;
+
+#   if BOOST_VERSION >= 104800
+        typedef StripedHashMap_seq<
+            boost::container::slist< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > StripedMap_slist;
+
+        typedef StripedHashMap_seq<
+            boost::container::list< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > StripedMap_boost_list;
+
+        typedef StripedHashMap_ord<
+            boost::container::map< Key, Value, less >
+            , co::hash< hash2 >
+        > StripedMap_boost_map;
+
+        typedef StripedHashMap_ord<
+            boost::container::flat_map< Key, Value, less >
+            , co::hash< hash2 >
+        > StripedMap_boost_flat_map;
+#   endif  // BOOST_VERSION >= 104800
+
+
+        // ***************************************************************************
+        // RefinableHashMap
+
+        // for sequential containers
+        template <class BucketEntry, typename... Options>
+        class RefinableHashMap_seq:
+            public cc::StripedMap< BucketEntry,
+                co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::refinable<> >
+                , Options...
+            >
+        {
+            typedef cc::StripedMap< BucketEntry,
+               co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::refinable<> >
+                , Options...
+            > base_class;
+            typedef typename base_class::resizing_policy resizing_policy_t;
+
+            resizing_policy_t   m_placeHolder;
+        public:
+            template <class Config>
+            RefinableHashMap_seq( Config const& cfg )
+                : base_class( cfg.s_nMapSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nLoadFactor )))
+            {}
+
+            // for testing
+            static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+            static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+        };
+
+        // for non-sequential ordered containers
+        template <class BucketEntry, typename... Options>
+        class RefinableHashMap_ord:
+            public cc::StripedMap< BucketEntry,
+                co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::refinable<> >
+                , Options...
+            >
+        {
+            typedef cc::StripedMap< BucketEntry,
+               co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+                ,co::mutex_policy< cc::striped_set::refinable<> >
+                , Options...
+            > base_class;
+            typedef typename base_class::resizing_policy resizing_policy_t;
+
+            resizing_policy_t   m_placeHolder;
+        public:
+            template <class Config>
+            RefinableHashMap_ord( Config const& cfg )
+                : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nMaxLoadFactor * 1024 )) )
+            {}
+
+            // for testing
+            static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+            static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+        };
+
+
+        typedef RefinableHashMap_seq<
+            std::list< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > RefinableMap_list;
+
+#   if BOOST_VERSION >= 104800
+        typedef RefinableHashMap_seq<
+            boost::container::slist< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > RefinableMap_slist;
+#   endif
+
+        typedef RefinableHashMap_ord<
+            std::map< Key, Value, less >
+            , co::hash< hash2 >
+        > RefinableMap_map;
+
+        typedef RefinableHashMap_ord<
+            std::unordered_map< Key, Value, hash, equal_to >
+            , co::hash< hash2 >
+        > RefinableMap_hashmap;
+
+        typedef RefinableHashMap_ord<
+            boost::unordered_map< Key, Value, hash, equal_to >
+            , co::hash< hash2 >
+        > RefinableMap_boost_unordered_map;
+
+#   if BOOST_VERSION >= 104800
+        typedef RefinableHashMap_seq<
+            boost::container::list< std::pair< Key const, Value > >
+            , co::hash< hash2 >
+            , co::less< less >
+        > RefinableMap_boost_list;
+
+        typedef RefinableHashMap_ord<
+            boost::container::map< Key, Value, less >
+            , co::hash< hash2 >
+        > RefinableMap_boost_map;
+
+        typedef RefinableHashMap_ord<
+            boost::container::flat_map< Key, Value, less >
+            , co::hash< hash2 >
+        > RefinableMap_boost_flat_map;
+#   endif // #if BOOST_VERSION >= 104800
+
+    };
+}   // namespace map
+
+#define CDSSTRESS_StripedMap_case( fixture, test_case, striped_map_type, key_type, value_type ) \
+    TEST_P( fixture, striped_map_type ) \
+    { \
+        typedef map::map_type< tag_StripedMap, key_type, value_type >::striped_map_type map_type; \
+        test_case<map_type>(); \
+    }
+
+#define CDSSTRESS_StripedMap( fixture, test_case, key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, StripedMap_list,         key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, StripedMap_hashmap,      key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, StripedMap_map,          key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, RefinableMap_list,       key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, RefinableMap_map,        key_type, value_type ) \
+    CDSSTRESS_StripedMap_case( fixture, test_case, RefinableMap_hashmap,    key_type, value_type ) \
+
+#endif // ifndef CDSUNIT_MAP_TYPE_STRIPED_H
index 0d2887b00b7755d137ccd4a9d629b41d0f3ea2f5..37939aa4c3dc2869d96ee341094541fcfd6c866e 100644 (file)
@@ -262,7 +262,7 @@ namespace map2 {
         CDSUNIT_DECLARE_StdMap
         CDSUNIT_DECLARE_StdMap_NoLock
 
-        CPPUNIT_TEST_SUITE(Map_find_int)
+        CPPUNIT_TEST_SUITE_(Map_find_int, "map_find_int")
             CDSUNIT_TEST_MichaelMap
             CDSUNIT_TEST_MichaelMap_nogc
             CDSUNIT_TEST_SplitList