Moved queue unit test to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Thu, 21 Jan 2016 06:35:13 +0000 (09:35 +0300)
committerkhizmax <libcds.dev@gmail.com>
Thu, 21 Jan 2016 06:35:13 +0000 (09:35 +0300)
21 files changed:
projects/Win/vc14/cds.sln
projects/Win/vc14/gtest-deque.vcxproj
projects/Win/vc14/gtest-pqueue.vcxproj
projects/Win/vc14/gtest-queue.vcxproj [new file with mode: 0644]
projects/Win/vc14/gtest-queue.vcxproj.filters [new file with mode: 0644]
projects/Win/vc14/hdr-test-queue.vcxproj
projects/Win/vc14/hdr-test-queue.vcxproj.filters
test/include/cds_test/check_size.h [new file with mode: 0644]
test/unit/CMakeLists.txt
test/unit/queue/CMakeLists.txt [new file with mode: 0644]
test/unit/queue/basket_queue_dhp.cpp [new file with mode: 0644]
test/unit/queue/basket_queue_hp.cpp [new file with mode: 0644]
test/unit/queue/fcqueue.cpp [new file with mode: 0644]
test/unit/queue/moirqueue_dhp.cpp [new file with mode: 0644]
test/unit/queue/moirqueue_hp.cpp [new file with mode: 0644]
test/unit/queue/msqueue_dhp.cpp [new file with mode: 0644]
test/unit/queue/msqueue_hp.cpp [new file with mode: 0644]
test/unit/queue/optimistic_queue_dhp.cpp [new file with mode: 0644]
test/unit/queue/optimistic_queue_hp.cpp [new file with mode: 0644]
test/unit/queue/rwqueue.cpp [new file with mode: 0644]
test/unit/queue/test_generic_queue.h [new file with mode: 0644]

index f827d9a..b400e54 100644 (file)
@@ -184,18 +184,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-stack", "gtest-stack.
                {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
        EndProjectSection\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-pqueue", "gtest-pqueue.vcxproj", "{EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
-       EndProjectSection\r
-EndProject\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cds_test", "cds_test", "{3A510E45-180B-4ADC-AFCD-D75774B68580}"\r
        ProjectSection(SolutionItems) = preProject\r
+               ..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h\r
                ..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h\r
                ..\..\..\test\include\cds_test\thread.h = ..\..\..\test\include\cds_test\thread.h\r
        EndProjectSection\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-deque", "gtest-deque.vcxproj", "{20A9F084-D01F-47E5-B775-4F4B48504FCC}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-deque", "gtest-deque.vcxproj", "{EA5D825A-83A4-4A36-83C1-3D048D21D55B}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-pqueue", "gtest-pqueue.vcxproj", "{ED94B1D1-2442-43C2-A71C-A757122408A6}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-queue", "gtest-queue.vcxproj", "{9EB8FAB6-78E8-48B6-9589-85985CE8D33D}"\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
@@ -471,30 +471,42 @@ Global
                {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Release|Win32.Build.0 = Release|Win32\r
                {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Release|x64.ActiveCfg = Release|x64\r
                {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Release|x64.Build.0 = Release|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Debug|Win32.ActiveCfg = Debug|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Debug|Win32.Build.0 = Debug|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Debug|x64.ActiveCfg = Debug|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Debug|x64.Build.0 = Debug|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Release|Win32.ActiveCfg = Release|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Release|Win32.Build.0 = Release|Win32\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Release|x64.ActiveCfg = Release|x64\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}.Release|x64.Build.0 = Release|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Debug|Win32.ActiveCfg = Debug|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Debug|Win32.Build.0 = Debug|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Debug|x64.ActiveCfg = Debug|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Debug|x64.Build.0 = Debug|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Release|Win32.ActiveCfg = Release|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Release|Win32.Build.0 = Release|Win32\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Release|x64.ActiveCfg = Release|x64\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC}.Release|x64.Build.0 = Release|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Debug|x64.ActiveCfg = Debug|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Debug|x64.Build.0 = Debug|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Release|Win32.ActiveCfg = Release|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Release|Win32.Build.0 = Release|Win32\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Release|x64.ActiveCfg = Release|x64\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B}.Release|x64.Build.0 = Release|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Debug|Win32.Build.0 = Debug|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Debug|x64.ActiveCfg = Debug|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Debug|x64.Build.0 = Debug|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Release|Win32.ActiveCfg = Release|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Release|Win32.Build.0 = Release|Win32\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Release|x64.ActiveCfg = Release|x64\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6}.Release|x64.Build.0 = Release|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Debug|Win32.Build.0 = Debug|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Debug|x64.ActiveCfg = Debug|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Debug|x64.Build.0 = Debug|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Release|Win32.ActiveCfg = Release|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Release|Win32.Build.0 = Release|Win32\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Release|x64.ActiveCfg = Release|x64\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D}.Release|x64.Build.0 = Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -523,8 +535,9 @@ Global
                {CA6F0834-0628-4CD7-8800-AEABCD636360} = {6BB7A27F-FC59-4267-B6FA-D034176D1459}\r
                {DE256E91-EE96-412E-82EE-DD7BD1A1130D} = {A64449B7-90FB-4E2B-A686-9EFC0E298644}\r
                {5407E9D2-67D9-4266-976E-7A90BDE2541D} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
-               {EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
-               {20A9F084-D01F-47E5-B775-4F4B48504FCC} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
+               {EA5D825A-83A4-4A36-83C1-3D048D21D55B} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
+               {ED94B1D1-2442-43C2-A71C-A757122408A6} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
+               {9EB8FAB6-78E8-48B6-9589-85985CE8D33D} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
        EndGlobalSection\r
        GlobalSection(DPCodeReviewSolutionGUID) = preSolution\r
                DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\r
index 2aaeadb..7861f82 100644 (file)
@@ -31,7 +31,7 @@
     <ClCompile Include="..\..\..\test\unit\main.cpp" />\r
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
-    <ProjectGuid>{20A9F084-D01F-47E5-B775-4F4B48504FCC}</ProjectGuid>\r
+    <ProjectGuid>{EA5D825A-83A4-4A36-83C1-3D048D21D55B}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
     <RootNamespace>stack</RootNamespace>\r
     <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
index 1348a78..cb3ddb6 100644 (file)
@@ -39,7 +39,7 @@
     <ClInclude Include="..\..\..\test\unit\pqueue\test_fcpqueue.h" />\r
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
-    <ProjectGuid>{EAD522BF-E7DA-4A20-94FF-4D3EAF0A540A}</ProjectGuid>\r
+    <ProjectGuid>{ED94B1D1-2442-43C2-A71C-A757122408A6}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
     <RootNamespace>stack</RootNamespace>\r
     <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
diff --git a/projects/Win/vc14/gtest-queue.vcxproj b/projects/Win/vc14/gtest-queue.vcxproj
new file mode 100644 (file)
index 0000000..f4d2a7f
--- /dev/null
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="DebugVLD|Win32">\r
+      <Configuration>DebugVLD</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="DebugVLD|x64">\r
+      <Configuration>DebugVLD</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\..\test\unit\main.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\basket_queue_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\basket_queue_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\fcqueue.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\moirqueue_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\moirqueue_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\msqueue_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\msqueue_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\optimistic_queue_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\optimistic_queue_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\queue\rwqueue.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\..\test\unit\queue\test_generic_queue.h" />\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{9EB8FAB6-78E8-48B6-9589-85985CE8D33D}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <RootNamespace>stack</RootNamespace>\r
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Label="Shared">\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+    <TargetName>$(ProjectName)_d</TargetName>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+    <TargetName>$(ProjectName)_d</TargetName>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+    <TargetName>$(ProjectName)_d</TargetName>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+    <TargetName>$(ProjectName)_d</TargetName>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
+    <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/projects/Win/vc14/gtest-queue.vcxproj.filters b/projects/Win/vc14/gtest-queue.vcxproj.filters
new file mode 100644 (file)
index 0000000..b766f09
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\..\test\unit\main.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\fcqueue.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\msqueue_hp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\msqueue_dhp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\moirqueue_hp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\moirqueue_dhp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\basket_queue_hp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\basket_queue_dhp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\optimistic_queue_hp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\optimistic_queue_dhp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\queue\rwqueue.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\..\test\unit\queue\test_generic_queue.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 7f3741b..b604c0b 100644 (file)
   <ItemGroup>\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_basketqueue_dhp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_basketqueue_hp.cpp" />\r
-    <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_fcqueue.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_basketqueue_dhp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_fcqueue.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_basketqueue_hp.cpp" />\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_vyukov_mpmc_cyclic.cpp" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_fcqueue.h" />\r
     <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_msqueue.h" />\r
     <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_segmented_queue.h" />\r
     <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue.h" />\r
index d75ac5e..c99471b 100644 (file)
@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>\r
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup>\r
-    <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_fcqueue.cpp">\r
-      <Filter>container</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_basketqueue_hp.cpp">\r
       <Filter>intrusive</Filter>\r
     </ClCompile>\r
@@ -94,9 +91,6 @@
     <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_segmented_queue.h">\r
       <Filter>container</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_fcqueue.h">\r
-      <Filter>container</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue.h">\r
       <Filter>container</Filter>\r
     </ClInclude>\r
diff --git a/test/include/cds_test/check_size.h b/test/include/cds_test/check_size.h
new file mode 100644 (file)
index 0000000..34a3b99
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#ifndef CDSTEST_CHECK_SIZE_H
+#define CDSTEST_CHECK_SIZE_H
+
+#include <gtest/gtest.h>
+#include <cds/algo/atomic.h>
+
+namespace cds_test {
+
+    template <typename ItemCounter>
+    struct size_checker {
+        template <typename Container>
+        bool operator()( Container const& c, size_t nSize ) const
+        {
+            return c.size() == nSize;
+        }
+    };
+
+    template<>
+    struct size_checker< cds::atomicity::empty_item_counter > {
+        template <typename Container>
+        bool operator()( Container const& /*c*/, size_t /*nSize*/ ) const
+        {
+            return true;
+        }
+    };
+
+    template <class Container>
+    static inline bool check_size( Container const& cont, size_t nSize )
+    {
+        return size_checker<typename Container::item_counter>()( cont, nSize );
+    }
+
+} // namespace cds_test
+
+#define ASSERT_CONTAINER_SIZE( container, expected ) \
+    ASSERT_TRUE( cds_test::check_size(container, expected)) << "container size=" << container.size() << ", expected=" << expected
+
+#define EXPECT_CONTAINER_SIZE( container, expected ) \
+    EXPECT_TRUE( cds_test::check_size(container, expected)) << "container size=" << container.size() << ", expected=" << expected
+
+#endif // #ifndef CDSTEST_CHECK_SIZE_H
index 8fe813b..236e738 100644 (file)
@@ -1,3 +1,4 @@
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deque)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pqueue)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/queue)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/stack)
diff --git a/test/unit/queue/CMakeLists.txt b/test/unit/queue/CMakeLists.txt
new file mode 100644 (file)
index 0000000..947edc3
--- /dev/null
@@ -0,0 +1,30 @@
+set(PACKAGE_NAME unit-queue)
+
+set(CDSGTEST_QUEUE_SOURCES
+    ../main.cpp
+    basket_queue_hp.cpp
+    basket_queue_dhp.cpp
+    fcqueue.cpp
+    moirqueue_hp.cpp
+    moirqueue_dhp.cpp
+    msqueue_hp.cpp
+    msqueue_dhp.cpp
+    optimistic_queue_hp.cpp
+    optimistic_queue_dhp.cpp
+    rwqueue.cpp
+)
+
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_executable(${PACKAGE_NAME} ${CDSGTEST_QUEUE_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/queue/basket_queue_dhp.cpp b/test/unit/queue/basket_queue_dhp.cpp
new file mode 100644 (file)
index 0000000..e08838d
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/container/basket_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+
+    class BasketQueue_DHP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::BasketQueue< gc_type, int > queue_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, queue_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( BasketQueue_DHP, defaulted )
+    {
+        typedef cds::container::BasketQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( BasketQueue_DHP, item_counting )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_DHP, relaxed )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_DHP, aligned )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_DHP, seq_cst )
+    {
+        struct traits : public cc::basket_queue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::BasketQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_DHP, move )
+    {
+        typedef cds::container::BasketQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( BasketQueue_DHP, move_item_counting )
+    {
+        struct traits : public cc::basket_queue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::BasketQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/basket_queue_hp.cpp b/test/unit/queue/basket_queue_hp.cpp
new file mode 100644 (file)
index 0000000..7587bc7
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/hp.h>
+#include <cds/container/basket_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+
+    class BasketQueue_HP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::BasketQueue< gc_type, int > queue_type;
+
+            cds::gc::hp::GarbageCollector::Construct( queue_type::c_nHazardPtrCount, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+    TEST_F( BasketQueue_HP, defaulted )
+    {
+        typedef cds::container::BasketQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( BasketQueue_HP, item_counting )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_HP, relaxed )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_HP, aligned )
+    {
+        typedef cds::container::BasketQueue < gc_type, int,
+            typename cds::container::basket_queue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_HP, seq_cst )
+    {
+        struct traits : public cc::basket_queue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::BasketQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( BasketQueue_HP, move )
+    {
+        typedef cds::container::BasketQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( BasketQueue_HP, move_item_counting )
+    {
+        struct traits : public cc::basket_queue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::BasketQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/fcqueue.cpp b/test/unit/queue/fcqueue.cpp
new file mode 100644 (file)
index 0000000..7681dde
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+    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 <gtest/gtest.h>
+#include <cds/container/fcqueue.h>
+
+#include <list>
+
+namespace {
+
+    class FCQueue: public ::testing::Test
+    {
+    protected:
+        template <class Queue>
+        void test( Queue& q )
+        {
+            typedef typename Queue::value_type value_type;
+            value_type it;
+
+            const size_t nSize = 100;
+
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+
+            // enqueue/dequeue
+            for ( size_t i = 0; i < nSize; ++i ) {
+                ASSERT_TRUE( q.enqueue( static_cast<value_type>(i)));
+                ASSERT_EQ( q.size(), i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_EQ( q.size(), nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = -1;
+                ASSERT_TRUE( q.dequeue( it ));
+                ASSERT_EQ( it, i );
+                ASSERT_EQ( q.size(), nSize - i - 1 );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+
+            // push/pop
+            for ( size_t i = 0; i < nSize; ++i ) {
+                ASSERT_TRUE( q.push( static_cast<value_type>(i)));
+                ASSERT_EQ( q.size(), i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_EQ( q.size(), nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = -1;
+                ASSERT_TRUE( q.pop( it ) );
+                ASSERT_EQ( it, i );
+                ASSERT_EQ( q.size(), nSize - i - 1 );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+
+            // clear
+            for ( size_t i = 0; i < nSize; ++i ) {
+                ASSERT_TRUE( q.push( static_cast<value_type>( i )));
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_EQ( q.size(), nSize );
+
+            q.clear();
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+
+            // pop from empty queue
+            it = nSize * 2;
+            ASSERT_FALSE( q.pop( it ));
+            ASSERT_EQ( it, nSize * 2 );
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+
+            ASSERT_FALSE( q.dequeue( it ) );
+            ASSERT_EQ( it, nSize * 2 );
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+        }
+
+        template <class Queue>
+        void test_string( Queue& q )
+        {
+            std::string str[3];
+            str[0] = "one";
+            str[1] = "two";
+            str[2] = "three";
+            const size_t nSize = sizeof( str ) / sizeof( str[0] );
+
+            // move push
+            for ( size_t i = 0; i < nSize; ++i ) {
+                std::string s = str[i];
+                ASSERT_FALSE( s.empty());
+                ASSERT_TRUE( q.enqueue( std::move( s )));
+                ASSERT_FALSE( s.empty());
+                ASSERT_EQ( q.size(), i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_EQ( q.size(), nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                std::string s;
+                ASSERT_TRUE( q.pop( s ));
+                ASSERT_EQ( q.size(), nSize - i - 1 );
+                ASSERT_EQ( s, str[i] );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_EQ( q.size(), 0 );
+        }
+    };
+
+    TEST_F( FCQueue, std_deque )
+    {
+        typedef cds::container::FCQueue<int> queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+    TEST_F( FCQueue, std_deque_move )
+    {
+        typedef cds::container::FCQueue<std::string> queue_type;
+
+        queue_type q;
+        test_string( q );
+    }
+
+    TEST_F( FCQueue, std_deque_elimination )
+    {
+        typedef cds::container::FCQueue<int, std::queue< int, std::deque<int>>,
+            cds::container::fcqueue::make_traits<
+                cds::opt::enable_elimination< true >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+    TEST_F( FCQueue, std_deque_elimination_move )
+    {
+        typedef cds::container::FCQueue<std::string, std::queue< std::string, std::deque<std::string>>,
+            cds::container::fcqueue::make_traits<
+                cds::opt::enable_elimination< true >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test_string( q );
+    }
+
+    TEST_F( FCQueue, std_deque_mutex )
+    {
+        typedef cds::container::FCQueue<int, std::queue< int, std::deque<int>>,
+            cds::container::fcqueue::make_traits<
+                cds::opt::lock_type< std::mutex >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+    TEST_F( FCQueue, std_list )
+    {
+        typedef cds::container::FCQueue<int, std::queue< int, std::list<int>>> queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+    TEST_F( FCQueue, std_list_move )
+    {
+        typedef cds::container::FCQueue<std::string, std::queue< std::string, std::list<std::string>>> queue_type;
+
+        queue_type q;
+        test_string( q );
+    }
+
+    TEST_F( FCQueue, std_list_elimination )
+    {
+        typedef cds::container::FCQueue<int, std::queue< int, std::list<int> >,
+            cds::container::fcqueue::make_traits<
+                cds::opt::enable_elimination< true >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+    TEST_F( FCQueue, std_list_elimination_move )
+    {
+        typedef cds::container::FCQueue<std::string, std::queue< std::string, std::list<std::string> >,
+            cds::container::fcqueue::make_traits<
+            cds::opt::enable_elimination< true >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test_string( q );
+    }
+
+    TEST_F( FCQueue, std_list_mutex )
+    {
+        typedef cds::container::FCQueue<int, std::queue<int, std::list<int> >,
+            cds::container::fcqueue::make_traits<
+                cds::opt::lock_type< std::mutex >
+            >::type
+        > queue_type;
+
+        queue_type q;
+        test( q );
+    }
+
+} // namespace
diff --git a/test/unit/queue/moirqueue_dhp.cpp b/test/unit/queue/moirqueue_dhp.cpp
new file mode 100644 (file)
index 0000000..e9c5b29
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/container/moir_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+
+    class MoirQueue_DHP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::MoirQueue< gc_type, int > queue_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, queue_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( MoirQueue_DHP, defaulted )
+    {
+        typedef cds::container::MoirQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( MoirQueue_DHP, item_counting )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_DHP, relaxed )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_DHP, aligned )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_DHP, seq_cst )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::MoirQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_DHP, move )
+    {
+        typedef cds::container::MoirQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( MoirQueue_DHP, move_item_counting )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::MoirQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/moirqueue_hp.cpp b/test/unit/queue/moirqueue_hp.cpp
new file mode 100644 (file)
index 0000000..3d29c36
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/hp.h>
+#include <cds/container/moir_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+
+    class MoirQueue_HP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::MoirQueue< gc_type, int > queue_type;
+
+            cds::gc::hp::GarbageCollector::Construct( queue_type::c_nHazardPtrCount, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+    TEST_F( MoirQueue_HP, defaulted )
+    {
+        typedef cds::container::MoirQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( MoirQueue_HP, item_counting )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_HP, relaxed )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_HP, aligned )
+    {
+        typedef cds::container::MoirQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_HP, seq_cst )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::MoirQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MoirQueue_HP, move )
+    {
+        typedef cds::container::MoirQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( MoirQueue_HP, move_item_counting )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::MoirQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/msqueue_dhp.cpp b/test/unit/queue/msqueue_dhp.cpp
new file mode 100644 (file)
index 0000000..88e4e57
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/container/msqueue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+
+    class MSQueue_DHP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::MSQueue< gc_type, int > queue_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, queue_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( MSQueue_DHP, defaulted )
+    {
+        typedef cds::container::MSQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( MSQueue_DHP, item_counting )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_DHP, relaxed )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_DHP, aligned )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_DHP, seq_cst )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::MSQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_DHP, move )
+    {
+        typedef cds::container::MSQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( MSQueue_DHP, move_item_counting )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::MSQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/msqueue_hp.cpp b/test/unit/queue/msqueue_hp.cpp
new file mode 100644 (file)
index 0000000..9c8f0dd
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/hp.h>
+#include <cds/container/msqueue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+
+    class MSQueue_HP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::MSQueue< gc_type, int > queue_type;
+
+            cds::gc::hp::GarbageCollector::Construct( queue_type::c_nHazardPtrCount, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+    TEST_F( MSQueue_HP, defaulted )
+    {
+        typedef cds::container::MSQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( MSQueue_HP, item_counting )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_HP, relaxed )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_HP, aligned )
+    {
+        typedef cds::container::MSQueue < gc_type, int,
+            typename cds::container::msqueue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_HP, seq_cst )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::MSQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( MSQueue_HP, move )
+    {
+        typedef cds::container::MSQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( MSQueue_HP, move_item_counting )
+    {
+        struct traits : public cc::msqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::MSQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/optimistic_queue_dhp.cpp b/test/unit/queue/optimistic_queue_dhp.cpp
new file mode 100644 (file)
index 0000000..eb35997
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/dhp.h>
+#include <cds/container/optimistic_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+
+    class OptimisticQueue_DHP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::OptimisticQueue< gc_type, int > queue_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, queue_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( OptimisticQueue_DHP, defaulted )
+    {
+        typedef cds::container::OptimisticQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( OptimisticQueue_DHP, item_counting )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OptimisticQueue_DHP, relaxed )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OptimisticQueue_DHP, aligned )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OptimisticQueue_DHP, seq_cst )
+    {
+        struct traits : public cc::optimistic_queue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::OptimisticQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OptimisticQueue_DHP, move )
+    {
+        typedef cds::container::OptimisticQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( OptimisticQueue_DHP, move_item_counting )
+    {
+        struct traits : public cc::optimistic_queue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::OptimisticQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/optimistic_queue_hp.cpp b/test/unit/queue/optimistic_queue_hp.cpp
new file mode 100644 (file)
index 0000000..7ab2de2
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/gc/hp.h>
+#include <cds/container/optimistic_queue.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+
+    class OPtimisticQueue_HP : public cds_test::generic_queue
+    {
+    protected:
+        void SetUp()
+        {
+            typedef cc::OptimisticQueue< gc_type, int > queue_type;
+
+            cds::gc::hp::GarbageCollector::Construct( queue_type::c_nHazardPtrCount, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+    TEST_F( OPtimisticQueue_HP, defaulted )
+    {
+        typedef cds::container::OptimisticQueue< gc_type, int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( OPtimisticQueue_HP, item_counting )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::item_counter < cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OPtimisticQueue_HP, relaxed )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+                , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OPtimisticQueue_HP, aligned )
+    {
+        typedef cds::container::OptimisticQueue < gc_type, int,
+            typename cds::container::optimistic_queue::make_traits <
+                cds::opt::memory_model< cds::opt::v::relaxed_ordering>
+                , cds::opt::padding < 32 >
+            >::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OPtimisticQueue_HP, seq_cst )
+    {
+        struct traits : public cc::optimistic_queue::traits
+        {
+            typedef cds::opt::v::sequential_consistent memory_model;
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::OptimisticQueue < gc_type, int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( OPtimisticQueue_HP, move )
+    {
+        typedef cds::container::OptimisticQueue< gc_type, std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( OPtimisticQueue_HP, move_item_counting )
+    {
+        struct traits : public cc::optimistic_queue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::OptimisticQueue< gc_type, std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/rwqueue.cpp b/test/unit/queue/rwqueue.cpp
new file mode 100644 (file)
index 0000000..25ddfcb
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+    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_generic_queue.h"
+
+#include <cds/container/rwqueue.h>
+
+namespace {
+    namespace cc = cds::container;
+
+    class RWQueue: public cds_test::generic_queue
+    {};
+
+    TEST_F( RWQueue, defaulted )
+    {
+        typedef cds::container::RWQueue< int > test_queue;
+
+        test_queue q;
+        test(q);
+    }
+
+    TEST_F( RWQueue, item_counting )
+    {
+        typedef cds::container::RWQueue< int,
+            typename cds::container::rwqueue::make_traits <
+                cds::opt::item_counter< cds::atomicity::item_counter >
+            > ::type
+        > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( RWQueue, mutex )
+    {
+        struct traits : public cds::container::rwqueue::traits
+        {
+            typedef std::mutex lock_type;
+        };
+        typedef cds::container::RWQueue< int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( RWQueue, padding )
+    {
+        struct traits : public cds::container::rwqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+            enum { padding = 64 };
+        };
+        typedef cds::container::RWQueue< int, traits > test_queue;
+
+        test_queue q;
+        test( q );
+    }
+
+    TEST_F( RWQueue, move )
+    {
+        typedef cds::container::RWQueue< std::string > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+    TEST_F( RWQueue, move_item_counting )
+    {
+        struct traits : public cc::rwqueue::traits
+        {
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cds::container::RWQueue< std::string, traits > test_queue;
+
+        test_queue q;
+        test_string( q );
+    }
+
+} // namespace
+
diff --git a/test/unit/queue/test_generic_queue.h b/test/unit/queue/test_generic_queue.h
new file mode 100644 (file)
index 0000000..28554f0
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+    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_QUEUE_TEST_GENERIC_QUEUE_H
+#define CDSUNIT_QUEUE_TEST_GENERIC_QUEUE_H
+
+#include <cds_test/check_size.h>
+\r
+namespace cds_test {\r
+\r
+    class generic_queue : public ::testing::Test\r
+    {\r
+    protected:\r
+        template <typename Queue>\r
+        void test( Queue& q )\r
+        {\r
+            typedef typename Queue::value_type value_type;
+            value_type it;
+
+            const size_t nSize = 100;
+
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            // enqueue/dequeue
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = static_cast<value_type>(i);
+                ASSERT_TRUE( q.enqueue( it ));
+                ASSERT_CONTAINER_SIZE( q, i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = -1;
+                ASSERT_TRUE( q.dequeue( it ) );
+                ASSERT_EQ( it, i );
+                ASSERT_CONTAINER_SIZE( q, nSize - i - 1 );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            // push/pop
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = static_cast<value_type>(i);
+                ASSERT_TRUE( q.push( it ));
+                ASSERT_CONTAINER_SIZE( q, i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = -1;
+                ASSERT_TRUE( q.pop( it ) );
+                ASSERT_EQ( it, i );
+                ASSERT_CONTAINER_SIZE( q, nSize - i - 1 );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            // push/pop with lambda
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = static_cast<value_type>(i);
+                ASSERT_NE( it, -1 );
+                auto f = [&it]( value_type& dest ) { dest = it; it = -1; };
+                if ( i & 1 )
+                    ASSERT_TRUE( q.enqueue_with( f ));
+                else
+                    ASSERT_TRUE( q.push_with( f ));
+                ASSERT_EQ( it, -1 );
+                ASSERT_CONTAINER_SIZE( q, i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                it = -1;
+                auto f = [&it]( value_type& src ) { it = src; src = -1; };
+                if ( i & 1 )
+                    ASSERT_TRUE( q.pop_with( f ));
+                else
+                    ASSERT_TRUE( q.dequeue_with( f ));
+                ASSERT_EQ( it, i );
+                ASSERT_CONTAINER_SIZE( q, nSize - i - 1 );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            // clear
+            for ( size_t i = 0; i < nSize; ++i ) {
+                ASSERT_TRUE( q.push( static_cast<value_type>(i) ) );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            q.clear();
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            // pop from empty queue
+            it = nSize * 2;
+            ASSERT_FALSE( q.pop( it ) );
+            ASSERT_EQ( it, nSize * 2 );
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+            ASSERT_FALSE( q.dequeue( it ) );
+            ASSERT_EQ( it, nSize * 2 );
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+        }\r
+\r
+        template <class Queue>
+        void test_string( Queue& q )
+        {
+            std::string str[3];
+            str[0] = "one";
+            str[1] = "two";
+            str[2] = "three";
+            const size_t nSize = sizeof( str ) / sizeof( str[0] );
+
+            // emplace
+            for ( size_t i = 0; i < nSize; ++i ) {
+                ASSERT_TRUE( q.emplace( str[i].c_str()));
+                ASSERT_CONTAINER_SIZE( q, i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            {
+                std::string s;
+                auto f = [&s]( std::string& src ) {
+                    ASSERT_FALSE( src.empty() );
+                    s = std::move( src );
+                    ASSERT_TRUE( src.empty() );
+                };
+                for ( size_t i = 0; i < nSize; ++i ) {
+                    if ( i & 1 )
+                        ASSERT_TRUE( q.pop_with( f ));
+                    else
+                        ASSERT_TRUE( q.dequeue_with( f ));
+
+                    ASSERT_CONTAINER_SIZE( q, nSize - i - 1 );
+                    ASSERT_EQ( s, str[i] );
+                }
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+
+
+            // move push
+            for ( size_t i = 0; i < nSize; ++i ) {
+                std::string s = str[i];
+                ASSERT_FALSE( s.empty() );
+                if ( i & 1 )
+                    ASSERT_TRUE( q.enqueue( std::move( s )));
+                else
+                    ASSERT_TRUE( q.push( std::move( s )));
+                ASSERT_TRUE( s.empty() );
+                ASSERT_CONTAINER_SIZE( q, i + 1 );
+            }
+            ASSERT_FALSE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, nSize );
+
+            for ( size_t i = 0; i < nSize; ++i ) {
+                std::string s;
+                ASSERT_TRUE( q.pop( s ) );
+                ASSERT_CONTAINER_SIZE( q, nSize - i - 1 );
+                ASSERT_EQ( s, str[i] );
+            }
+            ASSERT_TRUE( q.empty() );
+            ASSERT_CONTAINER_SIZE( q, 0 );
+        }
+\r
+    };\r
+\r
+} // namespace cds_test\r
+\r
+#endif // CDSUNIT_QUEUE_TEST_GENERIC_QUEUE_H\r