From: khizmax Date: Sat, 20 Feb 2016 19:30:22 +0000 (+0300) Subject: Moved list unit test to gtest framework X-Git-Tag: v2.2.0~385 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7935997eec489b20a72c5ce7df27c17b9a23ed56;p=libcds.git Moved list unit test to gtest framework --- diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index 9ea88592..deee3873 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -58,12 +58,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-misc", "hdr-test-m {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-list", "hdr-test-list.vcxproj", "{EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}" - ProjectSection(ProjectDependencies) = postProject - {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} - {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "map", "map", "{6BB7A27F-FC59-4267-B6FA-D034176D1459}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\unit\map2\map_defs.h = ..\..\..\tests\unit\map2\map_defs.h @@ -287,18 +281,6 @@ Global {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Release|Win32.Build.0 = Release|Win32 {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Release|x64.ActiveCfg = Release|x64 {C5E76975-B87B-4B9E-8596-B01DDA683FCA}.Release|x64.Build.0 = Release|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Debug|Win32.ActiveCfg = Debug|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Debug|Win32.Build.0 = Debug|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Debug|x64.ActiveCfg = Debug|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Debug|x64.Build.0 = Debug|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Release|Win32.ActiveCfg = Release|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Release|Win32.Build.0 = Release|Win32 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Release|x64.ActiveCfg = Release|x64 - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}.Release|x64.Build.0 = Release|x64 {3C598F96-FB84-4D42-9B43-F697F53B0221}.Debug|Win32.ActiveCfg = Debug|Win32 {3C598F96-FB84-4D42-9B43-F697F53B0221}.Debug|Win32.Build.0 = Debug|Win32 {3C598F96-FB84-4D42-9B43-F697F53B0221}.Debug|x64.ActiveCfg = Debug|x64 @@ -514,7 +496,6 @@ Global {E29DE1F7-AE8D-4AE6-98B1-147E5103D974} = {B30CA283-1796-4763-92C3-2E4848D443F7} {282E9A9A-386A-40FB-A483-994BACE24830} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75} {C5E76975-B87B-4B9E-8596-B01DDA683FCA} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75} - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75} {6BB7A27F-FC59-4267-B6FA-D034176D1459} = {B30CA283-1796-4763-92C3-2E4848D443F7} {A64449B7-90FB-4E2B-A686-9EFC0E298644} = {B30CA283-1796-4763-92C3-2E4848D443F7} {3C598F96-FB84-4D42-9B43-F697F53B0221} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} diff --git a/projects/Win/vc14/gtest-list.vcxproj b/projects/Win/vc14/gtest-list.vcxproj index 823283a2..65be8bb1 100644 --- a/projects/Win/vc14/gtest-list.vcxproj +++ b/projects/Win/vc14/gtest-list.vcxproj @@ -33,9 +33,12 @@ + + + @@ -91,9 +94,40 @@ + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + diff --git a/projects/Win/vc14/gtest-list.vcxproj.filters b/projects/Win/vc14/gtest-list.vcxproj.filters index 95727c60..2fe3b715 100644 --- a/projects/Win/vc14/gtest-list.vcxproj.filters +++ b/projects/Win/vc14/gtest-list.vcxproj.filters @@ -60,6 +60,15 @@ Header Files + + Header Files + + + Header Files + + + Header Files + @@ -179,5 +188,35 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + \ No newline at end of file diff --git a/projects/Win/vc14/hdr-test-list.vcxproj b/projects/Win/vc14/hdr-test-list.vcxproj deleted file mode 100644 index 621a7379..00000000 --- a/projects/Win/vc14/hdr-test-list.vcxproj +++ /dev/null @@ -1,397 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805} - hdrtestordlist - Win32Proj - hdr-test-list - 8.1 - - - - Application - MultiByte - v140 - - - Application - MultiByte - true - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - true - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX64 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Full - AnySuitable - true - Speed - false - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - MultiThreadedDLL - StreamingSIMDExtensions2 - - - Level3 - ProgramDatabase - Cdecl - false - 4520 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - false - - - MachineX86 - true - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Full - AnySuitable - true - Speed - false - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - MultiThreadedDLL - - - Level3 - ProgramDatabase - Cdecl - false - 4520 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - UseLinkTimeCodeGeneration - false - - - MachineX64 - true - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - Cdecl - 4520 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - false - - - MachineX64 - MultiplyDefinedSymbolOnly - - - - - - \ No newline at end of file diff --git a/projects/Win/vc14/hdr-test-list.vcxproj.filters b/projects/Win/vc14/hdr-test-list.vcxproj.filters deleted file mode 100644 index 24f6289b..00000000 --- a/projects/Win/vc14/hdr-test-list.vcxproj.filters +++ /dev/null @@ -1,186 +0,0 @@ - - - - - {fff45fc3-9c35-4f00-94ac-a2403b1caed6} - - - {b0d8933f-3fbc-49c2-ad77-89bd74461395} - - - - - intrusive - - - intrusive - - - container - - - container - - - container - - - container - - - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - intrusive - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - container - - - intrusive - - - container - - - container - - - \ No newline at end of file diff --git a/projects/source.test-hdr.mk b/projects/source.test-hdr.mk index c6a5f399..e593b1ed 100644 --- a/projects/source.test-hdr.mk +++ b/projects/source.test-hdr.mk @@ -64,42 +64,6 @@ CDS_TESTHDR_MAP := \ tests/test-hdr/map/hdr_striped_hashmap_slist.cpp \ tests/test-hdr/map/hdr_striped_map_reg.cpp -CDS_TESTHDR_LIST := \ - tests/test-hdr/list/hdr_lazy_dhp.cpp \ - tests/test-hdr/list/hdr_lazy_hp.cpp \ - tests/test-hdr/list/hdr_lazy_nogc.cpp \ - tests/test-hdr/list/hdr_lazy_nogc_unord.cpp \ - tests/test-hdr/list/hdr_lazy_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_lazy_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_lazy_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_lazy_rcu_shb.cpp \ - tests/test-hdr/list/hdr_lazy_rcu_sht.cpp \ - tests/test-hdr/list/hdr_lazy_kv_dhp.cpp \ - tests/test-hdr/list/hdr_lazy_kv_hp.cpp \ - tests/test-hdr/list/hdr_lazy_kv_nogc.cpp \ - tests/test-hdr/list/hdr_lazy_kv_nogc_unord.cpp \ - tests/test-hdr/list/hdr_lazy_kv_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_lazy_kv_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_lazy_kv_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_lazy_kv_rcu_shb.cpp \ - tests/test-hdr/list/hdr_lazy_kv_rcu_sht.cpp \ - tests/test-hdr/list/hdr_michael_dhp.cpp \ - tests/test-hdr/list/hdr_michael_hp.cpp \ - tests/test-hdr/list/hdr_michael_nogc.cpp \ - tests/test-hdr/list/hdr_michael_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_michael_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_michael_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_michael_rcu_shb.cpp \ - tests/test-hdr/list/hdr_michael_rcu_sht.cpp \ - tests/test-hdr/list/hdr_michael_kv_dhp.cpp \ - tests/test-hdr/list/hdr_michael_kv_hp.cpp \ - tests/test-hdr/list/hdr_michael_kv_nogc.cpp \ - tests/test-hdr/list/hdr_michael_kv_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_michael_kv_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_michael_kv_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_michael_kv_rcu_shb.cpp \ - tests/test-hdr/list/hdr_michael_kv_rcu_sht.cpp - CDS_TESTHDR_SET := \ tests/test-hdr/set/hdr_intrusive_feldman_hashset_hp.cpp \ tests/test-hdr/set/hdr_intrusive_feldman_hashset_dhp.cpp \ @@ -252,7 +216,6 @@ CDS_TESTHDR_MISC := \ CDS_TESTHDR_SOURCES := \ $(CDS_TESTHDR_MAP) \ - $(CDS_TESTHDR_LIST) \ $(CDS_TESTHDR_SET) \ $(CDS_TESTHDR_TREE) \ $(CDS_TESTHDR_MISC) diff --git a/projects/source.test-hdr.offsetof.mk b/projects/source.test-hdr.offsetof.mk index 37f0c3a9..7b728af1 100644 --- a/projects/source.test-hdr.offsetof.mk +++ b/projects/source.test-hdr.offsetof.mk @@ -46,25 +46,6 @@ CDS_TESTHDR_OFFSETOF_SET := \ tests/test-hdr/set/hdr_intrusive_splitlist_set_rcu_shb_lazy.cpp \ tests/test-hdr/set/hdr_intrusive_splitlist_set_rcu_sht_lazy.cpp -CDS_TESTHDR_OFFSETOF_LIST := \ - tests/test-hdr/list/hdr_intrusive_lazy_dhp.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_hp.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_nogc.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_nogc_unord.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_rcu_shb.cpp \ - tests/test-hdr/list/hdr_intrusive_lazy_rcu_sht.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_dhp.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_hp.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_nogc.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpb.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpt.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_list_rcu_shb.cpp \ - tests/test-hdr/list/hdr_intrusive_michael_list_rcu_sht.cpp - CDS_TESTHDR_OFFSETOF_TREE := \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp_member.cpp \ tests/test-hdr/tree/hdr_intrusive_ellen_bintree_dhp_member.cpp \ @@ -77,5 +58,4 @@ CDS_TESTHDR_OFFSETOF_TREE := \ CDS_TESTHDR_OFFSETOF_SOURCES := \ $(CDS_TESTHDR_OFFSETOF_MAP) \ $(CDS_TESTHDR_OFFSETOF_SET) \ - $(CDS_TESTHDR_OFFSETOF_LIST) \ $(CDS_TESTHDR_OFFSETOF_TREE) diff --git a/test/unit/list/CMakeLists.txt b/test/unit/list/CMakeLists.txt index 25a20042..8ecf2d4a 100644 --- a/test/unit/list/CMakeLists.txt +++ b/test/unit/list/CMakeLists.txt @@ -21,9 +21,19 @@ set(CDSGTEST_LIST_SOURCES kv_lazy_hp.cpp kv_lazy_dhp.cpp kv_lazy_nogc.cpp + kv_lazy_rcu_gpb.cpp + kv_lazy_rcu_gpi.cpp + kv_lazy_rcu_gpt.cpp + kv_lazy_rcu_shb.cpp + kv_lazy_rcu_sht.cpp kv_michael_hp.cpp kv_michael_dhp.cpp kv_michael_nogc.cpp + kv_michael_rcu_gpb.cpp + kv_michael_rcu_gpi.cpp + kv_michael_rcu_gpt.cpp + kv_michael_rcu_shb.cpp + kv_michael_rcu_sht.cpp lazy_hp.cpp lazy_dhp.cpp lazy_nogc.cpp diff --git a/test/unit/list/kv_lazy_rcu_gpb.cpp b/test/unit/list/kv_lazy_rcu_gpb.cpp new file mode 100644 index 00000000..c518091c --- /dev/null +++ b/test/unit/list/kv_lazy_rcu_gpb.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_lazy_rcu.h" + +namespace { + + typedef cds::urcu::general_buffered<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, LazyKVList, rcu_implementation ); diff --git a/test/unit/list/kv_lazy_rcu_gpi.cpp b/test/unit/list/kv_lazy_rcu_gpi.cpp new file mode 100644 index 00000000..afc8989e --- /dev/null +++ b/test/unit/list/kv_lazy_rcu_gpi.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_lazy_rcu.h" + +namespace { + + typedef cds::urcu::general_instant<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, LazyKVList, rcu_implementation ); diff --git a/test/unit/list/kv_lazy_rcu_gpt.cpp b/test/unit/list/kv_lazy_rcu_gpt.cpp new file mode 100644 index 00000000..48ba2e83 --- /dev/null +++ b/test/unit/list/kv_lazy_rcu_gpt.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_lazy_rcu.h" + +namespace { + + typedef cds::urcu::general_threaded<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, LazyKVList, rcu_implementation ); diff --git a/test/unit/list/kv_lazy_rcu_shb.cpp b/test/unit/list/kv_lazy_rcu_shb.cpp new file mode 100644 index 00000000..e1830aa3 --- /dev/null +++ b/test/unit/list/kv_lazy_rcu_shb.cpp @@ -0,0 +1,45 @@ +/* + 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 + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + +#include "test_kv_lazy_rcu.h" + +namespace { + + typedef cds::urcu::signal_buffered<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, LazyKVList, rcu_implementation ); + +#endif diff --git a/test/unit/list/kv_lazy_rcu_sht.cpp b/test/unit/list/kv_lazy_rcu_sht.cpp new file mode 100644 index 00000000..8843e251 --- /dev/null +++ b/test/unit/list/kv_lazy_rcu_sht.cpp @@ -0,0 +1,44 @@ +/* + 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 + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +#include "test_kv_lazy_rcu.h" + +namespace { + + typedef cds::urcu::signal_threaded<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, LazyKVList, rcu_implementation ); + +#endif diff --git a/test/unit/list/kv_michael_rcu_gpb.cpp b/test/unit/list/kv_michael_rcu_gpb.cpp new file mode 100644 index 00000000..29805aae --- /dev/null +++ b/test/unit/list/kv_michael_rcu_gpb.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_michael_rcu.h" + +namespace { + + typedef cds::urcu::general_buffered<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, MichaelKVList, rcu_implementation ); diff --git a/test/unit/list/kv_michael_rcu_gpi.cpp b/test/unit/list/kv_michael_rcu_gpi.cpp new file mode 100644 index 00000000..f419bd68 --- /dev/null +++ b/test/unit/list/kv_michael_rcu_gpi.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_michael_rcu.h" + +namespace { + + typedef cds::urcu::general_instant<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, MichaelKVList, rcu_implementation ); diff --git a/test/unit/list/kv_michael_rcu_gpt.cpp b/test/unit/list/kv_michael_rcu_gpt.cpp new file mode 100644 index 00000000..669e856e --- /dev/null +++ b/test/unit/list/kv_michael_rcu_gpt.cpp @@ -0,0 +1,41 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include "test_kv_michael_rcu.h" + +namespace { + + typedef cds::urcu::general_threaded<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, MichaelKVList, rcu_implementation ); diff --git a/test/unit/list/kv_michael_rcu_shb.cpp b/test/unit/list/kv_michael_rcu_shb.cpp new file mode 100644 index 00000000..e7b376ce --- /dev/null +++ b/test/unit/list/kv_michael_rcu_shb.cpp @@ -0,0 +1,45 @@ +/* + 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 + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + +#include "test_kv_michael_rcu.h" + +namespace { + + typedef cds::urcu::signal_buffered<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, MichaelKVList, rcu_implementation ); + +#endif diff --git a/test/unit/list/kv_michael_rcu_sht.cpp b/test/unit/list/kv_michael_rcu_sht.cpp new file mode 100644 index 00000000..0fc1f41e --- /dev/null +++ b/test/unit/list/kv_michael_rcu_sht.cpp @@ -0,0 +1,44 @@ +/* + 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 + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +#include "test_kv_michael_rcu.h" + +namespace { + + typedef cds::urcu::signal_threaded<> rcu_implementation; + +} // namespace + +INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, MichaelKVList, rcu_implementation ); + +#endif diff --git a/test/unit/list/test_kv_lazy_rcu.h b/test/unit/list/test_kv_lazy_rcu.h new file mode 100644 index 00000000..2571f3e3 --- /dev/null +++ b/test/unit/list/test_kv_lazy_rcu.h @@ -0,0 +1,174 @@ +/* + 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_LIST_TEST_KV_LAZY_LIST_RCU_H +#define CDSUNIT_LIST_TEST_KV_LAZY_LIST_RCU_H + +#include "test_kv_list_rcu.h" +#include + +namespace cc = cds::container; + +template +class LazyKVList : public cds_test::kv_list_rcu +{ + typedef cds_test::kv_list_rcu base_class; +public: + typedef cds::urcu::gc rcu_type; + +protected: + void SetUp() + { + RCU::Construct(); + cds::threading::Manager::attachThread(); + } + + void TearDown() + { + cds::threading::Manager::detachThread(); + RCU::Destruct(); + } +}; + +TYPED_TEST_CASE_P( LazyKVList ); + +TYPED_TEST_P( LazyKVList, less_ordered ) +{ + typedef cc::LazyKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::lazy_list::make_traits< + cds::opt::less< typename TestFixture::lt> + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, compare_ordered ) +{ + typedef cc::LazyKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::lazy_list::make_traits< + cds::opt::compare< typename TestFixture::cmp> + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, mix_ordered ) +{ + typedef cc::LazyKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::lazy_list::make_traits< + cds::opt::less< typename TestFixture::lt> + ,cds::opt::compare< typename TestFixture::cmp> + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, item_counting ) +{ + struct traits : public cc::lazy_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + }; + typedef cc::LazyKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, backoff ) +{ + struct traits : public cc::lazy_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + typedef cds::backoff::empty back_off; + }; + typedef cc::LazyKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, seq_cst ) +{ + struct traits : public cc::lazy_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + typedef cds::opt::v::sequential_consistent memory_model; + }; + typedef cc::LazyKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( LazyKVList, mutex ) +{ + struct traits : public cc::lazy_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + typedef std::mutex lock_type; + }; + typedef cc::LazyKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +// GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as +// "No test named can be found in this test case" +REGISTER_TYPED_TEST_CASE_P( LazyKVList, + less_ordered, compare_ordered, mix_ordered, item_counting, backoff, seq_cst, mutex + ); + +#endif // CDSUNIT_LIST_TEST_KV_LAZY_LIST_RCU_H diff --git a/test/unit/list/test_kv_list_rcu.h b/test/unit/list/test_kv_list_rcu.h new file mode 100644 index 00000000..9b26317c --- /dev/null +++ b/test/unit/list/test_kv_list_rcu.h @@ -0,0 +1,156 @@ +/* + 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_LIST_TEST_KV_LIST_RCU_H +#define CDSUNIT_LIST_TEST_KV_LIST_RCU_H + +#include "test_kv_list.h" + +namespace cds_test { + + class kv_list_rcu : public kv_list_common + { + protected: + template + void test_rcu( List& l ) + { + // Precondition: list is empty + // Postcondition: list is empty + + static const size_t nSize = 20; + typedef typename List::key_type list_key_type; + typedef typename List::mapped_type list_mapped_type; + typedef typename List::value_type list_value_type; + struct key_val { + int key; + int val; + }; + key_val arr[nSize]; + + for ( size_t i = 0; i < nSize; ++i ) { + arr[i].key = static_cast(i); + arr[i].val = arr[i].key * 10; + } + shuffle( arr, arr + nSize ); + + ASSERT_TRUE( l.empty() ); + ASSERT_CONTAINER_SIZE( l, 0 ); + + typedef typename List::exempt_ptr exempt_ptr; + typedef typename List::raw_ptr raw_ptr; + typedef typename List::rcu_lock rcu_lock; + + // get() test + for ( auto const& i : arr ) { + { + rcu_lock lock; + raw_ptr rp = l.get( i.key ); + EXPECT_TRUE( !rp ); + rp = l.get_with( other_key( i.key ), other_less() ); + EXPECT_TRUE( !rp ); + } + + EXPECT_TRUE( l.insert( i.key, i.val )); + + { + rcu_lock lock; + raw_ptr rp = l.get( i.key ); + ASSERT_FALSE( !rp ); + EXPECT_EQ( rp->first.nKey, i.key ); + EXPECT_EQ( rp->second.val, i.val ); + } + { + rcu_lock lock; + raw_ptr rp = l.get( key_type( i.key )); + ASSERT_FALSE( !rp ); + EXPECT_EQ( rp->first.nKey, i.key ); + EXPECT_EQ( rp->second.val, i.val ); + } + { + rcu_lock lock; + raw_ptr rp = l.get_with( other_key( i.key ), other_less()); + ASSERT_FALSE( !rp ); + EXPECT_EQ( rp->first.key(), i.key ); + EXPECT_EQ( rp->second.val, i.val ); + } + } + + ASSERT_FALSE( l.empty() ); + ASSERT_CONTAINER_SIZE( l, nSize ); + + // extract() + + exempt_ptr gp; + if ( List::c_bExtractLockExternal ) { + for ( auto const& i : arr ) { + { + rcu_lock lock; + if ( i.key & 1 ) + gp = l.extract( i.key ); + else + gp = l.extract_with( other_key( i.key ), other_less()); + + ASSERT_FALSE( !gp ); + EXPECT_EQ( gp->first.key(), i.key ); + } + gp.release(); + { + rcu_lock lock; + gp = l.extract( i.key ); + EXPECT_TRUE( !gp ); + gp = l.extract_with( other_key( i.key ), other_less()); + EXPECT_TRUE( !gp ); + } + } + } + else { + for ( auto const& i : arr ) { + if ( i.key & 1 ) + gp = l.extract( i.key ); + else + gp = l.extract_with( other_key( i.key ), other_less()); + + ASSERT_FALSE( !gp ); + EXPECT_EQ( gp->first.key(), i.key ); + + gp = l.extract( i.key ); + EXPECT_TRUE( !gp ); + gp = l.extract_with( other_key( i.key ), other_less()); + EXPECT_TRUE( !gp ); + } + } + + ASSERT_TRUE( l.empty() ); + ASSERT_CONTAINER_SIZE( l, 0 ); + } + }; +} // namespace cds_test + +#endif // CDSUNIT_LIST_TEST_KV_LIST_RCU_H diff --git a/test/unit/list/test_kv_michael_rcu.h b/test/unit/list/test_kv_michael_rcu.h new file mode 100644 index 00000000..730049b1 --- /dev/null +++ b/test/unit/list/test_kv_michael_rcu.h @@ -0,0 +1,157 @@ +/* + 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_LIST_TEST_MICHAEL_KV_LIST_RCU_H +#define CDSUNIT_LIST_TEST_MICHAEL_KV_LIST_RCU_H + +#include "test_kv_list_rcu.h" +#include + +namespace cc = cds::container; + +template +class MichaelKVList : public cds_test::kv_list_rcu +{ + typedef cds_test::kv_list_rcu base_class; +public: + typedef cds::urcu::gc rcu_type; + +protected: + void SetUp() + { + RCU::Construct(); + cds::threading::Manager::attachThread(); + } + + void TearDown() + { + cds::threading::Manager::detachThread(); + RCU::Destruct(); + } +}; + +TYPED_TEST_CASE_P( MichaelKVList ); + +TYPED_TEST_P( MichaelKVList, less_ordered ) +{ + typedef cc::MichaelKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::michael_list::make_traits< + cds::opt::less< typename TestFixture::lt > + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( MichaelKVList, compare_ordered ) +{ + typedef cc::MichaelKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::michael_list::make_traits< + cds::opt::compare< typename TestFixture::cmp> + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( MichaelKVList, mix_ordered ) +{ + typedef cc::MichaelKVList< typename TestFixture::rcu_type, typename TestFixture::key_type, typename TestFixture::value_type, + typename cc::michael_list::make_traits< + cds::opt::compare< typename TestFixture::cmp> + ,cds::opt::less< typename TestFixture::lt> + >::type + > list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( MichaelKVList, item_counting ) +{ + struct traits : public cc::michael_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + }; + typedef cc::MichaelKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( MichaelKVList, backoff ) +{ + struct traits : public cc::michael_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + typedef cds::backoff::empty back_off; + }; + typedef cc::MichaelKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +TYPED_TEST_P( MichaelKVList, seq_cst ) +{ + struct traits : public cc::michael_list::traits + { + typedef typename TestFixture::lt less; + typedef cds::atomicity::item_counter item_counter; + typedef cds::opt::v::sequential_consistent memory_model; + }; + typedef cc::MichaelKVList list_type; + + list_type l; + this->test_common( l ); + this->test_ordered_iterator( l ); + this->test_rcu( l ); +} + +// GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as +// "No test named can be found in this test case" +REGISTER_TYPED_TEST_CASE_P( MichaelKVList, + less_ordered, compare_ordered, mix_ordered, item_counting, backoff, seq_cst + ); + +#endif // CDSUNIT_LIST_TEST_MICHAEL_KV_LIST_RCU_H diff --git a/tests/test-hdr/CMakeLists.txt b/tests/test-hdr/CMakeLists.txt index 982f7d80..35c3ab18 100644 --- a/tests/test-hdr/CMakeLists.txt +++ b/tests/test-hdr/CMakeLists.txt @@ -66,42 +66,6 @@ set(CDS_TESTHDR_MAP map/hdr_striped_hashmap_slist.cpp map/hdr_striped_map_reg.cpp) -set(CDS_TESTHDR_LIST - list/hdr_lazy_dhp.cpp - list/hdr_lazy_hp.cpp - list/hdr_lazy_nogc.cpp - list/hdr_lazy_nogc_unord.cpp - list/hdr_lazy_rcu_gpi.cpp - list/hdr_lazy_rcu_gpb.cpp - list/hdr_lazy_rcu_gpt.cpp - list/hdr_lazy_rcu_shb.cpp - list/hdr_lazy_rcu_sht.cpp - list/hdr_lazy_kv_dhp.cpp - list/hdr_lazy_kv_hp.cpp - list/hdr_lazy_kv_nogc.cpp - list/hdr_lazy_kv_nogc_unord.cpp - list/hdr_lazy_kv_rcu_gpb.cpp - list/hdr_lazy_kv_rcu_gpi.cpp - list/hdr_lazy_kv_rcu_gpt.cpp - list/hdr_lazy_kv_rcu_shb.cpp - list/hdr_lazy_kv_rcu_sht.cpp - list/hdr_michael_dhp.cpp - list/hdr_michael_hp.cpp - list/hdr_michael_nogc.cpp - list/hdr_michael_rcu_gpi.cpp - list/hdr_michael_rcu_gpb.cpp - list/hdr_michael_rcu_gpt.cpp - list/hdr_michael_rcu_shb.cpp - list/hdr_michael_rcu_sht.cpp - list/hdr_michael_kv_dhp.cpp - list/hdr_michael_kv_hp.cpp - list/hdr_michael_kv_nogc.cpp - list/hdr_michael_kv_rcu_gpi.cpp - list/hdr_michael_kv_rcu_gpb.cpp - list/hdr_michael_kv_rcu_gpt.cpp - list/hdr_michael_kv_rcu_shb.cpp - list/hdr_michael_kv_rcu_sht.cpp) - set(CDS_TESTHDR_SET set/hdr_intrusive_feldman_hashset_hp.cpp set/hdr_intrusive_feldman_hashset_dhp.cpp @@ -300,25 +264,6 @@ set(CDS_TESTHDR_OFFSETOF_SET set/hdr_intrusive_splitlist_set_rcu_shb_lazy.cpp set/hdr_intrusive_splitlist_set_rcu_sht_lazy.cpp) -set(CDS_TESTHDR_OFFSETOF_LIST - list/hdr_intrusive_lazy_dhp.cpp - list/hdr_intrusive_lazy_hp.cpp - list/hdr_intrusive_lazy_nogc.cpp - list/hdr_intrusive_lazy_nogc_unord.cpp - list/hdr_intrusive_lazy_rcu_gpb.cpp - list/hdr_intrusive_lazy_rcu_gpi.cpp - list/hdr_intrusive_lazy_rcu_gpt.cpp - list/hdr_intrusive_lazy_rcu_shb.cpp - list/hdr_intrusive_lazy_rcu_sht.cpp - list/hdr_intrusive_michael_dhp.cpp - list/hdr_intrusive_michael_hp.cpp - list/hdr_intrusive_michael_nogc.cpp - list/hdr_intrusive_michael_list_rcu_gpb.cpp - list/hdr_intrusive_michael_list_rcu_gpi.cpp - list/hdr_intrusive_michael_list_rcu_gpt.cpp - list/hdr_intrusive_michael_list_rcu_shb.cpp - list/hdr_intrusive_michael_list_rcu_sht.cpp) - set(CDS_TESTHDR_OFFSETOF_TREE tree/hdr_intrusive_ellen_bintree_hp_member.cpp tree/hdr_intrusive_ellen_bintree_dhp_member.cpp @@ -331,7 +276,6 @@ set(CDS_TESTHDR_OFFSETOF_TREE set(CDS_TESTHDR_OFFSETOF_SOURCES ${CDS_TESTHDR_OFFSETOF_MAP} ${CDS_TESTHDR_OFFSETOF_SET} - ${CDS_TESTHDR_OFFSETOF_LIST} ${CDS_TESTHDR_OFFSETOF_TREE}) add_library(test-hdr-offsetof OBJECT ${CDS_TESTHDR_OFFSETOF_SOURCES}) @@ -342,7 +286,6 @@ endif(CMAKE_COMPILER_IS_GNUCC) set(CDS_TESTHDR_SOURCES ${CDS_TESTHDR_MAP} - ${CDS_TESTHDR_LIST} ${CDS_TESTHDR_SET} ${CDS_TESTHDR_TREE} ${CDS_TESTHDR_MISC})