Moved queue unit tests to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Sat, 6 Feb 2016 14:36:58 +0000 (17:36 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 6 Feb 2016 14:36:58 +0000 (17:36 +0300)
test/unit/queue/intrusive_fcqueue.cpp
test/unit/queue/intrusive_tsigas_queue.cpp
test/unit/queue/intrusive_vyukov_queue.cpp
test/unit/queue/test_intrusive_segmented_queue.h
tests/test-hdr/CMakeLists.txt

index 9a5fc0698bfab1fb34cd69b63c3c54d417ac6993..189cf0978f2386481ef82833e5e205b96200ae08 100644 (file)
@@ -62,6 +62,7 @@ namespace {
             {}
         };
 
+    public:
         struct disposer
         {
             template <typename T>
@@ -71,6 +72,7 @@ namespace {
             }
         };
 
+    protected:
         template <typename Queue>
         void test( Queue& q )
         {
index 526d836f4e4af0cd477bb0a27dd4333cd0e61225..2c261bca62e61eee8fc31bb172c066f104edc034 100644 (file)
@@ -35,7 +35,7 @@ namespace {
 
     class IntrusiveTsigasQueue : public cds_test::intrusive_bounded_queue
     {
-    protected:
+    public:
         struct disposer {
             void operator()( item * p )
             {
index 982040409798f3a6586030e31c8d02606ef879a3..71d48da2dfa831dc50a7b23f5020760602f0dc1e 100644 (file)
@@ -35,7 +35,7 @@ namespace {
 
     class IntrusiveVyukovQueue : public cds_test::intrusive_bounded_queue
     {
-    protected:
+    public:
         struct disposer {
             void operator()( item * p )
             {
index 59fbcfa181f6fedb936f09df965216d20cfd7073..82cab56f8fee7a6a23db9cdbc82263940f65dab2 100644 (file)
@@ -90,8 +90,8 @@ namespace cds_test {
         {\r
             typedef typename Queue::value_type value_type;\r
             val.resize( 100 );\r
-            for ( int i = 0; i < val.size(); ++i )
-                val[i].nValue = i;
+            for ( size_t i = 0; i < val.size(); ++i )
+                val[i].nValue = static_cast<int>( i );
 \r
             ASSERT_TRUE( q.empty());\r
             ASSERT_CONTAINER_SIZE( q, 0 );\r
@@ -139,13 +139,13 @@ namespace cds_test {
 
             // check that Disposer has not been called
             Queue::gc::force_dispose();
-            for ( int i = 0; i < val.size(); ++i ) {
+            for ( size_t i = 0; i < val.size(); ++i ) {
                 EXPECT_EQ( val[i].nDisposeCount, 0 );
                 EXPECT_EQ( val[i].nDispose2Count, 0 );
             }
 \r
             // clear
-            for ( int i = 0; i < val.size(); ++i )
+            for ( size_t i = 0; i < val.size(); ++i )
                 EXPECT_TRUE( q.push( val[i] ) );
             EXPECT_CONTAINER_SIZE( q, val.size());
             EXPECT_TRUE( !q.empty() );
index a16b1cdf2be4393a7d49536bead82e198741bbe8..982f7d800cdacd52406cab61c6da86e60c7769b5 100644 (file)
@@ -102,28 +102,6 @@ set(CDS_TESTHDR_LIST
     list/hdr_michael_kv_rcu_shb.cpp\r
     list/hdr_michael_kv_rcu_sht.cpp)\r
 \r
-set(CDS_TESTHDR_QUEUE\r
-    queue/hdr_queue_register.cpp\r
-    queue/hdr_intrusive_fcqueue.cpp\r
-    queue/hdr_intrusive_segmented_queue_hp.cpp\r
-    queue/hdr_intrusive_segmented_queue_dhp.cpp\r
-    queue/hdr_intrusive_tsigas_cycle_queue.cpp\r
-    queue/hdr_intrusive_vyukovmpmc_cycle_queue.cpp\r
-    queue/hdr_basketqueue_hp.cpp\r
-    queue/hdr_basketqueue_dhp.cpp\r
-    queue/hdr_fcqueue.cpp\r
-    queue/hdr_moirqueue_hp.cpp\r
-    queue/hdr_moirqueue_dhp.cpp\r
-    queue/hdr_msqueue_hp.cpp\r
-    queue/hdr_msqueue_dhp.cpp\r
-    queue/hdr_optimistic_hp.cpp\r
-    queue/hdr_optimistic_dhp.cpp\r
-    queue/hdr_rwqueue.cpp\r
-    queue/hdr_segmented_queue_hp.cpp\r
-    queue/hdr_segmented_queue_dhp.cpp\r
-    queue/hdr_tsigas_cycle_queue.cpp\r
-    queue/hdr_vyukov_mpmc_cyclic.cpp)\r
-\r
 set(CDS_TESTHDR_SET\r
     set/hdr_intrusive_feldman_hashset_hp.cpp\r
     set/hdr_intrusive_feldman_hashset_dhp.cpp\r
@@ -341,16 +319,6 @@ set(CDS_TESTHDR_OFFSETOF_LIST
     list/hdr_intrusive_michael_list_rcu_shb.cpp\r
     list/hdr_intrusive_michael_list_rcu_sht.cpp)\r
 \r
-set(CDS_TESTHDR_OFFSETOF_QUEUE\r
-    queue/hdr_intrusive_basketqueue_hp.cpp\r
-    queue/hdr_intrusive_basketqueue_dhp.cpp\r
-    queue/hdr_intrusive_moirqueue_hp.cpp\r
-    queue/hdr_intrusive_moirqueue_dhp.cpp\r
-    queue/hdr_intrusive_msqueue_hp.cpp\r
-    queue/hdr_intrusive_msqueue_dhp.cpp\r
-    queue/hdr_intrusive_optimisticqueue_hp.cpp\r
-    queue/hdr_intrusive_optimisticqueue_dhp.cpp)\r
-\r
 set(CDS_TESTHDR_OFFSETOF_TREE\r
     tree/hdr_intrusive_ellen_bintree_hp_member.cpp\r
     tree/hdr_intrusive_ellen_bintree_dhp_member.cpp\r
@@ -361,7 +329,6 @@ set(CDS_TESTHDR_OFFSETOF_TREE
     tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp)\r
 \r
 set(CDS_TESTHDR_OFFSETOF_SOURCES\r
-       ${CDS_TESTHDR_OFFSETOF_QUEUE}\r
        ${CDS_TESTHDR_OFFSETOF_MAP}\r
        ${CDS_TESTHDR_OFFSETOF_SET}\r
        ${CDS_TESTHDR_OFFSETOF_LIST}\r
@@ -374,7 +341,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
 endif(CMAKE_COMPILER_IS_GNUCC)\r
 \r
 set(CDS_TESTHDR_SOURCES\r
-    ${CDS_TESTHDR_QUEUE}\r
     ${CDS_TESTHDR_MAP}\r
     ${CDS_TESTHDR_LIST}\r
     ${CDS_TESTHDR_SET}\r