Migrated CuckooMap unit test to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Tue, 5 Apr 2016 19:08:39 +0000 (22:08 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 5 Apr 2016 19:08:39 +0000 (22:08 +0300)
projects/Win/vc14/cds.sln
projects/Win/vc14/gtest-striped-map.vcxproj [new file with mode: 0644]
projects/Win/vc14/gtest-striped-map.vcxproj.filters [new file with mode: 0644]
test/unit/CMakeLists.txt
test/unit/striped-map/CMakeLists.txt [new file with mode: 0644]
test/unit/striped-map/cuckoo_map.cpp [new file with mode: 0644]
test/unit/striped-map/test_map.h [new file with mode: 0644]
test/unit/striped-map/test_map_data.h [new file with mode: 0644]

index 78b4e83f66de876f797fc128f943f208b6cebe62..d2ff19a8921a626272614705c469dfc4c68daf47 100644 (file)
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00\r
 # Visual Studio 14\r
-VisualStudioVersion = 14.0.24720.0\r
+VisualStudioVersion = 14.0.25123.0\r
 MinimumVisualStudioVersion = 10.0.40219.1\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cds", "cds.vcxproj", "{408FE9BC-44F0-4E6A-89FA-D6F952584239}"\r
 EndProject\r
@@ -213,6 +213,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-map", "gtest-map.vcxp
                {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-striped-map", "gtest-striped-map.vcxproj", "{00FD5CB8-E1A4-40CA-B613-30A06A75622B}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -547,6 +552,18 @@ Global
                {42B7E892-DDDA-4D00-9AB7-378E0E7E9433}.Release|Win32.Build.0 = Release|Win32\r
                {42B7E892-DDDA-4D00-9AB7-378E0E7E9433}.Release|x64.ActiveCfg = Release|x64\r
                {42B7E892-DDDA-4D00-9AB7-378E0E7E9433}.Release|x64.Build.0 = Release|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Debug|x64.ActiveCfg = Debug|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Debug|x64.Build.0 = Debug|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Release|Win32.ActiveCfg = Release|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Release|Win32.Build.0 = Release|Win32\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Release|x64.ActiveCfg = Release|x64\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B}.Release|x64.Build.0 = Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -580,6 +597,7 @@ Global
                {EC1EF263-7E34-4867-9ED9-77AA7963CD4A} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
                {648021D3-6E18-4B94-88B8-F6A59609E210} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
                {42B7E892-DDDA-4D00-9AB7-378E0E7E9433} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
+               {00FD5CB8-E1A4-40CA-B613-30A06A75622B} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
        EndGlobalSection\r
        GlobalSection(DPCodeReviewSolutionGUID) = preSolution\r
                DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\r
diff --git a/projects/Win/vc14/gtest-striped-map.vcxproj b/projects/Win/vc14/gtest-striped-map.vcxproj
new file mode 100644 (file)
index 0000000..79bf993
--- /dev/null
@@ -0,0 +1,260 @@
+<?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\unit\main.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\cuckoo_map.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>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\test\unit\striped-map\test_map.h" />
+    <ClInclude Include="..\..\..\test\unit\striped-map\test_map_data.h" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{00FD5CB8-E1A4-40CA-B613-30A06A75622B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>striped-map</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </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>CDSUNIT_ENABLE_BOOST_CONTAINER;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>CDSUNIT_ENABLE_BOOST_CONTAINER;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>CDSUNIT_ENABLE_BOOST_CONTAINER;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>CDSUNIT_ENABLE_BOOST_CONTAINER;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(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>CDSUNIT_ENABLE_BOOST_CONTAINER;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(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>CDSUNIT_ENABLE_BOOST_CONTAINER;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(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;%(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/gtest-striped-map.vcxproj.filters b/projects/Win/vc14/gtest-striped-map.vcxproj.filters
new file mode 100644 (file)
index 0000000..3a4078e
--- /dev/null
@@ -0,0 +1,33 @@
+<?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\unit\main.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\cuckoo_map.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\test\unit\striped-map\test_map_data.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\striped-map\test_map.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
index 20a12b2c6c73bd267825385e819b96d4104a2da4..218c81ac4f1b15b5243831d6096fa81747e6521c 100644 (file)
@@ -5,6 +5,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pqueue)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/queue)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/intrusive-set)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/set)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/striped-map)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/striped-set)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/stack)
 
diff --git a/test/unit/striped-map/CMakeLists.txt b/test/unit/striped-map/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a760a6d
--- /dev/null
@@ -0,0 +1,22 @@
+set(PACKAGE_NAME unit-striped-map)
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_ENABLE_BOOST_CONTAINER")
+
+set(CDSGTEST_STRIPED_MAP_SOURCES
+    ../main.cpp
+)
+
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_executable(${PACKAGE_NAME} ${CDSGTEST_STRIPED_MAP_SOURCES})
+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/unit/striped-map/cuckoo_map.cpp b/test/unit/striped-map/cuckoo_map.cpp
new file mode 100644 (file)
index 0000000..a287c96
--- /dev/null
@@ -0,0 +1,517 @@
+/*
+    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 "test_map.h"
+
+#include <cds/container/cuckoo_map.h>
+
+namespace {
+    namespace cc = cds::container;
+
+    class CuckooMap : public cds_test::striped_map
+    {
+    protected:
+        typedef cds_test::striped_map base_class;
+
+        template <typename Set>
+        void test( Set& m )
+        {
+            // Precondition: set is empty
+            // Postcondition: set is empty
+
+            base_class::test_< Set::c_isSorted>( m );
+        }
+
+        //void SetUp()
+        //{}
+
+        //void TearDown()
+        //{}
+    };
+
+    struct store_hash_traits: public cc::cuckoo::traits
+    {
+        static bool const store_hash = true;
+    };
+
+
+//************************************************************
+// striped set
+
+    TEST_F( CuckooMap, striped_list_unordered )
+    {
+        struct map_traits: public cc::cuckoo::traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::list probeset_type;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_unordered )
+    {
+        struct map_traits: public cc::cuckoo::traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::vector<4> probeset_type;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m( 32, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_ordered_cmp )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        map_type m( 32, 6, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_ordered_cmp )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<8>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( ht );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_ordered_less )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 4, ht );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_ordered_less )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_ordered_cmpmix )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 0, std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_ordered_cmpmix )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_ordered_stat )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cds::opt::stat< cc::cuckoo::stat >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_ordered_stat )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cds::opt::stat< cc::cuckoo::stat >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<8>>
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_unordered_storehash )
+    {
+        struct map_traits: public store_hash_traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::list     probeset_type;
+            typedef cc::cuckoo::stat     stat;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_unordered_storehash )
+    {
+        struct map_traits: public store_hash_traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to    equal_to;
+            typedef cc::cuckoo::stat        stat;
+            typedef cc::cuckoo::vector<4>   probeset_type;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m( 32, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_list_ordered_storehash )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            ,cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+                ,cc::cuckoo::store_hash< true >
+            >::type
+        > map_type; 
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 0, std::move( ht ));
+        test( m );
+    }
+
+    TEST_F( CuckooMap, striped_vector_ordered_storehash )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            ,cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+                ,cc::cuckoo::store_hash< true >
+            >::type
+        > map_type; 
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ));
+        test( m );
+    }
+
+
+//************************************************************
+// refinable set
+
+    TEST_F( CuckooMap, refinable_list_unordered )
+    {
+        struct map_traits: public cc::cuckoo::traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::list probeset_type;
+            typedef cc::cuckoo::refinable<> mutex_policy;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_unordered )
+    {
+        struct map_traits: public cc::cuckoo::traits
+        {
+            typedef cc::cuckoo::refinable<> mutex_policy;
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::vector<4> probeset_type;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m( 32, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_ordered_cmp )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        map_type m( 32, 6, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_ordered_cmp )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 >>
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<8>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( ht );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_ordered_less )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 4, ht );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_ordered_less )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_ordered_cmpmix )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 0, std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_ordered_cmpmix )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+            >::type
+        > map_type;
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ) );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_ordered_stat )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cds::opt::stat< cc::cuckoo::stat >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_ordered_stat )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            , cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cds::opt::stat< cc::cuckoo::stat >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<8>>
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_unordered_storehash )
+    {
+        struct map_traits: public store_hash_traits
+        {
+            typedef cc::cuckoo::refinable<> mutex_policy;
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef base_class::equal_to equal_to;
+            typedef cc::cuckoo::list     probeset_type;
+            typedef cc::cuckoo::stat     stat;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_unordered_storehash )
+    {
+        struct map_traits: public store_hash_traits
+        {
+            typedef cds::opt::hash_tuple< hash1, hash2 > hash;
+            typedef cc::cuckoo::refinable<> mutex_policy;
+            typedef base_class::equal_to    equal_to;
+            typedef cc::cuckoo::stat        stat;
+            typedef cc::cuckoo::vector<4>   probeset_type;
+        };
+        typedef cc::CuckooMap< key_type, value_type, map_traits > map_type;
+
+        map_type m( 32, 4 );
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_list_ordered_storehash )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            ,cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::list >
+                ,cc::cuckoo::store_hash< true >
+            >::type
+        > map_type; 
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( 32, 6, 0, std::move( ht ));
+        test( m );
+    }
+
+    TEST_F( CuckooMap, refinable_vector_ordered_storehash )
+    {
+        typedef cc::CuckooMap< key_type, value_type
+            ,cc::cuckoo::make_traits<
+                cds::opt::hash< std::tuple< hash1, hash2 > >
+                ,cds::opt::mutex_policy< cc::cuckoo::refinable<>>
+                ,cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+                ,cc::cuckoo::probeset_type< cc::cuckoo::vector<6>>
+                ,cc::cuckoo::store_hash< true >
+            >::type
+        > map_type; 
+
+        typename map_type::hash_tuple_type ht;
+        map_type m( std::move( ht ));
+        test( m );
+    }
+
+
+} // namespace
diff --git a/test/unit/striped-map/test_map.h b/test/unit/striped-map/test_map.h
new file mode 100644 (file)
index 0000000..e1e615f
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+    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_STRIPED_MAP_TEST_MAP_H
+#define CDSUNIT_STRIPED_MAP_TEST_MAP_H
+
+#include "test_map_data.h"
+
+// forward declaration
+namespace cds { namespace container {} }
+
+namespace cds_test {
+
+    class striped_map: public striped_map_fixture
+    {
+    public:
+        static size_t const kSize = 1000;
+
+    protected:
+        template <class Map>
+        void test( Map& m )
+        {
+            test_< true >( m );
+        }
+
+        template <bool Sorted, class Map>
+        void test_( Map& m )
+        {
+            // Precondition: map is empty
+            // Postcondition: map is empty
+
+            ASSERT_TRUE( m.empty());
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            typedef typename Map::value_type map_pair;
+            typedef typename std::conditional< Sorted, other_less, other_equal_to >::type other_predicate;
+
+            size_t const kkSize = kSize;
+
+            std::vector<key_type> arrKeys;
+            for ( int i = 0; i < static_cast<int>(kkSize); ++i )
+                arrKeys.push_back( key_type( i ));
+            shuffle( arrKeys.begin(), arrKeys.end());
+
+            std::vector< value_type > arrVals;
+            for ( size_t i = 0; i < kkSize; ++i ) {
+                value_type val;
+                val.nVal = static_cast<int>( i );
+                val.strVal = std::to_string( i );
+                arrVals.push_back( val );
+            }
+
+            // insert/find
+            for ( auto const& i : arrKeys ) {
+                value_type const& val( arrVals.at( i.nKey ));
+
+                ASSERT_FALSE( m.contains( i.nKey ));
+                ASSERT_FALSE( m.contains( i ));
+                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_predicate()));
+                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
+                    ASSERT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_predicate(), []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+
+                std::pair< bool, bool > updResult;
+
+                switch ( i.nKey % 16 ) {
+                case 0:
+                    ASSERT_TRUE( m.insert( i ));
+                    ASSERT_FALSE( m.insert( i ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 1:
+                    ASSERT_TRUE( m.insert( i.nKey ));
+                    ASSERT_FALSE( m.insert( i.nKey ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 2:
+                    ASSERT_TRUE( m.insert( std::to_string( i.nKey )));
+                    ASSERT_FALSE( m.insert( std::to_string( i.nKey )));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 3:
+                    ASSERT_TRUE( m.insert( i, val ));
+                    ASSERT_FALSE( m.insert( i, val ));
+                    break;
+                case 4:
+                    ASSERT_TRUE( m.insert( i.nKey, val.strVal ));
+                    ASSERT_FALSE( m.insert( i.nKey, val.strVal ));
+                    break;
+                case 5:
+                    ASSERT_TRUE( m.insert( val.strVal, i.nKey ));
+                    ASSERT_FALSE( m.insert( val.strVal, i.nKey ));
+                    break;
+                case 6:
+                    ASSERT_TRUE( m.insert_with( i, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( i, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 7:
+                    ASSERT_TRUE( m.insert_with( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( i.nKey, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 8:
+                    ASSERT_TRUE( m.insert_with( val.strVal, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( val.strVal, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 9:
+                    updResult = m.update( i.nKey, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 10:
+                    updResult = m.update( i, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( i, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( i, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 11:
+                    updResult = m.update( val.strVal, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 12:
+                    ASSERT_TRUE( m.emplace( i.nKey ));
+                    ASSERT_FALSE( m.emplace( i.nKey ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 13:
+                    ASSERT_TRUE( m.emplace( i, i.nKey ));
+                    ASSERT_FALSE( m.emplace( i, i.nKey ));
+                    break;
+                case 14:
+                    {
+                        std::string str = val.strVal;
+                        ASSERT_TRUE( m.emplace( i, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                        str = val.strVal;
+                        ASSERT_FALSE( m.emplace( i, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                    }
+                    break;
+                case 15:
+                    {
+                        std::string str = val.strVal;
+                        ASSERT_TRUE( m.emplace( i, i.nKey, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                        str = val.strVal;
+                        ASSERT_FALSE( m.emplace( i, i.nKey, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                    }
+                    break;
+                }
+
+                ASSERT_TRUE( m.contains( i.nKey ));
+                ASSERT_TRUE( m.contains( i ));
+                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_predicate()));
+                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_predicate(), []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+            }
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            shuffle( arrKeys.begin(), arrKeys.end() );
+
+            // erase/find
+            for ( auto const& i : arrKeys ) {
+                value_type const& val( arrVals.at( i.nKey ) );
+
+                ASSERT_TRUE( m.contains( i.nKey ));
+                ASSERT_TRUE( m.contains( val.strVal ) );
+                ASSERT_TRUE( m.contains( i ));
+                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_predicate()));
+                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_predicate(), []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+
+
+                switch ( i.nKey % 8 ) {
+                case 0:
+                    ASSERT_TRUE( m.erase( i ));
+                    ASSERT_FALSE( m.erase( i ));
+                    break;
+                case 1:
+                    ASSERT_TRUE( m.erase( i.nKey ));
+                    ASSERT_FALSE( m.erase( i.nKey ));
+                    break;
+                case 2:
+                    ASSERT_TRUE( m.erase( val.strVal ));
+                    ASSERT_FALSE( m.erase( val.strVal ));
+                    break;
+                case 3:
+                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_predicate()));
+                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_predicate()));
+                    break;
+                case 4:
+                    ASSERT_TRUE( m.erase( i, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( i, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 5:
+                    ASSERT_TRUE( m.erase( i.nKey, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( i.nKey, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 6:
+                    ASSERT_TRUE( m.erase( val.strVal, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( val.strVal, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 7:
+                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_predicate(), []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_predicate(), []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                }
+
+                ASSERT_FALSE( m.contains( i.nKey ));
+                ASSERT_FALSE( m.contains( i ));
+                ASSERT_FALSE( m.contains( val.strVal ));
+                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_predicate()));
+                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
+                    ASSERT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_predicate(), []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+            }
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            // clear
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ));
+
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            m.clear();
+
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_STRIPED_MAP_TEST_MAP_H
diff --git a/test/unit/striped-map/test_map_data.h b/test/unit/striped-map/test_map_data.h
new file mode 100644 (file)
index 0000000..2e1f3ba
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+    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_STRIPED_MAP_TEST_MAP_DATA_H
+#define CDSUNIT_STRIPED_MAP_TEST_MAP_DATA_H
+
+#include <cds_test/check_size.h>
+#include <cds_test/fixture.h>
+
+#include <cds/opt/hash.h>
+
+namespace cds_test {
+
+    class striped_map_fixture: public fixture
+    {
+    public:
+        struct key_type {
+            int nKey;
+
+            explicit key_type( int n )
+                : nKey( n )
+            {}
+
+            explicit key_type( std::string const& str )
+                : nKey( std::stoi( str ))
+            {}
+
+            key_type( key_type const& s )
+                : nKey( s.nKey )
+            {}
+        };
+
+        struct value_type {
+            int nVal;
+            std::string strVal;
+
+            value_type()
+                : nVal( 0 )
+            {}
+
+            explicit value_type( int n )
+                : nVal( n )
+                , strVal( std::to_string( n ))
+            {}
+
+            explicit value_type( std::string const& str )
+                : nVal( std::stoi( str ))
+                , strVal( str )
+            {}
+
+            explicit value_type( std::string&& str )
+                : nVal( std::stoi( str ))
+                , strVal( std::move( str ))
+            {}
+
+            value_type( int n, std::string const& str )
+                : nVal( n )
+                , strVal( str )
+            {}
+
+            value_type( int n, std::string&& str )
+                : nVal( n )
+                , strVal( std::move( str ))
+            {}
+
+            value_type( value_type&& v )
+                : nVal( v.nVal )
+                , strVal( std::move( v.strVal ))
+            {}
+
+            value_type( value_type const& v )
+                : nVal( v.nVal )
+                , strVal( v.strVal )
+            {}
+
+            value_type& operator=( value_type const& v )
+            {
+                if ( this != &v ) {
+                    nVal = v.nVal;
+                    strVal = v.strVal;
+                }
+                return *this;
+            }
+
+            value_type& operator=( value_type&& v )
+            {
+                if ( this != &v ) {
+                    nVal = v.nVal;
+                    strVal = std::move( v.strVal );
+                }
+                return *this;
+            }
+
+            value_type& operator=( int i )
+            {
+                nVal = i;
+                strVal = std::to_string( i );
+                return *this;
+            }
+
+            value_type& operator=( std::string const& s )
+            {
+                nVal = std::stoi( s );
+                strVal = s;
+                return *this;
+            }
+        };
+
+        typedef std::pair<key_type const, value_type> pair_type;
+
+        struct less
+        {
+            bool operator ()( key_type const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, int v2 ) const
+            {
+                return v1.nKey < v2;
+            }
+
+            bool operator ()( int v1, key_type const& v2 ) const
+            {
+                return v1 < v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, std::string const& v2 ) const
+            {
+                return v1.nKey < std::stoi(v2 );
+            }
+
+            bool operator ()( std::string const& v1, key_type const& v2 ) const
+            {
+                return std::stoi( v1 ) < v2.nKey;
+            }
+        };
+
+        struct cmp {
+            int operator ()( key_type const& v1, key_type const& v2 ) const
+            {
+                if ( v1.nKey < v2.nKey )
+                    return -1;
+                return v1.nKey > v2.nKey ? 1 : 0;
+            }
+
+            int operator ()( key_type const& v1, int v2 ) const
+            {
+                if ( v1.nKey < v2 )
+                    return -1;
+                return v1.nKey > v2 ? 1 : 0;
+            }
+
+            int operator ()( int v1, key_type const& v2 ) const
+            {
+                if ( v1 < v2.nKey )
+                    return -1;
+                return v1 > v2.nKey ? 1 : 0;
+            }
+
+            int operator ()( key_type const& v1, std::string const& v2 ) const
+            {
+                int n2 = std::stoi( v2 );
+                if ( v1.nKey < n2 )
+                    return -1;
+                return v1.nKey > n2 ? 1 : 0;
+            }
+
+            int operator ()( std::string const& v1, key_type const& v2 ) const
+            {
+                int n1 = std::stoi( v1 );
+                if ( n1 < v2.nKey )
+                    return -1;
+                return n1 > v2.nKey ? 1 : 0;
+            }
+        };
+
+        struct equal_to
+        {
+            bool operator ()( key_type const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey == v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, int v2 ) const
+            {
+                return v1.nKey == v2;
+            }
+
+            bool operator ()( int v1, key_type const& v2 ) const
+            {
+                return v1 == v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, std::string const& v2 ) const
+            {
+                return v1.nKey == std::stoi( v2 );
+            }
+
+            bool operator ()( std::string const& v1, key_type const& v2 ) const
+            {
+                return std::stoi( v1 ) == v2.nKey;
+            }
+        };
+
+        struct hash1 {
+            size_t operator()( int i ) const
+            {
+                return cds::opt::v::hash<int>()( i );
+            }
+
+            size_t operator()( std::string const& str ) const
+            {
+                return cds::opt::v::hash<int>()( std::stoi( str ));
+            }
+
+            template <typename T>
+            size_t operator()( T const& i ) const
+            {
+                return cds::opt::v::hash<int>()(i.nKey);
+            }
+        };
+
+        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);
+            }
+            template <typename Item>
+            size_t operator()( const Item& i ) const
+            {
+                size_t h = ~(base_class::operator()( i ));
+                return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
+            }
+        };
+
+        struct other_item {
+            int nKey;
+
+            other_item( int key )
+                : nKey( key )
+            {}
+        };
+
+        struct other_less
+        {
+            bool operator ()( key_type const& v1, other_item const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+            bool operator ()( other_item const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+        };
+
+        struct other_equal_to
+        {
+            bool operator ()( key_type const& v1, other_item const& v2 ) const
+            {
+                return v1.nKey == v2.nKey;
+            }
+            bool operator ()( other_item const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey == v2.nKey;
+            }
+        };
+    };
+} // namespace cds_test
+
+#endif // CDSUNIT_STRIPED_MAP_TEST_MAP_DATA_H