From: khizmax Date: Thu, 27 Oct 2016 17:27:17 +0000 (+0300) Subject: Added container::SlitListSet based on IterableList X-Git-Tag: v2.2.0~90 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=ec005082aebb3f5c5fea2dc3abba7ad533b5be78;hp=40ba82b03f2eb6bdc16528577bdf209bb686584d Added container::SlitListSet based on IterableList win: enabled /debug:fastlink flag in all project files --- diff --git a/cds/container/details/make_split_list_set.h b/cds/container/details/make_split_list_set.h index 5975f47f..6efcd9ae 100644 --- a/cds/container/details/make_split_list_set.h +++ b/cds/container/details/make_split_list_set.h @@ -43,6 +43,7 @@ namespace cds { namespace container { struct lazy_list_tag; }} // namespace cds::container +//@endcond #ifdef CDSLIB_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H diff --git a/cds/container/details/make_split_list_set_iterable_list.h b/cds/container/details/make_split_list_set_iterable_list.h new file mode 100644 index 00000000..9bb3a256 --- /dev/null +++ b/cds/container/details/make_split_list_set_iterable_list.h @@ -0,0 +1,136 @@ +/* + 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 CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_ITERABLE_LIST_H +#define CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_ITERABLE_LIST_H + +//@cond +namespace cds { namespace container { namespace details { + + template + struct make_split_list_set< GC, T, iterable_list_tag, Traits > + { + typedef GC gc; + typedef T value_type; + typedef Traits original_traits; + + typedef typename cds::opt::select_default< + typename original_traits::ordered_list_traits, + cds::container::iterable_list::traits + >::type original_ordered_list_traits; + + struct node_type: public cds::intrusive::split_list::node< void > + { + value_type m_Value; + + template + explicit node_type( Q const& v ) + : m_Value(v) + {} + template + explicit node_type( Q&& q, Args&&... args ) + : m_Value( std::forward(q), std::forward(args)... ) + {} + + node_type() = delete; + }; + + typedef typename cds::opt::select_default< + typename original_traits::ordered_list_traits, + typename original_traits::allocator, + typename cds::opt::select_default< + typename original_traits::ordered_list_traits::allocator, + typename original_traits::allocator + >::type + >::type node_allocator_; + + typedef typename node_allocator_::template rebind::other node_allocator_type; + + typedef cds::details::Allocator< node_type, node_allocator_type > cxx_node_allocator; + struct node_deallocator + { + void operator ()( node_type * pNode ) + { + cxx_node_allocator().Delete( pNode ); + } + }; + + typedef typename opt::details::make_comparator< value_type, original_ordered_list_traits >::type key_comparator; + + typedef typename original_traits::key_accessor key_accessor; + + struct value_accessor + { + typename key_accessor::key_type const& operator()( node_type const& node ) const + { + return key_accessor()(node.m_Value); + } + }; + + template + struct predicate_wrapper { + typedef cds::details::predicate_wrapper< node_type, Predicate, value_accessor > type; + }; + + struct ordered_list_traits: public original_ordered_list_traits + { + typedef cds::atomicity::empty_item_counter item_counter; + typedef node_deallocator disposer; + typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare; + }; + + struct traits: public original_traits + { + struct hash: public original_traits::hash + { + typedef typename original_traits::hash base_class; + + size_t operator()(node_type const& v ) const + { + return base_class::operator()( key_accessor()( v.m_Value ) ); + } + template + size_t operator()( Q const& k ) const + { + return base_class::operator()( k ); + } + }; + }; + + class ordered_list: public cds::intrusive::IterableList< gc, node_type, ordered_list_traits > + {}; + + typedef cds::intrusive::SplitListSet< gc, ordered_list, traits > type; + }; + +}}} // namespace cds::container::details +//@endcond + +#endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_ITERABLE_LIST_H diff --git a/cds/container/split_list_set.h b/cds/container/split_list_set.h index 3917b785..5f301ed5 100644 --- a/cds/container/split_list_set.h +++ b/cds/container/split_list_set.h @@ -33,6 +33,7 @@ #include #include +#include namespace cds { namespace container { @@ -185,69 +186,14 @@ namespace cds { namespace container { protected: //@cond - typedef typename maker::cxx_node_allocator cxx_node_allocator; - typedef typename maker::node_type node_type; + typedef typename maker::cxx_node_allocator cxx_node_allocator; + typedef typename maker::node_type node_type; //@endcond public: /// Guarded pointer typedef typename gc::template guarded_ptr< node_type, value_type, details::guarded_ptr_cast_set > guarded_ptr; - protected: - //@cond - template - static node_type * alloc_node(Q const& v ) - { - return cxx_node_allocator().New( v ); - } - - template - static node_type * alloc_node( Args&&... args ) - { - return cxx_node_allocator().MoveNew( std::forward( args )... ); - } - - static void free_node( node_type * pNode ) - { - cxx_node_allocator().Delete( pNode ); - } - - template - bool find_( Q& val, Func f ) - { - return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } ); - } - - template - bool find_with_( Q& val, Less pred, Func f ) - { - CDS_UNUSED( pred ); - return base_class::find_with( val, typename maker::template predicate_wrapper::type(), - [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } ); - } - - struct node_disposer { - void operator()( node_type * pNode ) - { - free_node( pNode ); - } - }; - typedef std::unique_ptr< node_type, node_disposer > scoped_node_ptr; - - bool insert_node( node_type * pNode ) - { - assert( pNode != nullptr ); - scoped_node_ptr p(pNode); - - if ( base_class::insert( *pNode )) { - p.release(); - return true; - } - return false; - } - - //@endcond - protected: //@cond template @@ -489,6 +435,37 @@ namespace cds { namespace container { return insert_node( alloc_node( std::forward(args)...)); } + /// Inserts or updates the node (only for \p IterableList -based set) + /** + The operation performs inserting or changing data with lock-free manner. + + If the item \p val is not found in the set, then \p val is inserted iff \p bAllowInsert is \p true. + Otherwise, the current element is changed to \p val, the old element will be retired later. + + Returns std::pair where \p first is \p true if operation is successful, + \p second is \p true if \p val has been added or \p false if the item with that key + already in the set. + */ + template +#ifdef CDS_DOXYGEN_INVOKED + std::pair +#else + typename std::enable_if< + std::is_same< Q, Q>::value && is_iterable_list< ordered_list >::value, + std::pair + >::type +#endif + upsert( Q&& val, bool bAllowInsert = true ) + { + scoped_node_ptr pNode( alloc_node( val ) ); + + auto bRet = base_class::upsert( *pNode, bAllowInsert ); + + if ( bRet.first ) + pNode.release(); + return bRet; + } + /// Updates the node /** The operation performs inserting or changing data with lock-free manner. @@ -496,10 +473,12 @@ namespace cds { namespace container { If \p key is not found in the set, then \p key is inserted iff \p bAllowInsert is \p true. Otherwise, the functor \p func is called with item found. - The functor signature is: + The functor \p func signature depends of ordered list: + + for \p MichaelList, \p LazyList \code - struct my_functor { - void operator()( bool bNew, value_type& item, const Q& val ); + struct functor { + void operator()( bool bNew, value_type& item, Q const& val ); }; \endcode with arguments: @@ -509,20 +488,37 @@ namespace cds { namespace container { The functor may change non-key fields of the \p item. + for \p IterableList + \code + void func( value_type& val, value_type * old ); + \endcode + where + - \p val - a new data constructed from \p key + - \p old - old value that will be retired. If new item has been inserted then \p old is \p nullptr. + Returns std::pair where \p first is true if operation is successful, \p second is true if new item has been added or \p false if the item with \p key - already is in the map. + already is in the set. - @warning For \ref cds_intrusive_MichaelList_hp "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + @warning For \ref cds_intrusive_MichaelList_hp "MichaelList" and \ref cds_nonintrusive_IterableList_gc "IterableList" + as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". \ref cds_intrusive_LazyList_hp "LazyList" provides exclusive access to inserted item and does not require any node-level synchronization. */ template - std::pair update( Q const& val, Func func, bool bAllowInsert = true ) +#ifdef CDS_DOXYGEN_INVOKED + std::pair +#else + typename std::enable_if< + std::is_same::value && !is_iterable_list::value, + std::pair + >::type +#endif + update( Q const& val, Func func, bool bAllowInsert = true ) { scoped_node_ptr pNode( alloc_node( val )); - std::pair bRet = base_class::update( *pNode, + auto bRet = base_class::update( *pNode, [&func, &val]( bool bNew, node_type& item, node_type const& /*val*/ ) { func( bNew, item.m_Value, val ); }, bAllowInsert ); @@ -531,6 +527,27 @@ namespace cds { namespace container { pNode.release(); return bRet; } + //@cond + template + typename std::enable_if< + std::is_same::value && is_iterable_list::value, + std::pair + >::type + update( Q const& val, Func func, bool bAllowInsert = true ) + { + scoped_node_ptr pNode( alloc_node( val ) ); + + auto bRet = base_class::update( *pNode, + [&func]( node_type& item, node_type* old ) { + func( item.m_Value, old ? &old->m_Value : nullptr ); + }, bAllowInsert ); + + if ( bRet.first ) + pNode.release(); + return bRet; + } + //@endcond + //@cond template CDS_DEPRECATED("ensure() is deprecated, use update()") @@ -694,6 +711,32 @@ namespace cds { namespace container { } //@endcond + /// Finds \p key and returns iterator pointed to the item found (only for \p IterableList -based set) + /** + If \p key is not found the function returns \p end(). + + @note This function is supported only for the set based on \p IterableList + */ + template +#ifdef CDS_DOXYGEN_INVOKED + iterator +#else + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator >::type +#endif + find( Q& key ) + { + return find_iterator_( key ); + } + //@cond + template + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator >::type + find( Q const& key ) + { + return find_iterator_( key ); + } + //@endcond + + /// Finds the key \p key using \p pred predicate for searching /** The function is an analog of \ref cds_nonintrusive_SplitListSet_find_func "find(Q&, Func)" @@ -714,6 +757,35 @@ namespace cds { namespace container { } //@endcond + /// Finds \p key using \p pred predicate and returns iterator pointed to the item found (only for \p IterableList -based set) + /** + The function is an analog of \p find(Q&) but \p pred is used for key comparing. + \p Less functor has the interface like \p std::less. + \p pred must imply the same element order as the comparator used for building the set. + + If \p key is not found the function returns \p end(). + + @note This function is supported only for the set based on \p IterableList + */ + template +#ifdef CDS_DOXYGEN_INVOKED + iterator +#else + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator >::type +#endif + find_with( Q& key, Less pred ) + { + return find_iterator_with_( key, pred ); + } + //@cond + template + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator >::type + find_with( Q const& key, Less pred ) + { + return find_iterator_with_( key, pred ); + } + //@endcond + /// Checks whether the set contains \p key /** The function searches the item with key equal to \p key @@ -728,14 +800,6 @@ namespace cds { namespace container { { return base_class::contains( key ); } - //@cond - template - CDS_DEPRECATED("deprecated, use contains()") - bool find( Q const& key ) - { - return contains( key ); - } - //@endcond /// Checks whether the map contains \p key using \p pred predicate for searching /** @@ -749,14 +813,6 @@ namespace cds { namespace container { CDS_UNUSED( pred ); return base_class::contains( key, typename maker::template predicate_wrapper::type()); } - //@cond - template - CDS_DEPRECATED("deprecated, use contains()") - bool find_with( Q const& key, Less pred ) - { - return contains( key, pred ); - } - //@endcond /// Finds the key \p key and return the item found /** \anchor cds_nonintrusive_SplitListSet_hp_get @@ -838,6 +894,72 @@ namespace cds { namespace container { using base_class::extract_; using base_class::get_; + template + static node_type * alloc_node( Q const& v ) + { + return cxx_node_allocator().New( v ); + } + + template + static node_type * alloc_node( Args&&... args ) + { + return cxx_node_allocator().MoveNew( std::forward( args )... ); + } + + static void free_node( node_type * pNode ) + { + cxx_node_allocator().Delete( pNode ); + } + + template + bool find_( Q& val, Func f ) + { + return base_class::find( val, [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } ); + } + + template + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator>::type + find_iterator_( Q& val ) + { + return iterator( base_class::find( val ) ); + } + + template + bool find_with_( Q& val, Less pred, Func f ) + { + CDS_UNUSED( pred ); + return base_class::find_with( val, typename maker::template predicate_wrapper::type(), + [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } ); + } + + template + typename std::enable_if< std::is_same::value && is_iterable_list< ordered_list >::value, iterator>::type + find_iterator_with_( Q& val, Less pred ) + { + CDS_UNUSED( pred ); + return iterator( base_class::find_with( val, typename maker::template predicate_wrapper::type() )); + } + + struct node_disposer { + void operator()( node_type * pNode ) + { + free_node( pNode ); + } + }; + typedef std::unique_ptr< node_type, node_disposer > scoped_node_ptr; + + bool insert_node( node_type * pNode ) + { + assert( pNode != nullptr ); + scoped_node_ptr p( pNode ); + + if ( base_class::insert( *pNode ) ) { + p.release(); + return true; + } + return false; + } + template guarded_ptr extract_with_( Q const& key, Less pred ) { @@ -853,10 +975,8 @@ namespace cds { namespace container { } //@endcond - }; - }} // namespace cds::container #endif // #ifndef CDSLIB_CONTAINER_SPLIT_LIST_SET_H diff --git a/projects/Win/vc14/cds.vcxproj b/projects/Win/vc14/cds.vcxproj index 6f79741c..6454034d 100644 --- a/projects/Win/vc14/cds.vcxproj +++ b/projects/Win/vc14/cds.vcxproj @@ -421,6 +421,7 @@ + diff --git a/projects/Win/vc14/cds.vcxproj.filters b/projects/Win/vc14/cds.vcxproj.filters index 30c6b4b1..66c75e1e 100644 --- a/projects/Win/vc14/cds.vcxproj.filters +++ b/projects/Win/vc14/cds.vcxproj.filters @@ -1291,5 +1291,8 @@ Header Files\cds\container\details + + Header Files\cds\container\details + \ No newline at end of file diff --git a/projects/Win/vc14/gtest-deque.vcxproj b/projects/Win/vc14/gtest-deque.vcxproj index d946f5fc..9ef36575 100644 --- a/projects/Win/vc14/gtest-deque.vcxproj +++ b/projects/Win/vc14/gtest-deque.vcxproj @@ -143,7 +143,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -158,7 +158,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -173,7 +173,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -188,7 +188,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-intrusive-list.vcxproj b/projects/Win/vc14/gtest-intrusive-list.vcxproj index 8e6171ae..0f72e6c7 100644 --- a/projects/Win/vc14/gtest-intrusive-list.vcxproj +++ b/projects/Win/vc14/gtest-intrusive-list.vcxproj @@ -171,7 +171,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -187,7 +187,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -203,7 +203,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -219,7 +219,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-intrusive-set.vcxproj b/projects/Win/vc14/gtest-intrusive-set.vcxproj index 3acac78e..e1a3063e 100644 --- a/projects/Win/vc14/gtest-intrusive-set.vcxproj +++ b/projects/Win/vc14/gtest-intrusive-set.vcxproj @@ -333,7 +333,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -350,7 +350,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -367,7 +367,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -384,7 +384,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-list.vcxproj b/projects/Win/vc14/gtest-list.vcxproj index 0d8f91d9..2c84d422 100644 --- a/projects/Win/vc14/gtest-list.vcxproj +++ b/projects/Win/vc14/gtest-list.vcxproj @@ -238,7 +238,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -253,7 +253,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -268,7 +268,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -283,7 +283,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-map.vcxproj b/projects/Win/vc14/gtest-map.vcxproj index ebaaf3d8..7a23a391 100644 --- a/projects/Win/vc14/gtest-map.vcxproj +++ b/projects/Win/vc14/gtest-map.vcxproj @@ -330,7 +330,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -347,7 +347,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -364,7 +364,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -381,7 +381,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-misc.vcxproj b/projects/Win/vc14/gtest-misc.vcxproj index 7857f8c5..bd9cf5d5 100644 --- a/projects/Win/vc14/gtest-misc.vcxproj +++ b/projects/Win/vc14/gtest-misc.vcxproj @@ -152,7 +152,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -167,7 +167,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -182,7 +182,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -197,7 +197,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-pqueue.vcxproj b/projects/Win/vc14/gtest-pqueue.vcxproj index 8873d701..5e7e2808 100644 --- a/projects/Win/vc14/gtest-pqueue.vcxproj +++ b/projects/Win/vc14/gtest-pqueue.vcxproj @@ -151,7 +151,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -166,7 +166,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -181,7 +181,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -196,7 +196,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-queue.vcxproj b/projects/Win/vc14/gtest-queue.vcxproj index 471f4b1f..93db0c90 100644 --- a/projects/Win/vc14/gtest-queue.vcxproj +++ b/projects/Win/vc14/gtest-queue.vcxproj @@ -179,7 +179,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -194,7 +194,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -209,7 +209,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -224,7 +224,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-set.vcxproj b/projects/Win/vc14/gtest-set.vcxproj index fb7d4479..dc983114 100644 --- a/projects/Win/vc14/gtest-set.vcxproj +++ b/projects/Win/vc14/gtest-set.vcxproj @@ -103,6 +103,8 @@ + + 4503 4503 @@ -219,6 +221,8 @@ + + @@ -337,7 +341,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -354,7 +358,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -371,7 +375,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -388,7 +392,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-set.vcxproj.filters b/projects/Win/vc14/gtest-set.vcxproj.filters index c7b8eb7f..02a81ef8 100644 --- a/projects/Win/vc14/gtest-set.vcxproj.filters +++ b/projects/Win/vc14/gtest-set.vcxproj.filters @@ -173,6 +173,12 @@ Source Files\MichaelSet + + Source Files\SplitList + + + Source Files\SplitList + @@ -223,5 +229,11 @@ Header Files + + Header Files + + + Header Files + \ No newline at end of file diff --git a/projects/Win/vc14/gtest-stack.vcxproj b/projects/Win/vc14/gtest-stack.vcxproj index 24c9cca6..6dfc3752 100644 --- a/projects/Win/vc14/gtest-stack.vcxproj +++ b/projects/Win/vc14/gtest-stack.vcxproj @@ -152,7 +152,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -167,7 +167,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -182,7 +182,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -197,7 +197,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-striped-map.vcxproj b/projects/Win/vc14/gtest-striped-map.vcxproj index d0b72261..ab47b69d 100644 --- a/projects/Win/vc14/gtest-striped-map.vcxproj +++ b/projects/Win/vc14/gtest-striped-map.vcxproj @@ -170,7 +170,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -186,7 +186,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -202,7 +202,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -218,7 +218,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-striped-set.vcxproj b/projects/Win/vc14/gtest-striped-set.vcxproj index d758bc30..7b31e32b 100644 --- a/projects/Win/vc14/gtest-striped-set.vcxproj +++ b/projects/Win/vc14/gtest-striped-set.vcxproj @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -238,7 +238,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/gtest-tree.vcxproj b/projects/Win/vc14/gtest-tree.vcxproj index 89aa7224..b2b462d6 100644 --- a/projects/Win/vc14/gtest-tree.vcxproj +++ b/projects/Win/vc14/gtest-tree.vcxproj @@ -256,7 +256,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -272,7 +272,7 @@ Console - true + DebugFastLink $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -288,7 +288,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) @@ -304,7 +304,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-freelist.vcxproj b/projects/Win/vc14/stress-freelist.vcxproj index 221700de..2edee2cd 100644 --- a/projects/Win/vc14/stress-freelist.vcxproj +++ b/projects/Win/vc14/stress-freelist.vcxproj @@ -145,7 +145,7 @@ Console - true + DebugFastLink $(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) @@ -160,7 +160,7 @@ Console - true + DebugFastLink $(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) @@ -175,7 +175,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-delodd.vcxproj b/projects/Win/vc14/stress-map-delodd.vcxproj index 3a925491..a3748aae 100644 --- a/projects/Win/vc14/stress-map-delodd.vcxproj +++ b/projects/Win/vc14/stress-map-delodd.vcxproj @@ -172,7 +172,7 @@ Console - true + DebugFastLink $(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) @@ -188,7 +188,7 @@ Console - true + DebugFastLink $(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) @@ -204,7 +204,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -220,7 +220,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-find_int.vcxproj b/projects/Win/vc14/stress-map-find_int.vcxproj index 65d0f609..82b1004a 100644 --- a/projects/Win/vc14/stress-map-find_int.vcxproj +++ b/projects/Win/vc14/stress-map-find_int.vcxproj @@ -174,7 +174,7 @@ Console - true + DebugFastLink $(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) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(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) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-find_string.vcxproj b/projects/Win/vc14/stress-map-find_string.vcxproj index 35c63181..16c36646 100644 --- a/projects/Win/vc14/stress-map-find_string.vcxproj +++ b/projects/Win/vc14/stress-map-find_string.vcxproj @@ -188,7 +188,7 @@ Console - true + DebugFastLink $(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) @@ -204,7 +204,7 @@ Console - true + DebugFastLink $(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) @@ -220,7 +220,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -236,7 +236,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insdel-func.vcxproj b/projects/Win/vc14/stress-map-insdel-func.vcxproj index cc82ac02..03c4723f 100644 --- a/projects/Win/vc14/stress-map-insdel-func.vcxproj +++ b/projects/Win/vc14/stress-map-insdel-func.vcxproj @@ -173,7 +173,7 @@ Console - true + DebugFastLink $(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) @@ -189,7 +189,7 @@ Console - true + DebugFastLink $(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) @@ -205,7 +205,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -221,7 +221,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insdel-int.vcxproj b/projects/Win/vc14/stress-map-insdel-int.vcxproj index 722dd331..a7af9239 100644 --- a/projects/Win/vc14/stress-map-insdel-int.vcxproj +++ b/projects/Win/vc14/stress-map-insdel-int.vcxproj @@ -174,7 +174,7 @@ Console - true + DebugFastLink $(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) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(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) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insdel-item-int.vcxproj b/projects/Win/vc14/stress-map-insdel-item-int.vcxproj index 51ced9e9..e09d7750 100644 --- a/projects/Win/vc14/stress-map-insdel-item-int.vcxproj +++ b/projects/Win/vc14/stress-map-insdel-item-int.vcxproj @@ -173,7 +173,7 @@ Console - true + DebugFastLink $(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) @@ -189,7 +189,7 @@ Console - true + DebugFastLink $(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) @@ -205,7 +205,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -221,7 +221,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insdel-string.vcxproj b/projects/Win/vc14/stress-map-insdel-string.vcxproj index 0fd8dbb9..b5b77175 100644 --- a/projects/Win/vc14/stress-map-insdel-string.vcxproj +++ b/projects/Win/vc14/stress-map-insdel-string.vcxproj @@ -181,7 +181,7 @@ Console - true + DebugFastLink $(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) @@ -197,7 +197,7 @@ Console - true + DebugFastLink $(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) @@ -213,7 +213,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -229,7 +229,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insdelfind.vcxproj b/projects/Win/vc14/stress-map-insdelfind.vcxproj index 6f7fb2bb..3cd3e6a5 100644 --- a/projects/Win/vc14/stress-map-insdelfind.vcxproj +++ b/projects/Win/vc14/stress-map-insdelfind.vcxproj @@ -174,7 +174,7 @@ Console - true + DebugFastLink $(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) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(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) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-map-insfind-int.vcxproj b/projects/Win/vc14/stress-map-insfind-int.vcxproj index 0867818b..e054e6af 100644 --- a/projects/Win/vc14/stress-map-insfind-int.vcxproj +++ b/projects/Win/vc14/stress-map-insfind-int.vcxproj @@ -174,7 +174,7 @@ Console - true + DebugFastLink $(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) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(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) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-pqueue.vcxproj b/projects/Win/vc14/stress-pqueue.vcxproj index 3c32f120..20e765a2 100644 --- a/projects/Win/vc14/stress-pqueue.vcxproj +++ b/projects/Win/vc14/stress-pqueue.vcxproj @@ -157,7 +157,7 @@ Console - true + DebugFastLink $(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) @@ -172,7 +172,7 @@ Console - true + DebugFastLink $(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) @@ -187,7 +187,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -202,7 +202,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-queue.vcxproj b/projects/Win/vc14/stress-queue.vcxproj index e2184cd8..000aceca 100644 --- a/projects/Win/vc14/stress-queue.vcxproj +++ b/projects/Win/vc14/stress-queue.vcxproj @@ -183,7 +183,7 @@ Console - true + DebugFastLink $(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) @@ -198,7 +198,7 @@ Console - true + DebugFastLink $(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) @@ -213,7 +213,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -228,7 +228,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-set-delodd.vcxproj b/projects/Win/vc14/stress-set-delodd.vcxproj index f1b71ec9..504174a9 100644 --- a/projects/Win/vc14/stress-set-delodd.vcxproj +++ b/projects/Win/vc14/stress-set-delodd.vcxproj @@ -174,7 +174,7 @@ Console - true + DebugFastLink $(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) @@ -190,7 +190,7 @@ Console - true + DebugFastLink $(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) @@ -206,7 +206,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -222,7 +222,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-set-insdel_func.vcxproj b/projects/Win/vc14/stress-set-insdel_func.vcxproj index 0aced871..ad8d90fe 100644 --- a/projects/Win/vc14/stress-set-insdel_func.vcxproj +++ b/projects/Win/vc14/stress-set-insdel_func.vcxproj @@ -172,7 +172,7 @@ Console - true + DebugFastLink $(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) @@ -188,7 +188,7 @@ Console - true + DebugFastLink $(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) @@ -204,7 +204,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -220,7 +220,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-set-insdel_string.vcxproj b/projects/Win/vc14/stress-set-insdel_string.vcxproj index 4c22fc70..c25bd838 100644 --- a/projects/Win/vc14/stress-set-insdel_string.vcxproj +++ b/projects/Win/vc14/stress-set-insdel_string.vcxproj @@ -180,7 +180,7 @@ Console - true + DebugFastLink $(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) @@ -196,7 +196,7 @@ Console - true + DebugFastLink $(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) @@ -212,7 +212,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -228,7 +228,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-set-insdelfind.vcxproj b/projects/Win/vc14/stress-set-insdelfind.vcxproj index e7cb6e8f..a3ab653b 100644 --- a/projects/Win/vc14/stress-set-insdelfind.vcxproj +++ b/projects/Win/vc14/stress-set-insdelfind.vcxproj @@ -169,7 +169,7 @@ Console - true + DebugFastLink $(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) @@ -185,7 +185,7 @@ Console - true + DebugFastLink $(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) @@ -201,7 +201,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -217,7 +217,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-set-iteration.vcxproj b/projects/Win/vc14/stress-set-iteration.vcxproj index bb410bd5..41b1a5d4 100644 --- a/projects/Win/vc14/stress-set-iteration.vcxproj +++ b/projects/Win/vc14/stress-set-iteration.vcxproj @@ -153,7 +153,7 @@ Console - true + DebugFastLink $(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) @@ -169,7 +169,7 @@ Console - true + DebugFastLink $(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) @@ -185,7 +185,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -201,7 +201,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/projects/Win/vc14/stress-stack.vcxproj b/projects/Win/vc14/stress-stack.vcxproj index 4e936da1..f346dbec 100644 --- a/projects/Win/vc14/stress-stack.vcxproj +++ b/projects/Win/vc14/stress-stack.vcxproj @@ -152,7 +152,7 @@ Console - true + DebugFastLink $(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) @@ -167,7 +167,7 @@ Console - true + DebugFastLink $(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) @@ -182,7 +182,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) @@ -197,7 +197,7 @@ Console - true + DebugFastLink $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) diff --git a/test/unit/intrusive-set/intrusive_split_iterable_dhp.cpp b/test/unit/intrusive-set/intrusive_split_iterable_dhp.cpp index 211f9282..b355e5e3 100644 --- a/test/unit/intrusive-set/intrusive_split_iterable_dhp.cpp +++ b/test/unit/intrusive-set/intrusive_split_iterable_dhp.cpp @@ -59,7 +59,7 @@ namespace { void TearDown() { cds::threading::Manager::detachThread(); - cds::gc::hp::GarbageCollector::Destruct(); + cds::gc::dhp::GarbageCollector::Destruct(); } }; diff --git a/test/unit/set/CMakeLists.txt b/test/unit/set/CMakeLists.txt index 8178121d..104f234a 100644 --- a/test/unit/set/CMakeLists.txt +++ b/test/unit/set/CMakeLists.txt @@ -35,6 +35,8 @@ set(CDSGTEST_SET_SOURCES skiplist_rcu_gpt.cpp skiplist_rcu_shb.cpp skiplist_rcu_sht.cpp + split_iterable_hp.cpp + split_iterable_dhp.cpp split_lazy_hp.cpp split_lazy_dhp.cpp split_lazy_nogc.cpp diff --git a/test/unit/set/split_iterable_dhp.cpp b/test/unit/set/split_iterable_dhp.cpp new file mode 100644 index 00000000..8ac28c9b --- /dev/null +++ b/test/unit/set/split_iterable_dhp.cpp @@ -0,0 +1,255 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "test_split_iterable_hp.h" + +#include +#include +#include + +namespace { + namespace cc = cds::container; + typedef cds::gc::DHP gc_type; + + class SplitListIterableSet_DHP : public cds_test::split_iterable_set_hp + { + protected: + typedef cds_test::split_iterable_set_hp base_class; + + void SetUp() + { + struct set_traits: public cc::split_list::traits { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + cds::gc::dhp::GarbageCollector::Construct( 16, set_type::c_nHazardPtrCount ); + cds::threading::Manager::attachThread(); + } + + void TearDown() + { + cds::threading::Manager::detachThread(); + cds::gc::dhp::GarbageCollector::Destruct(); + } + }; + + TEST_F( SplitListIterableSet_DHP, compare ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::compare< cmp > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, less ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::less< less > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, cmpmix ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::less< less > + , cds::opt::compare< cmp > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, item_counting ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef base_class::less less; + typedef cds::backoff::empty back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, stat ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cc::split_list::stat<> stat; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef base_class::less less; + typedef cds::opt::v::sequential_consistent memory_model; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, back_off ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::backoff::yield back_off; + typedef cds::opt::v::sequential_consistent memory_model; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 3 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, free_list ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::intrusive::FreeList free_list; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 3 ); + test( s ); + } + + struct set_static_traits: public cc::split_list::traits + { + static bool const dynamic_bucket_table = false; + }; + + TEST_F( SplitListIterableSet_DHP, static_bucket_table ) + { + struct set_traits: public set_static_traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + + TEST_F( SplitListIterableSet_DHP, static_bucket_table_free_list ) + { + struct set_traits: public set_static_traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::intrusive::FreeList free_list; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + +} // namespace diff --git a/test/unit/set/split_iterable_hp.cpp b/test/unit/set/split_iterable_hp.cpp new file mode 100644 index 00000000..86f39717 --- /dev/null +++ b/test/unit/set/split_iterable_hp.cpp @@ -0,0 +1,256 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "test_split_iterable_hp.h" + +#include +#include +#include + +namespace { + namespace cc = cds::container; + typedef cds::gc::HP gc_type; + + class SplitListIterableSet_HP : public cds_test::split_iterable_set_hp + { + protected: + typedef cds_test::split_iterable_set_hp base_class; + + void SetUp() + { + struct set_traits: public cc::split_list::traits { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + // +3 - for guarded_ptr + cds::gc::hp::GarbageCollector::Construct( set_type::c_nHazardPtrCount + 3, 1, 16 ); + cds::threading::Manager::attachThread(); + } + + void TearDown() + { + cds::threading::Manager::detachThread(); + cds::gc::hp::GarbageCollector::Destruct( true ); + } + }; + + TEST_F( SplitListIterableSet_HP, compare ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::compare< cmp > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, less ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::less< less > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, cmpmix ) + { + typedef cc::SplitListSet< gc_type, int_item, + typename cc::split_list::make_traits< + cc::split_list::ordered_list< cc::iterable_list_tag > + , cds::opt::hash< hash_int > + , cc::split_list::ordered_list_traits< + typename cc::iterable_list::make_traits< + cds::opt::less< less > + , cds::opt::compare< cmp > + >::type + > + >::type + > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, item_counting ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef base_class::less less; + typedef cds::backoff::empty back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, stat ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cc::split_list::stat<> stat; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef base_class::less less; + typedef cds::opt::v::sequential_consistent memory_model; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, back_off ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::backoff::yield back_off; + typedef cds::opt::v::sequential_consistent memory_model; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 3 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, free_list ) + { + struct set_traits: public cc::split_list::traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::intrusive::FreeList free_list; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 3 ); + test( s ); + } + + struct set_static_traits: public cc::split_list::traits + { + static bool const dynamic_bucket_table = false; + }; + + TEST_F( SplitListIterableSet_HP, static_bucket_table ) + { + struct set_traits: public set_static_traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + + TEST_F( SplitListIterableSet_HP, static_bucket_table_free_list ) + { + struct set_traits: public set_static_traits + { + typedef cc::iterable_list_tag ordered_list; + typedef hash_int hash; + typedef cds::atomicity::item_counter item_counter; + typedef cds::intrusive::FreeList free_list; + + struct ordered_list_traits: public cc::iterable_list::traits + { + typedef cmp compare; + typedef cds::backoff::pause back_off; + }; + }; + typedef cc::SplitListSet< gc_type, int_item, set_traits > set_type; + + set_type s( kSize, 4 ); + test( s ); + } + +} // namespace diff --git a/test/unit/set/test_split_iterable.h b/test/unit/set/test_split_iterable.h new file mode 100644 index 00000000..4b199a4e --- /dev/null +++ b/test/unit/set/test_split_iterable.h @@ -0,0 +1,395 @@ +/* + 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_SET_TEST_SPLIT_ITERABLE_H +#define CDSUNIT_SET_TEST_SPLIT_ITERABLE_H + +#include "test_set_data.h" + +#include + +namespace cds_test { + + class split_iterable_set : public container_set_data + { + protected: + template + void test( Set& s ) + { + // Precondition: set is empty + // Postcondition: set is empty + + ASSERT_TRUE( s.empty() ); + ASSERT_CONTAINER_SIZE( s, 0 ); + size_t const nSetSize = kSize; + + typedef typename Set::value_type value_type; + + std::vector< value_type > data; + std::vector< size_t> indices; + data.reserve( kSize ); + indices.reserve( kSize ); + for ( size_t key = 0; key < kSize; ++key ) { + data.push_back( value_type( static_cast(key) ) ); + indices.push_back( key ); + } + shuffle( indices.begin(), indices.end() ); + + // insert/find + for ( auto idx : indices ) { + auto& i = data[idx]; + + EXPECT_FALSE( s.contains( i.nKey ) ); + EXPECT_FALSE( s.contains( i ) ); + EXPECT_FALSE( s.contains( other_item( i.key() ), other_less())); + EXPECT_FALSE( s.find( i.nKey, []( value_type&, int ) {} )); + EXPECT_FALSE( s.find( i, []( value_type&, value_type const& ) {} )); + EXPECT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} )); + + EXPECT_TRUE( s.find( i.nKey ) == s.end() ); + EXPECT_TRUE( s.find( i ) == s.end() ); + EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less() ) == s.end() ); + + std::pair updResult; + + std::string str; + updResult = s.update( i.key(), []( value_type&, value_type* ) + { + ASSERT_TRUE( false ); + }, false ); + EXPECT_FALSE( updResult.first ); + EXPECT_FALSE( updResult.second ); + + switch ( idx % 10 ) { + case 0: + EXPECT_TRUE( s.insert( i )); + EXPECT_FALSE( s.insert( i )); + updResult = s.update( i, []( value_type& cur, value_type* old ) + { + EXPECT_FALSE( old == nullptr ); + EXPECT_EQ( cur.key(), old->key() ); + }, false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + break; + case 1: + EXPECT_TRUE( s.insert( i.key() )); + EXPECT_FALSE( s.insert( i.key() )); + updResult = s.update( i.key(), []( value_type& cur, value_type* old ) + { + EXPECT_FALSE( old == nullptr ); + EXPECT_EQ( cur.key(), old->key() ); + }, false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + break; + case 2: + EXPECT_TRUE( s.insert( i, []( value_type& v ) { ++v.nFindCount; } )); + EXPECT_FALSE( s.insert( i, []( value_type& v ) { ++v.nFindCount; } )); + EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) + { + EXPECT_EQ( v.key(), key ); + EXPECT_EQ( v.nFindCount, 1u ); + })); + break; + case 3: + EXPECT_TRUE( s.insert( i.key(), []( value_type& v ) { ++v.nFindCount; } )); + EXPECT_FALSE( s.insert( i.key(), []( value_type& v ) { ++v.nFindCount; } )); + EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) + { + EXPECT_EQ( v.key(), key ); + EXPECT_EQ( v.nFindCount, 1u ); + })); + break; + case 4: + updResult = s.update( i, []( value_type& v, value_type* old ) + { + EXPECT_TRUE( old == nullptr ); + ++v.nUpdateNewCount; + }); + EXPECT_TRUE( updResult.first ); + EXPECT_TRUE( updResult.second ); + + updResult = s.update( i, []( value_type& v, value_type* old ) + { + EXPECT_FALSE( old == nullptr ); + EXPECT_EQ( v.key(), old->key() ); + v.nUpdateNewCount = old->nUpdateNewCount + 1; + }, false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + + EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) + { + EXPECT_EQ( v.key(), key ); + EXPECT_EQ( v.nUpdateNewCount, 2u ); + })); + break; + case 5: + updResult = s.update( i.key(), [&i]( value_type& v, value_type* old ) + { + EXPECT_TRUE( old == nullptr ); + EXPECT_EQ( i.key(), v.key() ); + ++v.nUpdateNewCount; + }); + EXPECT_TRUE( updResult.first ); + EXPECT_TRUE( updResult.second ); + + updResult = s.update( i.key(), []( value_type& v, value_type* old ) + { + EXPECT_FALSE( old == nullptr ); + EXPECT_EQ( v.key(), old->key() ); + v.nUpdateNewCount = old->nUpdateNewCount + 1; + }, false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + + EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) + { + EXPECT_EQ( v.key(), arg.key() ); + EXPECT_EQ( v.nUpdateNewCount, 2u ); + })); + break; + case 6: + EXPECT_TRUE( s.emplace( i.key())); + EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) + { + EXPECT_EQ( v.key(), arg.key() ); + EXPECT_EQ( v.nVal, arg.nVal ); + })); + break; + case 7: + str = "Hello!"; + EXPECT_TRUE( s.emplace( i.key(), std::move( str ))); + EXPECT_TRUE( str.empty()); + EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) + { + EXPECT_EQ( v.key(), arg.key() ); + EXPECT_EQ( v.nVal, arg.nVal ); + EXPECT_EQ( v.strVal, std::string( "Hello!" )); + } ) ); + break; + case 8: + { + updResult = s.upsert( i.key(), false ); + EXPECT_FALSE( updResult.first ); + EXPECT_FALSE( updResult.second ); + EXPECT_TRUE( s.find( i.key() ) == s.end() ); + + updResult = s.upsert( i.key() ); + EXPECT_TRUE( updResult.first ); + EXPECT_TRUE( updResult.second ); + + auto it = s.find( i.key() ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + + updResult = s.upsert( i.key(), false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + + EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) + { + EXPECT_EQ( v.key(), arg.key() ); + } )); + } + break; + case 9: + { + updResult = s.upsert( i, false ); + EXPECT_FALSE( updResult.first ); + EXPECT_FALSE( updResult.second ); + EXPECT_TRUE( s.find( i ) == s.end() ); + + updResult = s.upsert( i ); + EXPECT_TRUE( updResult.first ); + EXPECT_TRUE( updResult.second ); + + auto it = s.find( i ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + + updResult = s.upsert( i, false ); + EXPECT_TRUE( updResult.first ); + EXPECT_FALSE( updResult.second ); + + EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) + { + EXPECT_EQ( v.key(), arg.key() ); + } )); + } + break; + + default: + // forgot anything?.. + ASSERT_TRUE( false ); + } + + EXPECT_TRUE( s.contains( i.nKey ) ); + EXPECT_TRUE( s.contains( i ) ); + EXPECT_TRUE( s.contains( other_item( i.key() ), other_less() ) ); + EXPECT_TRUE( s.find( i.nKey, []( value_type&, int ) {} ) ); + EXPECT_TRUE( s.find( i, []( value_type&, value_type const& ) {} ) ); + EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type&, other_item const& ) {} ) ); + + auto it = s.find( i ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + + it = s.find_with( other_item( i.key() ), other_less() ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + } + + EXPECT_FALSE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, nSetSize ); + + // erase + shuffle( indices.begin(), indices.end() ); + for ( auto idx : indices ) { + auto& i = data[idx]; + + EXPECT_TRUE( s.contains( i.nKey ) ); + EXPECT_TRUE( s.contains( i ) ); + EXPECT_TRUE( s.contains( other_item( i.key() ), other_less() ) ); + EXPECT_TRUE( s.find( i.nKey, []( value_type& v, int ) + { + v.nFindCount = 1; + })); + EXPECT_TRUE( s.find( i, []( value_type& v, value_type const& ) + { + EXPECT_EQ( ++v.nFindCount, 2u ); + })); + EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& ) + { + EXPECT_EQ( ++v.nFindCount, 3u ); + })); + + auto it = s.find( i ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + it = s.find_with( other_item( i.key() ), other_less() ); + ASSERT_FALSE( it == s.end() ); + EXPECT_EQ( it->key(), i.key() ); + + + int nKey = i.key() - 1; + switch ( idx % 6 ) { + case 0: + EXPECT_TRUE( s.erase( i.key())); + EXPECT_FALSE( s.erase( i.key())); + break; + case 1: + EXPECT_TRUE( s.erase( i )); + EXPECT_FALSE( s.erase( i )); + break; + case 2: + EXPECT_TRUE( s.erase_with( other_item( i.key()), other_less())); + EXPECT_FALSE( s.erase_with( other_item( i.key() ), other_less() ) ); + break; + case 3: + EXPECT_TRUE( s.erase( i.key(), [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey ); + + nKey = i.key() - 1; + EXPECT_FALSE( s.erase( i.key(), [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey + 1 ); + break; + case 4: + EXPECT_TRUE( s.erase( i, [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey ); + + nKey = i.key() - 1; + EXPECT_FALSE( s.erase( i, [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey + 1 ); + break; + case 5: + EXPECT_TRUE( s.erase_with( other_item( i.key()), other_less(), [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey ); + + nKey = i.key() - 1; + EXPECT_FALSE( s.erase_with( other_item( i.key()), other_less(), [&nKey]( value_type const& v ) + { + nKey = v.key(); + } )); + EXPECT_EQ( i.key(), nKey + 1 ); + break; + } + + EXPECT_FALSE( s.contains( i.nKey ) ); + EXPECT_FALSE( s.contains( i ) ); + EXPECT_FALSE( s.contains( other_item( i.key() ), other_less())); + EXPECT_FALSE( s.find( i.nKey, []( value_type&, int ) {} )); + EXPECT_FALSE( s.find( i, []( value_type&, value_type const& ) {} )); + EXPECT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} )); + + EXPECT_TRUE( s.find( i.nKey ) == s.end() ); + EXPECT_TRUE( s.find( i ) == s.end() ); + EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less() ) == s.end() ); + } + EXPECT_TRUE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, 0u ); + + // clear + for ( auto& i : data ) { + EXPECT_TRUE( s.insert( i ) ); + } + + EXPECT_FALSE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, nSetSize ); + + s.clear(); + + EXPECT_TRUE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, 0u ); + + EXPECT_TRUE( s.begin() == s.end() ); + EXPECT_TRUE( s.cbegin() == s.cend() ); + } + }; + +} // namespace cds_test + +#endif // CDSUNIT_SET_TEST_SPLIT_ITERABLE_H diff --git a/test/unit/set/test_split_iterable_hp.h b/test/unit/set/test_split_iterable_hp.h new file mode 100644 index 00000000..1e27a71d --- /dev/null +++ b/test/unit/set/test_split_iterable_hp.h @@ -0,0 +1,153 @@ +/* + 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_SET_TEST_SPLIT_ITERABLE_HP_H +#define CDSUNIT_SET_TEST_SPLIT_ITERABLE_HP_H + +#include "test_split_iterable.h" + +namespace cds_test { + + class split_iterable_set_hp: public split_iterable_set + { + typedef split_iterable_set base_class; + + protected: + template + void test( Set& s ) + { + // Precondition: set is empty + // Postcondition: set is empty + + ASSERT_TRUE( s.empty() ); + ASSERT_CONTAINER_SIZE( s, 0 ); + + base_class::test( s ); + + typedef typename Set::value_type value_type; + + size_t const nSetSize = kSize; + std::vector< value_type > data; + std::vector< size_t> indices; + data.reserve( kSize ); + indices.reserve( kSize ); + for ( size_t key = 0; key < kSize; ++key ) { + data.push_back( value_type( static_cast(key) ) ); + indices.push_back( key ); + } + shuffle( indices.begin(), indices.end() ); + + for ( auto& i : data ) { + EXPECT_TRUE( s.insert( i ) ); + } + EXPECT_FALSE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, nSetSize ); + + // iterator test + for ( auto it = s.begin(); it != s.end(); ++it ) { + it->nFindCount = it->key() * 3; + } + + for ( auto it = s.cbegin(); it != s.cend(); ++it ) { + EXPECT_EQ( it->nFindCount, static_cast( it->key() * 3 )); + } + + typedef typename Set::guarded_ptr guarded_ptr; + guarded_ptr gp; + + // get() + for ( auto idx : indices ) { + auto& i = data[idx]; + + EXPECT_TRUE( !gp ); + switch ( idx % 3 ) { + case 0: + gp = s.get( i.key() ); + ASSERT_FALSE( !gp ); + break; + case 1: + gp = s.get( i ); + ASSERT_FALSE( !gp ); + break; + case 2: + gp = s.get_with( other_item( i.key() ), other_less() ); + ASSERT_FALSE( !gp ); + } + EXPECT_EQ( gp->key(), i.key() ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 3 )); + gp->nFindCount *= 2; + + gp.release(); + } + + // extract() + for ( auto idx : indices ) { + auto& i = data[idx]; + + EXPECT_TRUE( !gp ); + switch ( idx % 3 ) { + case 0: + gp = s.extract( i.key() ); + ASSERT_FALSE( !gp ); + break; + case 1: + gp = s.extract( i ); + ASSERT_FALSE( !gp ); + break; + case 2: + gp = s.extract_with( other_item( i.key() ), other_less() ); + ASSERT_FALSE( !gp ); + break; + } + EXPECT_EQ( gp->key(), i.key() ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 6 )); + + switch ( idx % 3 ) { + case 0: + gp = s.extract( i.key() ); + break; + case 1: + gp = s.extract( i ); + break; + case 2: + gp = s.extract_with( other_item( i.key() ), other_less() ); + break; + } + EXPECT_TRUE( !gp ); + } + + EXPECT_TRUE( s.empty() ); + EXPECT_CONTAINER_SIZE( s, 0 ); + } + + }; +} // namespace cds_test + +#endif // CDSUNIT_SET_TEST_SPLIT_ITERABLE_HP_H