Migrated StripedMap unit test to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Wed, 6 Apr 2016 21:35:43 +0000 (00:35 +0300)
committerkhizmax <libcds.dev@gmail.com>
Wed, 6 Apr 2016 21:35:43 +0000 (00:35 +0300)
projects/Win/vc14/gtest-striped-map.vcxproj
projects/Win/vc14/gtest-striped-map.vcxproj.filters
test/unit/striped-map/CMakeLists.txt
test/unit/striped-map/map_boost_flat_map.cpp [new file with mode: 0644]
test/unit/striped-map/map_boost_list.cpp [new file with mode: 0644]
test/unit/striped-map/map_boost_map.cpp [new file with mode: 0644]
test/unit/striped-map/map_boost_slist.cpp [new file with mode: 0644]
test/unit/striped-map/map_boost_unordered_map.cpp [new file with mode: 0644]
test/unit/striped-map/map_std_unordered_map.cpp [new file with mode: 0644]
test/unit/striped-map/test_striped_map.h

index f8eee533237989261f4e67427895a4e0e55e3fbb..dfd13506d9498d5f078a440c075b9f77327aeaea 100644 (file)
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CDSUNIT_ENABLE_BOOST_CONTAINER;_SCL_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_flat_map.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_list.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_map.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_slist.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_unordered_map.cpp" />
     <ClCompile Include="..\..\..\test\unit\striped-map\map_std_list.cpp" />
     <ClCompile Include="..\..\..\test\unit\striped-map\map_std_map.cpp" />
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_std_unordered_map.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\unit\striped-map\test_map.h" />
index c61d1edd6805b5cca8beb3dc494e7c3ddf3de753..97797d160ab8ff9664ab68ca4e52303ee8c90271 100644 (file)
     <ClCompile Include="..\..\..\test\unit\striped-map\map_std_map.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_std_unordered_map.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_slist.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_list.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_map.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_flat_map.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\striped-map\map_boost_unordered_map.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\unit\striped-map\test_map_data.h">
index 420f07a5ff90ea30a8b7c282500d5821b3c917eb..6b1ddc5fbc13a54fcc808f3cf42443706cf84aed 100644 (file)
@@ -5,8 +5,14 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_ENABLE_BOOST_CONTAINER")
 set(CDSGTEST_STRIPED_MAP_SOURCES
     ../main.cpp
     cuckoo_map.cpp
+    map_boost_flat_map.cpp
+    map_boost_list.cpp
+    map_boost_map.cpp
+    map_boost_slist.cpp
+    map_boost_unordered_map.cpp
     map_std_list.cpp
     map_std_map.cpp
+    map_std_unordered_map.cpp
 )
 
 include_directories(
diff --git a/test/unit/striped-map/map_boost_flat_map.cpp b/test/unit/striped-map/map_boost_flat_map.cpp
new file mode 100644 (file)
index 0000000..ebe1943
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+    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.     
+*/
+
+#ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
+
+#include <boost/version.hpp>
+#include <cds/details/defs.h>
+#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION < 105500
+    // Skipped; for Microsoft Visual C++ 2013 and boost::container::flat_map you should use boost version 1.55 or above" );
+#elif BOOST_VERSION >= 104800
+
+#include <cds/container/striped_map/boost_flat_map.h>
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef boost::container::flat_map< 
+            cds_test::striped_map_fixture::key_type,
+            cds_test::striped_map_fixture::value_type,
+            cds_test::striped_map_fixture::less
+        > container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& m, iterator /*itInsert*/, iterator itWhat )
+            {
+                m.insert( *itWhat );
+            }
+        };
+
+        static bool const c_hasFindWith = false;
+        static bool const c_hasEraseWith = false;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostFlatMap, StripedMap, test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostFlatMap, RefinableMap, test_traits );
+
+} // namespace
+
+#else // BOOST_VERSION < 104800
+// Skipped; for boost::container::flat_map you should use boost version 1.48 or above
+#endif  // BOOST_VERSION 
+
+#endif // #ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
diff --git a/test/unit/striped-map/map_boost_list.cpp b/test/unit/striped-map/map_boost_list.cpp
new file mode 100644 (file)
index 0000000..1eeed5e
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    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.     
+*/
+
+#ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
+
+#include <boost/version.hpp>
+#include <cds/details/defs.h>
+#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION < 105500
+    // Skipped; for Microsoft Visual C++ 2013 and boost::container::list you should use boost version 1.55 or above" );
+#elif BOOST_VERSION >= 104800
+
+#include <cds/container/striped_map/boost_list.h> 
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef boost::container::list< std::pair< cds_test::striped_map_fixture::key_type const, cds_test::striped_map_fixture::value_type >> container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& list, iterator itInsert, iterator itWhat )
+            {
+                list.insert( itInsert, *itWhat );
+            }
+        };
+
+        static bool const c_hasFindWith = true;
+        static bool const c_hasEraseWith = true;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostList, StripedMap, test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostList, RefinableMap, test_traits );
+
+} // namespace
+
+#else // BOOST_VERSION < 104800
+// Skipped; for boost::container::list you should use boost version 1.48 or above
+#endif  // BOOST_VERSION 
+
+#endif // #ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
diff --git a/test/unit/striped-map/map_boost_map.cpp b/test/unit/striped-map/map_boost_map.cpp
new file mode 100644 (file)
index 0000000..435998a
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+    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.     
+*/
+
+#ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
+
+#include <boost/version.hpp>
+#include <cds/details/defs.h>
+#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION < 105500
+    // Skipped; for Microsoft Visual C++ 2013 and boost::container::map you should use boost version 1.55 or above" );
+#elif BOOST_VERSION >= 104800
+
+#include <cds/container/striped_map/boost_map.h> 
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef boost::container::map< 
+            cds_test::striped_map_fixture::key_type,
+            cds_test::striped_map_fixture::value_type,
+            cds_test::striped_map_fixture::less
+        > container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& map, iterator itWhat )
+            {
+                map.insert( *itWhat );
+            }
+        };
+
+        static bool const c_hasFindWith = false;
+        static bool const c_hasEraseWith = false;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostMap, StripedMap, test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostMap, RefinableMap, test_traits );
+
+} // namespace
+
+#else // BOOST_VERSION < 104800
+// Skipped; for boost::container::map you should use boost version 1.48 or above
+#endif  // BOOST_VERSION 
+
+#endif // #ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
diff --git a/test/unit/striped-map/map_boost_slist.cpp b/test/unit/striped-map/map_boost_slist.cpp
new file mode 100644 (file)
index 0000000..4d069dd
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    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.     
+*/
+
+#ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
+
+#include <boost/version.hpp>
+#include <cds/details/defs.h>
+#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12 && BOOST_VERSION < 105500
+    // Skipped; for Microsoft Visual C++ 2013 and boost::container::slist you should use boost version 1.55 or above" );
+#elif BOOST_VERSION >= 104800
+
+#include <cds/container/striped_map/boost_slist.h> 
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef boost::container::slist< std::pair< cds_test::striped_map_fixture::key_type const, cds_test::striped_map_fixture::value_type >> container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& list, iterator itInsert, iterator itWhat )
+            {
+                list.insert_after( itInsert, *itWhat );
+            }
+        };
+
+        static bool const c_hasFindWith = true;
+        static bool const c_hasEraseWith = true;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostSList, StripedMap, test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostSList, RefinableMap, test_traits );
+
+} // namespace
+
+#else // BOOST_VERSION < 104800
+// Skipped; for boost::container::slist you should use boost version 1.48 or above
+#endif  // BOOST_VERSION 
+
+#endif // #ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
diff --git a/test/unit/striped-map/map_boost_unordered_map.cpp b/test/unit/striped-map/map_boost_unordered_map.cpp
new file mode 100644 (file)
index 0000000..40f98fd
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+    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.     
+*/
+
+#ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
+
+#include <cds/container/striped_map/boost_unordered_map.h> 
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef boost::unordered_map<
+            cds_test::striped_map_fixture::key_type
+            ,cds_test::striped_map_fixture::value_type
+            ,cds_test::striped_map_fixture::hash2
+            ,cds_test::striped_map_fixture::equal_to
+        > container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& m, iterator /*itInsert*/, iterator itWhat )
+            {
+                m.insert( *itWhat );
+            }
+        };
+
+        static bool const c_hasFindWith = false;
+        static bool const c_hasEraseWith = false;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostUnorderedMap, StripedMap, test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( BoostUnorderedMap, RefinableMap, test_traits );
+
+} // namespace
+
+#endif // #ifdef CDSUNIT_ENABLE_BOOST_CONTAINER
diff --git a/test/unit/striped-map/map_std_unordered_map.cpp b/test/unit/striped-map/map_std_unordered_map.cpp
new file mode 100644 (file)
index 0000000..df07d72
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+    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 <cds/container/striped_map/std_hash_map.h>
+#include "test_striped_map.h"
+
+namespace {
+    struct test_traits
+    {
+        typedef std::unordered_map<
+            cds_test::striped_map_fixture::key_type
+            , cds_test::striped_map_fixture::value_type
+            , cds_test::striped_map_fixture::hash2
+            , cds_test::striped_map_fixture::equal_to
+        > container_type;
+
+        struct copy_policy {
+            typedef container_type::iterator iterator;
+
+            void operator()( container_type& m, iterator /*itInsert*/, iterator itWhat )
+            {
+                m.insert( std::make_pair( itWhat->first, itWhat->second ));
+            }
+        };
+
+        static bool const c_hasFindWith = false;
+        static bool const c_hasEraseWith = false;
+    };
+
+    INSTANTIATE_TYPED_TEST_CASE_P( StdUnorderedMap, StripedMap,   test_traits );
+    INSTANTIATE_TYPED_TEST_CASE_P( StdUnorderedMap, RefinableMap, test_traits );
+
+} // namespace
index b39acb43ad9901df6d64c7b1fb4ce11d58679aa1..b5ad0c056d6923097c9d0d0845657f606ccd055e 100644 (file)
@@ -319,7 +319,6 @@ namespace {
                         ASSERT_TRUE( str.empty());
                         str = val.strVal;
                         ASSERT_FALSE( m.emplace( i, std::move( str )));
-                        ASSERT_TRUE( str.empty());
                     }
                     break;
                 case 15:
@@ -329,7 +328,6 @@ namespace {
                         ASSERT_TRUE( str.empty());
                         str = val.strVal;
                         ASSERT_FALSE( m.emplace( i, i.nKey, std::move( str )));
-                        ASSERT_TRUE( str.empty());
                     }
                     break;
                 }