From: khizmax Date: Sun, 8 May 2016 15:59:51 +0000 (+0300) Subject: Migrated set-insdel-func stress test to gtest framework X-Git-Tag: v2.2.0~255 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=260a161d3cada06719471d8ff03b3fe1e5b2cc37 Migrated set-insdel-func stress test to gtest framework --- diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index ff985140..c3c96110 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -225,6 +225,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Header Files", "Header File EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdelfind", "stress-set-insdelfind.vcxproj", "{133D1AEE-3BAF-42D1-B1AB-93D5239F4926}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdel-func", "stress-set-insdel_func.vcxproj", "{EE7A269E-83E4-402B-9C79-85058826E81E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -559,6 +561,18 @@ Global {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|Win32.Build.0 = Release|Win32 {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|x64.ActiveCfg = Release|x64 {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|x64.Build.0 = Release|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Debug|Win32.ActiveCfg = Debug|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Debug|Win32.Build.0 = Debug|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Debug|x64.ActiveCfg = Debug|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Debug|x64.Build.0 = Debug|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.DebugVLD|x64.Build.0 = DebugVLD|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|Win32.ActiveCfg = Release|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|Win32.Build.0 = Release|Win32 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|x64.ActiveCfg = Release|x64 + {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -594,6 +608,7 @@ Global {8202D428-1E08-4744-B372-6B2E83A9928E} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} {D968B0F5-52BD-40C1-B230-28104567CE97} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} {133D1AEE-3BAF-42D1-B1AB-93D5239F4926} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} + {EE7A269E-83E4-402B-9C79-85058826E81E} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/projects/Win/vc14/stress-set-delodd.vcxproj b/projects/Win/vc14/stress-set-delodd.vcxproj index 7c0bc7c5..f1b71ec9 100644 --- a/projects/Win/vc14/stress-set-delodd.vcxproj +++ b/projects/Win/vc14/stress-set-delodd.vcxproj @@ -56,6 +56,9 @@ + + + {8202D428-1E08-4744-B372-6B2E83A9928E} Win32Proj diff --git a/projects/Win/vc14/stress-set-delodd.vcxproj.filters b/projects/Win/vc14/stress-set-delodd.vcxproj.filters index ee2c183b..ddeafeb2 100644 --- a/projects/Win/vc14/stress-set-delodd.vcxproj.filters +++ b/projects/Win/vc14/stress-set-delodd.vcxproj.filters @@ -45,4 +45,7 @@ Header Files + + + \ No newline at end of file diff --git a/projects/Win/vc14/stress-set-insdel_func.vcxproj b/projects/Win/vc14/stress-set-insdel_func.vcxproj new file mode 100644 index 00000000..0aced871 --- /dev/null +++ b/projects/Win/vc14/stress-set-insdel_func.vcxproj @@ -0,0 +1,271 @@ + + + + + DebugVLD + Win32 + + + DebugVLD + x64 + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + + + + + + + {EE7A269E-83E4-402B-9C79-85058826E81E} + Win32Proj + stress_set_insdel_func + 8.1 + stress-set-insdel-func + + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + 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)\ + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/stress-set-insdel_func.vcxproj.filters b/projects/Win/vc14/stress-set-insdel_func.vcxproj.filters new file mode 100644 index 00000000..39278ed0 --- /dev/null +++ b/projects/Win/vc14/stress-set-insdel_func.vcxproj.filters @@ -0,0 +1,54 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/stress-set-insdelfind.vcxproj b/projects/Win/vc14/stress-set-insdelfind.vcxproj index e191936b..c760a82e 100644 --- a/projects/Win/vc14/stress-set-insdelfind.vcxproj +++ b/projects/Win/vc14/stress-set-insdelfind.vcxproj @@ -51,6 +51,9 @@ + + + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926} Win32Proj diff --git a/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters b/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters index 019c79b9..80525d7a 100644 --- a/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters +++ b/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters @@ -51,4 +51,7 @@ Header Files + + + \ No newline at end of file diff --git a/projects/Win/vc14/unit-set-insdel.vcxproj b/projects/Win/vc14/unit-set-insdel.vcxproj index c64864e6..a510845d 100644 --- a/projects/Win/vc14/unit-set-insdel.vcxproj +++ b/projects/Win/vc14/unit-set-insdel.vcxproj @@ -27,14 +27,6 @@ - - - - - - - - @@ -46,7 +38,6 @@ - diff --git a/projects/Win/vc14/unit-set-insdel.vcxproj.filters b/projects/Win/vc14/unit-set-insdel.vcxproj.filters index 643f5857..dd411a95 100644 --- a/projects/Win/vc14/unit-set-insdel.vcxproj.filters +++ b/projects/Win/vc14/unit-set-insdel.vcxproj.filters @@ -1,24 +1,6 @@  - - set_insdel_func - - - set_insdel_func - - - set_insdel_func - - - set_insdel_func - - - set_insdel_func - - - set_insdel_func - set_insdel_string @@ -43,28 +25,16 @@ set_insdel_string - - set_insdel_func - - - set_insdel_func - set_insdel_string - - {cbe5ede5-77ea-49bb-be6a-16d30d8416f7} - {8a51ae1e-c41c-4394-bf84-3de8c45ea8bb} - - set_insdel_func - set_insdel_string diff --git a/projects/source.unit.set.mk b/projects/source.unit.set.mk index d6047224..f0c8ee5e 100644 --- a/projects/source.unit.set.mk +++ b/projects/source.unit.set.mk @@ -1,13 +1,5 @@ CDSUNIT_SET_SOURCES := \ - tests/unit/set2/set_insdel_func.cpp \ - tests/unit/set2/set_insdel_func_cuckoo.cpp \ - tests/unit/set2/set_insdel_func_ellentree.cpp \ - tests/unit/set2/set_insdel_func_michael.cpp \ - tests/unit/set2/set_insdel_func_feldmanhashset.cpp \ - tests/unit/set2/set_insdel_func_skip.cpp \ - tests/unit/set2/set_insdel_func_split.cpp \ - tests/unit/set2/set_insdel_func_striped.cpp \ tests/unit/set2/set_insdel_string.cpp \ tests/unit/set2/set_insdel_string_cuckoo.cpp \ tests/unit/set2/set_insdel_string_ellentree.cpp \ diff --git a/test/stress/data/test-debug.conf b/test/stress/data/test-debug.conf index 14c31ce4..845b3bec 100644 --- a/test/stress/data/test-debug.conf +++ b/test/stress/data/test-debug.conf @@ -216,7 +216,7 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_func] +[map_insdel_func] InsertThreadCount=4 DeleteThreadCount=4 UpdateThreadCount=4 diff --git a/test/stress/data/test-express.conf b/test/stress/data/test-express.conf index b6d1adc3..f7171d3b 100644 --- a/test/stress/data/test-express.conf +++ b/test/stress/data/test-express.conf @@ -210,7 +210,7 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_func] +[map_insdel_func] InsertThreadCount=4 DeleteThreadCount=4 UpdateThreadCount=4 diff --git a/test/stress/data/test.conf b/test/stress/data/test.conf index f01954e6..320c965a 100644 --- a/test/stress/data/test.conf +++ b/test/stress/data/test.conf @@ -209,7 +209,7 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=10 FeldmanMapArrayBits=4 -[Map_InsDel_func] +[map_insdel_func] InsertThreadCount=4 DeleteThreadCount=4 UpdateThreadCount=4 diff --git a/test/stress/set/CMakeLists.txt b/test/stress/set/CMakeLists.txt index 16abe9f2..90dccbce 100644 --- a/test/stress/set/CMakeLists.txt +++ b/test/stress/set/CMakeLists.txt @@ -3,9 +3,11 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func) add_custom_target( stress-set DEPENDS stress-set-delodd stress-set-insdelfind + stress-set-insdel-func ) diff --git a/test/stress/set/insdel_func/CMakeLists.txt b/test/stress/set/insdel_func/CMakeLists.txt new file mode 100644 index 00000000..99a31d00 --- /dev/null +++ b/test/stress/set/insdel_func/CMakeLists.txt @@ -0,0 +1,29 @@ +set(PACKAGE_NAME stress-set-insdel-func) + +set(CDSSTRESS_SET_DELODD_SOURCES + ../../main.cpp + set_insdel_func.cpp + set_insdel_func_cuckoo.cpp + set_insdel_func_ellentree.cpp + set_insdel_func_feldman_hashset.cpp + set_insdel_func_michael.cpp + set_insdel_func_skip.cpp + set_insdel_func_split.cpp + set_insdel_func_striped.cpp +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_DELODD_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/stress/set/insdel_func/set_insdel_func.cpp b/test/stress/set/insdel_func/set_insdel_func.cpp new file mode 100644 index 00000000..00b4f8c5 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func.cpp @@ -0,0 +1,114 @@ +/* + 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 "set_insdel_func.h" + +namespace set { + + size_t Set_InsDel_func::s_nSetSize = 1000000; // set size + size_t Set_InsDel_func::s_nInsertThreadCount = 4; // count of insertion thread + size_t Set_InsDel_func::s_nDeleteThreadCount = 4; // count of deletion thread + size_t Set_InsDel_func::s_nUpdateThreadCount = 4; // count of ensure thread + size_t Set_InsDel_func::s_nThreadPassCount = 4; // pass count for each thread + size_t Set_InsDel_func::s_nMaxLoadFactor = 8; // maximum load factor + + size_t Set_InsDel_func::s_nCuckooInitialSize = 1024;// initial size for CuckooSet + size_t Set_InsDel_func::s_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) + size_t Set_InsDel_func::s_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) + + size_t Set_InsDel_func::s_nFeldmanSet_HeadBits = 10; + size_t Set_InsDel_func::s_nFeldmanSet_ArrayBits = 4; + + size_t Set_InsDel_func::s_nLoadFactor = 1; + + void Set_InsDel_func::SetUpTestCase() + { + cds_test::config const& cfg = get_config( "map_insdel_func" ); + + s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize ); + if ( s_nSetSize < 1000 ) + s_nSetSize = 1000; + + s_nInsertThreadCount = cfg.get_size_t( "InsertThreadCount", s_nInsertThreadCount ); + if ( s_nInsertThreadCount == 0 ) + s_nInsertThreadCount = 2; + + s_nDeleteThreadCount = cfg.get_size_t( "DeleteThreadCount", s_nDeleteThreadCount ); + if ( s_nDeleteThreadCount == 0 ) + s_nDeleteThreadCount = 2; + + s_nUpdateThreadCount = cfg.get_size_t( "UpdateThreadCount", s_nUpdateThreadCount ); + if ( s_nUpdateThreadCount == 0 ) + s_nUpdateThreadCount = 2; + + s_nThreadPassCount = cfg.get_size_t( "ThreadPassCount", s_nThreadPassCount ); + if ( s_nThreadPassCount == 0 ) + s_nThreadPassCount = 4; + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize ); + if ( s_nCuckooInitialSize < 256 ) + s_nCuckooInitialSize = 256; + + s_nCuckooProbesetSize = cfg.get_size_t( "CuckooProbesetSize", s_nCuckooProbesetSize ); + if ( s_nCuckooProbesetSize < 8 ) + s_nCuckooProbesetSize = 8; + + s_nCuckooProbesetThreshold = cfg.get_size_t( "CuckooProbesetThreshold", s_nCuckooProbesetThreshold ); + + s_nFeldmanSet_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanSet_HeadBits ); + if ( s_nFeldmanSet_HeadBits == 0 ) + s_nFeldmanSet_HeadBits = 2; + + s_nFeldmanSet_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanSet_ArrayBits ); + if ( s_nFeldmanSet_ArrayBits == 0 ) + s_nFeldmanSet_ArrayBits = 2; + } + + std::vector Set_InsDel_func_LF::get_load_factors() + { + cds_test::config const& cfg = get_config( "map_insdel_func" ); + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + std::vector lf; + for ( size_t n = 1; n <= s_nMaxLoadFactor; n *= 2 ) + lf.push_back( n ); + + return lf; + } + + INSTANTIATE_TEST_CASE_P( a, Set_InsDel_func_LF, ::testing::ValuesIn( Set_InsDel_func_LF::get_load_factors())); +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func.h b/test/stress/set/insdel_func/set_insdel_func.h new file mode 100644 index 00000000..0e69476b --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func.h @@ -0,0 +1,543 @@ +/* + 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 "set_type.h" + +namespace set { + + class Set_InsDel_func: public cds_test::stress_fixture + { + public: + static size_t s_nSetSize; // set size + static size_t s_nInsertThreadCount; // count of insertion thread + static size_t s_nDeleteThreadCount; // count of deletion thread + static size_t s_nUpdateThreadCount; // count of updating thread + static size_t s_nThreadPassCount; // pass count for each thread + static size_t s_nMaxLoadFactor; // maximum load factor + + static size_t s_nCuckooInitialSize; // initial size for CuckooSet + static size_t s_nCuckooProbesetSize; // CuckooSet probeset size (only for list-based probeset) + static size_t s_nCuckooProbesetThreshold; // CUckooSet probeset threshold (0 - use default) + + static size_t s_nFeldmanSet_HeadBits; + static size_t s_nFeldmanSet_ArrayBits; + + static size_t s_nLoadFactor; + + static void SetUpTestCase(); + //static void TearDownTestCase(); + + public: + typedef size_t key_type; + + struct value { + size_t nKey; + size_t nData; + atomics::atomic nUpdateCall; + bool volatile bInitialized; + cds::OS::ThreadId threadId ; // insert thread id + + typedef cds::sync::spin_lock< cds::backoff::pause > lock_type; + mutable lock_type m_access; + + value() + : nKey(0) + , nData(0) + , nUpdateCall(0) + , bInitialized( false ) + , threadId( cds::OS::get_current_thread_id() ) + {} + + value( value const& s ) + : nKey(s.nKey) + , nData(s.nData) + , nUpdateCall(s.nUpdateCall.load(atomics::memory_order_relaxed)) + , bInitialized( s.bInitialized ) + , threadId( cds::OS::get_current_thread_id() ) + {} + + // boost::container::flat_map requires operator = + value& operator=( value const& v ) + { + nKey = v.nKey; + nData = v.nData; + nUpdateCall.store( v.nUpdateCall.load(atomics::memory_order_relaxed), atomics::memory_order_relaxed ); + bInitialized = v.bInitialized; + + return *this; + } + }; + + size_t * m_pKeyFirst; + size_t * m_pKeyLast; + size_t * m_pKeyArr; + + enum { + insert_thread, + update_thread, + delete_thread + }; + + template + class Inserter: public cds_test::thread + { + typedef cds_test::thread base_class; + + Set& m_Set; + typedef typename Set::value_type keyval_type; + + struct insert_functor { + size_t nTestFunctorRef; + + insert_functor() + : nTestFunctorRef(0) + {} + insert_functor( insert_functor const& ) = delete; + + void operator()( keyval_type& val ) + { + std::unique_lock< typename value::lock_type> ac( val.val.m_access ); + + val.val.nKey = val.key; + val.val.nData = val.key * 8; + + ++nTestFunctorRef; + val.val.bInitialized = true; + } + }; + + public: + size_t m_nInsertSuccess = 0; + size_t m_nInsertFailed = 0; + + size_t m_nTestFunctorRef = 0; + + public: + Inserter( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, insert_thread ) + , m_Set( set ) + {} + + Inserter( Inserter& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Inserter( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + Set_InsDel_func& fixture = pool().template fixture(); + + size_t * pKeyFirst = fixture.m_pKeyFirst; + size_t * pKeyLast = fixture.m_pKeyLast; + size_t const nPassCount = fixture.s_nThreadPassCount; + + // func is passed by reference + insert_functor func; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { + if ( rSet.insert( *p, std::ref( func ))) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) { + if ( rSet.insert( *p, std::ref( func ))) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + } + } + + m_nTestFunctorRef = func.nTestFunctorRef; + } + }; + + template + class Updater: public cds_test::thread + { + typedef cds_test::thread base_class; + + Set& m_Set; + typedef typename Set::value_type keyval_type; + + struct update_functor { + size_t nCreated = 0; + size_t nModified = 0; + + update_functor() {} + update_functor( const update_functor& ) = delete; + + void operator()( bool bNew, keyval_type& val, size_t /*nKey*/ ) + { + std::unique_lock ac( val.val.m_access ); + if ( !val.val.bInitialized ) + { + val.val.nKey = val.key; + val.val.nData = val.key * 8; + val.val.bInitialized = true; + } + + if ( bNew ) { + ++nCreated; + } + else { + val.val.nUpdateCall.fetch_add( 1, atomics::memory_order_relaxed ); + ++nModified; + } + } + + void operator()( keyval_type& cur, keyval_type * old ) + { + operator()( old == nullptr, cur, 0 ); + } + }; + + public: + size_t m_nUpdateFailed = 0; + size_t m_nUpdateCreated = 0; + size_t m_nUpdateExisted = 0; + size_t m_nFunctorCreated = 0; + size_t m_nFunctorModified = 0; + + public: + Updater( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, update_thread ) + , m_Set( set ) + {} + + Updater( Updater& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Updater( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + Set_InsDel_func& fixture = pool().template fixture(); + size_t * pKeyFirst = fixture.m_pKeyFirst; + size_t * pKeyLast = fixture.m_pKeyLast; + size_t const nPassCount = fixture.s_nThreadPassCount; + + update_functor func; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { + std::pair ret = rSet.update( *p, std::ref( func ), true ); + if ( ret.first ) { + if ( ret.second ) + ++m_nUpdateCreated; + else + ++m_nUpdateExisted; + } + else + ++m_nUpdateFailed; + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyLast - 1 ; p >= pKeyFirst; --p ) { + std::pair ret = rSet.update( *p, std::ref( func ), true ); + if ( ret.first ) { + if ( ret.second ) + ++m_nUpdateCreated; + else + ++m_nUpdateExisted; + } + else + ++m_nUpdateFailed; + } + } + } + + m_nFunctorCreated = func.nCreated; + m_nFunctorModified = func.nModified; + } + }; + + template + class Deleter: public cds_test::thread + { + typedef cds_test::thread base_class; + + Set& m_Set; + typedef typename Set::value_type keyval_type; + + struct value_container + { + size_t nKeyExpected; + + size_t nSuccessItem = 0; + size_t nFailedItem = 0; + }; + + struct erase_functor { + value_container m_cnt; + + void operator ()( keyval_type const& itm ) + { + keyval_type& item = const_cast(itm); + while ( true ) { + bool bBkoff = false; + { + std::unique_lock< typename value::lock_type> ac( item.val.m_access ); + if ( item.val.bInitialized ) { + if ( m_cnt.nKeyExpected == item.val.nKey && m_cnt.nKeyExpected * 8 == item.val.nData ) + ++m_cnt.nSuccessItem; + else + ++m_cnt.nFailedItem; + item.val.nData++; + item.val.nKey = 0; + break; + } + else + bBkoff = true; + } + if ( bBkoff ) + cds::backoff::yield()(); + } + } + }; + + public: + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + + size_t m_nValueSuccess = 0; + size_t m_nValueFailed = 0; + + public: + Deleter( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, delete_thread ) + , m_Set( set ) + {} + + Deleter( Deleter& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Deleter( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + Set_InsDel_func& fixture = pool().template fixture(); + size_t * pKeyFirst = fixture.m_pKeyFirst; + size_t * pKeyLast = fixture.m_pKeyLast; + size_t const nPassCount = fixture.s_nThreadPassCount; + + erase_functor func; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { + func.m_cnt.nKeyExpected = *p; + if ( rSet.erase( *p, std::ref( func ))) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) { + func.m_cnt.nKeyExpected = *p; + if ( rSet.erase( *p, std::ref( func ))) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + } + } + + m_nValueSuccess = func.m_cnt.nSuccessItem; + m_nValueFailed = func.m_cnt.nFailedItem; + } + }; + + protected: + + template + void run_test( Set& testSet ) + { + typedef Inserter InserterThread; + typedef Deleter DeleterThread; + typedef Updater UpdaterThread; + + m_pKeyArr = new size_t[ s_nSetSize ]; + m_pKeyFirst = m_pKeyArr; + m_pKeyLast = m_pKeyFirst + s_nSetSize; + for ( size_t i = 0; i < s_nSetSize; ++i ) + m_pKeyArr[i] = i; + shuffle( m_pKeyFirst, m_pKeyLast ); + + cds_test::thread_pool& pool = get_pool(); + pool.add( new InserterThread( pool, testSet ), s_nInsertThreadCount ); + pool.add( new DeleterThread( pool, testSet ), s_nDeleteThreadCount ); + pool.add( new UpdaterThread( pool, testSet ), s_nUpdateThreadCount ); + + propout() << std::make_pair( "insert_thread_count", s_nInsertThreadCount ) + << std::make_pair( "update_thread_count", s_nUpdateThreadCount ) + << std::make_pair( "delete_thread_count", s_nDeleteThreadCount ) + << std::make_pair( "thread_pass_count", s_nThreadPassCount ) + << std::make_pair( "set_size", s_nSetSize ); + + std::chrono::milliseconds duration = pool.run(); + + propout() << std::make_pair( "duration", duration ); + + delete [] m_pKeyArr; + + size_t nInsertSuccess = 0; + size_t nInsertFailed = 0; + size_t nDeleteSuccess = 0; + size_t nDeleteFailed = 0; + size_t nDelValueSuccess = 0; + size_t nDelValueFailed = 0; + size_t nUpdateFailed = 0; + size_t nUpdateCreated = 0; + size_t nUpdateModified = 0; + size_t nEnsFuncCreated = 0; + size_t nEnsFuncModified = 0; + size_t nTestFunctorRef = 0; + + for ( size_t i = 0; i < pool.size(); ++i ) { + cds_test::thread& thr = pool.get( i ); + switch ( thr.type() ) { + case insert_thread: + { + InserterThread& inserter = static_cast( thr ); + nInsertSuccess += inserter.m_nInsertSuccess; + nInsertFailed += inserter.m_nInsertFailed; + nTestFunctorRef += inserter.m_nTestFunctorRef; + } + break; + case update_thread: + { + UpdaterThread& updater = static_cast(thr); + nUpdateCreated += updater.m_nUpdateCreated; + nUpdateModified += updater.m_nUpdateExisted; + nUpdateFailed += updater.m_nUpdateFailed; + nEnsFuncCreated += updater.m_nFunctorCreated; + nEnsFuncModified += updater.m_nFunctorModified; + } + break; + case delete_thread: + { + DeleterThread& deleter = static_cast(thr); + nDeleteSuccess += deleter.m_nDeleteSuccess; + nDeleteFailed += deleter.m_nDeleteFailed; + nDelValueSuccess += deleter.m_nValueSuccess; + nDelValueFailed += deleter.m_nValueFailed; + } + break; + } + } + + propout() + << std::make_pair( "insert_success", nInsertSuccess ) + << std::make_pair( "delete_success", nDeleteSuccess ) + << std::make_pair( "insert_failed", nInsertFailed ) + << std::make_pair( "delete_failed", nDeleteFailed ) + << std::make_pair( "update_created", nUpdateCreated ) + << std::make_pair( "update_modified", nUpdateModified ) + << std::make_pair( "update_failed", nUpdateFailed ) + << std::make_pair( "final_set_size", testSet.size() ); + + + EXPECT_EQ( nDelValueFailed, 0 ); + EXPECT_EQ( nDelValueSuccess, nDeleteSuccess ); + + EXPECT_EQ( nUpdateFailed, 0 ); + EXPECT_EQ( nUpdateCreated, nEnsFuncCreated ); + EXPECT_EQ( nUpdateModified, nEnsFuncModified ); + + // nTestFunctorRef is call count of insert functor + EXPECT_EQ( nTestFunctorRef, nInsertSuccess ); + + testSet.clear(); + EXPECT_TRUE( testSet.empty() ); + + additional_check( testSet ); + print_stat( propout(), testSet ); + + additional_cleanup( testSet ); + } + + template + void run_test() + { + Set s( *this ); + run_test( s ); + } + }; + + class Set_InsDel_func_LF: public Set_InsDel_func + , public ::testing::WithParamInterface + { + public: + template + void run_test() + { + s_nLoadFactor = GetParam(); + propout() << std::make_pair( "load_factor", s_nLoadFactor ); + Set_InsDel_func::run_test(); + } + + static std::vector get_load_factors(); + }; + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_cuckoo.cpp b/test/stress/set/insdel_func/set_insdel_func_cuckoo.cpp new file mode 100644 index 00000000..7d379008 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_cuckoo.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_cuckoo.h" + +namespace set { + + CDSSTRESS_CuckooSet( Set_InsDel_func, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_ellentree.cpp b/test/stress/set/insdel_func/set_insdel_func_ellentree.cpp new file mode 100644 index 00000000..36219cb6 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_ellentree.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_ellen_bintree.h" + +namespace set { + + CDSSTRESS_EllenBinTreeSet( Set_InsDel_func, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp b/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp new file mode 100644 index 00000000..1d88c516 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_feldman_hashset.h" + +namespace set { + + CDSSTRESS_FeldmanHashSet( Set_InsDel_func, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_michael.cpp b/test/stress/set/insdel_func/set_insdel_func_michael.cpp new file mode 100644 index 00000000..ead49b45 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_michael.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_michael.h" + +namespace set { + + CDSSTRESS_MichaelSet( Set_InsDel_func_LF, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_skip.cpp b/test/stress/set/insdel_func/set_insdel_func_skip.cpp new file mode 100644 index 00000000..57b1c7b1 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_skip.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_skip_list.h" + +namespace set { + + CDSSTRESS_SkipListSet( Set_InsDel_func, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_split.cpp b/test/stress/set/insdel_func/set_insdel_func_split.cpp new file mode 100644 index 00000000..fb7978b7 --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_split.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_split_list.h" + +namespace set { + + CDSSTRESS_SplitListSet( Set_InsDel_func_LF, run_test, size_t, value ) + +} // namespace set diff --git a/test/stress/set/insdel_func/set_insdel_func_striped.cpp b/test/stress/set/insdel_func/set_insdel_func_striped.cpp new file mode 100644 index 00000000..22106b2b --- /dev/null +++ b/test/stress/set/insdel_func/set_insdel_func_striped.cpp @@ -0,0 +1,39 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_func.h" +#include "set_type_striped.h" + +namespace set { + + CDSSTRESS_StripedSet( Set_InsDel_func_LF, run_test, size_t, value ) + +} // namespace set + diff --git a/tests/unit/map2/map_insdel_func.h b/tests/unit/map2/map_insdel_func.h index 450d4e7c..b00bc538 100644 --- a/tests/unit/map2/map_insdel_func.h +++ b/tests/unit/map2/map_insdel_func.h @@ -590,7 +590,7 @@ namespace map2 { CDSUNIT_DECLARE_RefinableMap CDSUNIT_DECLARE_CuckooMap - CPPUNIT_TEST_SUITE(Map_InsDel_func) + CPPUNIT_TEST_SUITE_(Map_InsDel_func, "map_insdel_func") CDSUNIT_TEST_MichaelMap CDSUNIT_TEST_SplitList CDSUNIT_TEST_SkipListMap diff --git a/tests/unit/set2/CMakeLists.txt b/tests/unit/set2/CMakeLists.txt index 287feaeb..8a4a482a 100644 --- a/tests/unit/set2/CMakeLists.txt +++ b/tests/unit/set2/CMakeLists.txt @@ -1,14 +1,6 @@ set(PACKAGE_NAME cdsu-set) set(CDSUNIT_SET_SOURCES - set_insdel_func.cpp - set_insdel_func_cuckoo.cpp - set_insdel_func_ellentree.cpp - set_insdel_func_michael.cpp - set_insdel_func_feldmanhashset.cpp - set_insdel_func_skip.cpp - set_insdel_func_split.cpp - set_insdel_func_striped.cpp set_insdel_string.cpp set_insdel_string_cuckoo.cpp set_insdel_string_ellentree.cpp