From 695174aca7ba74e16de603672ab052d38da907a2 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 20 Sep 2015 16:47:21 +0300 Subject: [PATCH] Bugfix --- cds/container/lazy_list_nogc.h | 3 +-- cds/container/michael_list_nogc.h | 3 +-- projects/Win/vc12/cds.sln | 4 ++-- projects/Win/vc12/hdr-test-striped-set.vcxproj | 1 - .../Win/vc12/hdr-test-striped-set.vcxproj.filters | 1 - projects/Win/vc14/cds.sln | 4 ++-- projects/Win/vc14/hdr-test-striped-set.vcxproj | 1 - .../Win/vc14/hdr-test-striped-set.vcxproj.filters | 1 - projects/source.unit.map.mk | 2 ++ tests/test-hdr/set/hdr_intrusive_set.h | 6 +++--- tests/unit/map2/CMakeLists.txt | 2 ++ tests/unit/map2/map_delodd.h | 2 -- tests/unit/map2/map_find_int.cpp | 2 -- tests/unit/map2/map_find_int.h | 1 - tests/unit/map2/map_find_string.h | 12 ------------ tests/unit/map2/map_insdel_func.h | 1 - tests/unit/map2/map_insdel_int.h | 1 - tests/unit/map2/map_insdel_item_int.h | 1 - tests/unit/map2/map_insdel_item_string.h | 1 - tests/unit/map2/map_insdel_string.h | 1 - tests/unit/map2/map_insdelfind.h | 1 - tests/unit/map2/map_insfind_int.h | 1 - tests/unit/map2/map_type_skip_list.h | 2 +- tests/unit/set2/set_delodd.h | 1 - tests/unit/set2/set_insdel_string.h | 1 - tests/unit/set2/set_insdelfind.h | 1 - 26 files changed, 14 insertions(+), 43 deletions(-) diff --git a/cds/container/lazy_list_nogc.h b/cds/container/lazy_list_nogc.h index b10ad353..c4d8a2ea 100644 --- a/cds/container/lazy_list_nogc.h +++ b/cds/container/lazy_list_nogc.h @@ -440,9 +440,8 @@ namespace cds { namespace container { std::pair ret = base_class::update_at( &refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&){ pItemFound = &item; }, bAllowInsert ); - assert( pItemFound != nullptr ); - if ( ret.first && ret.second ) + if ( ret.second ) pNode.release(); return std::make_pair( pItemFound, ret.second ); diff --git a/cds/container/michael_list_nogc.h b/cds/container/michael_list_nogc.h index b6a48ce0..3c41b4de 100644 --- a/cds/container/michael_list_nogc.h +++ b/cds/container/michael_list_nogc.h @@ -420,9 +420,8 @@ namespace cds { namespace container { std::pair ret = base_class::update_at( refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&) { pItemFound = &item; }, bAllowInsert ); - assert( pItemFound != nullptr ); - if ( ret.first && ret.second ) + if ( ret.second ) pNode.release(); return std::make_pair( pItemFound, ret.second ); } diff --git a/projects/Win/vc12/cds.sln b/projects/Win/vc12/cds.sln index 5b7477b7..9e737608 100644 --- a/projects/Win/vc12/cds.sln +++ b/projects/Win/vc12/cds.sln @@ -4,7 +4,7 @@ VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cds", "cds.vcxproj", "{408FE9BC-44F0-4E6A-89FA-D6F952584239}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit-test", "unit-test", "{B30CA283-1796-4763-92C3-2E4848D443F7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "multi-threaded test", "multi-threaded test", "{B30CA283-1796-4763-92C3-2E4848D443F7}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\unit\print_bronsonavltree_stat.h = ..\..\..\tests\unit\print_bronsonavltree_stat.h ..\..\..\tests\unit\print_cuckoo_stat.h = ..\..\..\tests\unit\print_cuckoo_stat.h @@ -41,7 +41,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-stack", "unit-stack.vc {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hdr-test", "hdr-test", "{B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "single-threaded test", "single-threaded test", "{B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h EndProjectSection diff --git a/projects/Win/vc12/hdr-test-striped-set.vcxproj b/projects/Win/vc12/hdr-test-striped-set.vcxproj index eb90bedf..b7ee1625 100644 --- a/projects/Win/vc12/hdr-test-striped-set.vcxproj +++ b/projects/Win/vc12/hdr-test-striped-set.vcxproj @@ -92,7 +92,6 @@ - {A38E5597-6916-4480-A343-C9846EF544E4} diff --git a/projects/Win/vc12/hdr-test-striped-set.vcxproj.filters b/projects/Win/vc12/hdr-test-striped-set.vcxproj.filters index 18d96345..80351d37 100644 --- a/projects/Win/vc12/hdr-test-striped-set.vcxproj.filters +++ b/projects/Win/vc12/hdr-test-striped-set.vcxproj.filters @@ -164,6 +164,5 @@ container\striped - \ No newline at end of file diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index 9680bb49..4654ba12 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -4,7 +4,7 @@ VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cds", "cds.vcxproj", "{408FE9BC-44F0-4E6A-89FA-D6F952584239}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit-test", "unit-test", "{B30CA283-1796-4763-92C3-2E4848D443F7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "multi-threaded test", "multi-threaded test", "{B30CA283-1796-4763-92C3-2E4848D443F7}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\unit\print_bronsonavltree_stat.h = ..\..\..\tests\unit\print_bronsonavltree_stat.h ..\..\..\tests\unit\print_cuckoo_stat.h = ..\..\..\tests\unit\print_cuckoo_stat.h @@ -41,7 +41,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-stack", "unit-stack.vc {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hdr-test", "hdr-test", "{B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "single-threaded test", "single-threaded test", "{B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h EndProjectSection diff --git a/projects/Win/vc14/hdr-test-striped-set.vcxproj b/projects/Win/vc14/hdr-test-striped-set.vcxproj index 43c9dbd0..3b30583b 100644 --- a/projects/Win/vc14/hdr-test-striped-set.vcxproj +++ b/projects/Win/vc14/hdr-test-striped-set.vcxproj @@ -100,7 +100,6 @@ - {A38E5597-6916-4480-A343-C9846EF544E4} diff --git a/projects/Win/vc14/hdr-test-striped-set.vcxproj.filters b/projects/Win/vc14/hdr-test-striped-set.vcxproj.filters index 18d96345..80351d37 100644 --- a/projects/Win/vc14/hdr-test-striped-set.vcxproj.filters +++ b/projects/Win/vc14/hdr-test-striped-set.vcxproj.filters @@ -164,6 +164,5 @@ container\striped - \ No newline at end of file diff --git a/projects/source.unit.map.mk b/projects/source.unit.map.mk index 33ff37f5..5a212d4e 100644 --- a/projects/source.unit.map.mk +++ b/projects/source.unit.map.mk @@ -63,6 +63,7 @@ CDSUNIT_MAP_SOURCES := \ tests/unit/map2/map_insdel_item_string_cuckoo.cpp \ tests/unit/map2/map_insdel_item_string_ellentree.cpp \ tests/unit/map2/map_insdel_item_string_michael.cpp \ + tests/unit/map2/map_insdel_item_string_multilevelhashmap.cpp \ tests/unit/map2/map_insdel_item_string_skip.cpp \ tests/unit/map2/map_insdel_item_string_split.cpp \ tests/unit/map2/map_insdel_item_string_striped.cpp \ @@ -71,6 +72,7 @@ CDSUNIT_MAP_SOURCES := \ tests/unit/map2/map_insdel_string_cuckoo.cpp \ tests/unit/map2/map_insdel_string_ellentree.cpp \ tests/unit/map2/map_insdel_string_michael.cpp \ + tests/unit/map2/map_insdel_string_multilevelhashmap.cpp \ tests/unit/map2/map_insdel_string_skip.cpp \ tests/unit/map2/map_insdel_string_split.cpp \ tests/unit/map2/map_insdel_string_striped.cpp \ diff --git a/tests/test-hdr/set/hdr_intrusive_set.h b/tests/test-hdr/set/hdr_intrusive_set.h index 4a047e3c..9642e5b9 100644 --- a/tests/test-hdr/set/hdr_intrusive_set.h +++ b/tests/test-hdr/set/hdr_intrusive_set.h @@ -352,7 +352,7 @@ namespace set { CPPUNIT_ASSERT( ret.first ); CPPUNIT_ASSERT( !ret.second ); CPPUNIT_ASSERT( v1.nUpdateNewCount == 1 ); - CPPUNIT_ASSERT( v1.nUpdateCount == 1 ); + CPPUNIT_ASSERT( v1.nUpdateCount == 2 ); CPPUNIT_ASSERT( check_size( s, 3 )); ret = s.update( v2, f ); @@ -743,7 +743,7 @@ namespace set { CPPUNIT_ASSERT( ret.first ); CPPUNIT_ASSERT( !ret.second ); CPPUNIT_ASSERT( v1.nUpdateNewCount == 1 ); - CPPUNIT_ASSERT( v1.nUpdateCount == 1 ); + CPPUNIT_ASSERT( v1.nUpdateCount == 2 ); CPPUNIT_ASSERT( check_size( s, 3 )); ret = s.update( v2, f ); @@ -901,7 +901,7 @@ namespace set { CPPUNIT_ASSERT( ret.first ); CPPUNIT_ASSERT( !ret.second ); CPPUNIT_ASSERT( v1.nUpdateNewCount == 1 ); - CPPUNIT_ASSERT( v1.nUpdateCount == 1 ); + CPPUNIT_ASSERT( v1.nUpdateCount == 2 ); CPPUNIT_ASSERT( check_size( s, 3 )); ret = s.update( v2, f ); diff --git a/tests/unit/map2/CMakeLists.txt b/tests/unit/map2/CMakeLists.txt index 1a51a765..319c86ab 100644 --- a/tests/unit/map2/CMakeLists.txt +++ b/tests/unit/map2/CMakeLists.txt @@ -64,6 +64,7 @@ set(CDSUNIT_MAP_SOURCES map_insdel_item_string_cuckoo.cpp map_insdel_item_string_ellentree.cpp map_insdel_item_string_michael.cpp + map_insdel_item_string_multilevelhashmap.cpp map_insdel_item_string_skip.cpp map_insdel_item_string_split.cpp map_insdel_item_string_striped.cpp @@ -72,6 +73,7 @@ set(CDSUNIT_MAP_SOURCES map_insdel_string_cuckoo.cpp map_insdel_string_ellentree.cpp map_insdel_string_michael.cpp + map_insdel_string_multilevelhashmap.cpp map_insdel_string_skip.cpp map_insdel_string_split.cpp map_insdel_string_striped.cpp diff --git a/tests/unit/map2/map_delodd.h b/tests/unit/map2/map_delodd.h index 3bafa791..01f3af6f 100644 --- a/tests/unit/map2/map_delodd.h +++ b/tests/unit/map2/map_delodd.h @@ -133,8 +133,6 @@ namespace map2 { std::vector m_arrRemove; protected: - typedef CppUnitMini::TestCase Base; - typedef key_thread key_type; typedef size_t value_type; typedef std::pair pair_type; diff --git a/tests/unit/map2/map_find_int.cpp b/tests/unit/map2/map_find_int.cpp index 23dced06..0cd09317 100644 --- a/tests/unit/map2/map_find_int.cpp +++ b/tests/unit/map2/map_find_int.cpp @@ -1,7 +1,5 @@ //$$CDS-header$$ -// defines concurrent access to map::nonconcurrent_iterator::Sequence::TValue::nAccess field - #include "map2/map_find_int.h" // find int test in map in mutithreaded mode diff --git a/tests/unit/map2/map_find_int.h b/tests/unit/map2/map_find_int.h index b4cde503..9e73d4c9 100644 --- a/tests/unit/map2/map_find_int.h +++ b/tests/unit/map2/map_find_int.h @@ -32,7 +32,6 @@ namespace map2 { size_t c_nLoadFactor; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; struct value_type { key_type nKey ; // key diff --git a/tests/unit/map2/map_find_string.h b/tests/unit/map2/map_find_string.h index 3ca6ace9..1a65536c 100644 --- a/tests/unit/map2/map_find_string.h +++ b/tests/unit/map2/map_find_string.h @@ -29,7 +29,6 @@ namespace map2 { size_t c_nLoadFactor; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef std::string key_type; struct value_type { std::string const * pKey; @@ -206,17 +205,6 @@ namespace map2 { } } - template - void test_nolf() - { - initTestSequence(); - - Map testMap; - find_string_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - void setUpParams( const CppUnitMini::TestCfg& cfg ); # include "map2/map_defs.h" diff --git a/tests/unit/map2/map_insdel_func.h b/tests/unit/map2/map_insdel_func.h index 24021abd..14ca7f28 100644 --- a/tests/unit/map2/map_insdel_func.h +++ b/tests/unit/map2/map_insdel_func.h @@ -542,7 +542,6 @@ namespace map2 { } } - typedef CppUnitMini::TestCase Base; void setUpParams( const CppUnitMini::TestCfg& cfg ); # include "map2/map_defs.h" diff --git a/tests/unit/map2/map_insdel_int.h b/tests/unit/map2/map_insdel_int.h index a47738fd..e3e67e3e 100644 --- a/tests/unit/map2/map_insdel_int.h +++ b/tests/unit/map2/map_insdel_int.h @@ -30,7 +30,6 @@ namespace map2 { size_t c_nLoadFactor; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_insdel_item_int.h b/tests/unit/map2/map_insdel_item_int.h index 15784950..d38d442f 100644 --- a/tests/unit/map2/map_insdel_item_int.h +++ b/tests/unit/map2/map_insdel_item_int.h @@ -29,7 +29,6 @@ namespace map2 { size_t c_nLoadFactor = 2; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_insdel_item_string.h b/tests/unit/map2/map_insdel_item_string.h index 7156d54d..94b9569a 100644 --- a/tests/unit/map2/map_insdel_item_string.h +++ b/tests/unit/map2/map_insdel_item_string.h @@ -29,7 +29,6 @@ namespace map2 { size_t c_nLoadFactor = 2; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef std::string key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_insdel_string.h b/tests/unit/map2/map_insdel_string.h index 372bbd6b..0f2558a0 100644 --- a/tests/unit/map2/map_insdel_string.h +++ b/tests/unit/map2/map_insdel_string.h @@ -30,7 +30,6 @@ namespace map2 { size_t c_nLoadFactor; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef std::string key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_insdelfind.h b/tests/unit/map2/map_insdelfind.h index e382ad28..50bf2a18 100644 --- a/tests/unit/map2/map_insdelfind.h +++ b/tests/unit/map2/map_insdelfind.h @@ -39,7 +39,6 @@ namespace map2 { actions m_arrShuffle[c_nShuffleSize]; protected: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_insfind_int.h b/tests/unit/map2/map_insfind_int.h index 35f4cbee..7e0096e3 100644 --- a/tests/unit/map2/map_insfind_int.h +++ b/tests/unit/map2/map_insfind_int.h @@ -28,7 +28,6 @@ namespace map2 { size_t c_nLoadFactor = 2; // current load factor private: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; typedef size_t value_type; diff --git a/tests/unit/map2/map_type_skip_list.h b/tests/unit/map2/map_type_skip_list.h index 2a4cd57c..37a5ad05 100644 --- a/tests/unit/map2/map_type_skip_list.h +++ b/tests/unit/map2/map_type_skip_list.h @@ -14,7 +14,7 @@ namespace map2 { - template + template class SkipListMap : public cc::SkipListMap< GC, Key, T, Traits > { typedef cc::SkipListMap< GC, Key, T, Traits > base_class; diff --git a/tests/unit/set2/set_delodd.h b/tests/unit/set2/set_delodd.h index 0f14a6af..4ade55db 100644 --- a/tests/unit/set2/set_delodd.h +++ b/tests/unit/set2/set_delodd.h @@ -132,7 +132,6 @@ namespace set2 { std::vector m_arrData; protected: - typedef CppUnitMini::TestCase Base; typedef key_thread key_type; typedef size_t value_type; diff --git a/tests/unit/set2/set_insdel_string.h b/tests/unit/set2/set_insdel_string.h index 7608542f..37dddb06 100644 --- a/tests/unit/set2/set_insdel_string.h +++ b/tests/unit/set2/set_insdel_string.h @@ -29,7 +29,6 @@ namespace set2 { size_t c_nLoadFactor = 2; private: - typedef CppUnitMini::TestCase Base; typedef std::string key_type; typedef size_t value_type; diff --git a/tests/unit/set2/set_insdelfind.h b/tests/unit/set2/set_insdelfind.h index 74971e88..89be492f 100644 --- a/tests/unit/set2/set_insdelfind.h +++ b/tests/unit/set2/set_insdelfind.h @@ -38,7 +38,6 @@ namespace set2 { actions m_arrShuffle[c_nShuffleSize]; protected: - typedef CppUnitMini::TestCase Base; typedef size_t key_type; typedef size_t value_type; -- 2.34.1