From: khizmax Date: Sat, 6 Feb 2016 14:36:58 +0000 (+0300) Subject: Moved queue unit tests to gtest framework X-Git-Tag: v2.2.0~408 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=228aaa8e51be91205d7889c08358c902832c79a3;p=libcds.git Moved queue unit tests to gtest framework --- diff --git a/test/unit/queue/intrusive_fcqueue.cpp b/test/unit/queue/intrusive_fcqueue.cpp index 9a5fc069..189cf097 100644 --- a/test/unit/queue/intrusive_fcqueue.cpp +++ b/test/unit/queue/intrusive_fcqueue.cpp @@ -62,6 +62,7 @@ namespace { {} }; + public: struct disposer { template @@ -71,6 +72,7 @@ namespace { } }; + protected: template void test( Queue& q ) { diff --git a/test/unit/queue/intrusive_tsigas_queue.cpp b/test/unit/queue/intrusive_tsigas_queue.cpp index 526d836f..2c261bca 100644 --- a/test/unit/queue/intrusive_tsigas_queue.cpp +++ b/test/unit/queue/intrusive_tsigas_queue.cpp @@ -35,7 +35,7 @@ namespace { class IntrusiveTsigasQueue : public cds_test::intrusive_bounded_queue { - protected: + public: struct disposer { void operator()( item * p ) { diff --git a/test/unit/queue/intrusive_vyukov_queue.cpp b/test/unit/queue/intrusive_vyukov_queue.cpp index 98204040..71d48da2 100644 --- a/test/unit/queue/intrusive_vyukov_queue.cpp +++ b/test/unit/queue/intrusive_vyukov_queue.cpp @@ -35,7 +35,7 @@ namespace { class IntrusiveVyukovQueue : public cds_test::intrusive_bounded_queue { - protected: + public: struct disposer { void operator()( item * p ) { diff --git a/test/unit/queue/test_intrusive_segmented_queue.h b/test/unit/queue/test_intrusive_segmented_queue.h index 59fbcfa1..82cab56f 100644 --- a/test/unit/queue/test_intrusive_segmented_queue.h +++ b/test/unit/queue/test_intrusive_segmented_queue.h @@ -90,8 +90,8 @@ namespace cds_test { { typedef typename Queue::value_type value_type; val.resize( 100 ); - 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( i ); ASSERT_TRUE( q.empty()); ASSERT_CONTAINER_SIZE( q, 0 ); @@ -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 ); } // 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() ); diff --git a/tests/test-hdr/CMakeLists.txt b/tests/test-hdr/CMakeLists.txt index a16b1cdf..982f7d80 100644 --- a/tests/test-hdr/CMakeLists.txt +++ b/tests/test-hdr/CMakeLists.txt @@ -102,28 +102,6 @@ set(CDS_TESTHDR_LIST list/hdr_michael_kv_rcu_shb.cpp list/hdr_michael_kv_rcu_sht.cpp) -set(CDS_TESTHDR_QUEUE - queue/hdr_queue_register.cpp - queue/hdr_intrusive_fcqueue.cpp - queue/hdr_intrusive_segmented_queue_hp.cpp - queue/hdr_intrusive_segmented_queue_dhp.cpp - queue/hdr_intrusive_tsigas_cycle_queue.cpp - queue/hdr_intrusive_vyukovmpmc_cycle_queue.cpp - queue/hdr_basketqueue_hp.cpp - queue/hdr_basketqueue_dhp.cpp - queue/hdr_fcqueue.cpp - queue/hdr_moirqueue_hp.cpp - queue/hdr_moirqueue_dhp.cpp - queue/hdr_msqueue_hp.cpp - queue/hdr_msqueue_dhp.cpp - queue/hdr_optimistic_hp.cpp - queue/hdr_optimistic_dhp.cpp - queue/hdr_rwqueue.cpp - queue/hdr_segmented_queue_hp.cpp - queue/hdr_segmented_queue_dhp.cpp - queue/hdr_tsigas_cycle_queue.cpp - queue/hdr_vyukov_mpmc_cyclic.cpp) - set(CDS_TESTHDR_SET set/hdr_intrusive_feldman_hashset_hp.cpp set/hdr_intrusive_feldman_hashset_dhp.cpp @@ -341,16 +319,6 @@ set(CDS_TESTHDR_OFFSETOF_LIST list/hdr_intrusive_michael_list_rcu_shb.cpp list/hdr_intrusive_michael_list_rcu_sht.cpp) -set(CDS_TESTHDR_OFFSETOF_QUEUE - queue/hdr_intrusive_basketqueue_hp.cpp - queue/hdr_intrusive_basketqueue_dhp.cpp - queue/hdr_intrusive_moirqueue_hp.cpp - queue/hdr_intrusive_moirqueue_dhp.cpp - queue/hdr_intrusive_msqueue_hp.cpp - queue/hdr_intrusive_msqueue_dhp.cpp - queue/hdr_intrusive_optimisticqueue_hp.cpp - queue/hdr_intrusive_optimisticqueue_dhp.cpp) - set(CDS_TESTHDR_OFFSETOF_TREE tree/hdr_intrusive_ellen_bintree_hp_member.cpp tree/hdr_intrusive_ellen_bintree_dhp_member.cpp @@ -361,7 +329,6 @@ set(CDS_TESTHDR_OFFSETOF_TREE tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp) set(CDS_TESTHDR_OFFSETOF_SOURCES - ${CDS_TESTHDR_OFFSETOF_QUEUE} ${CDS_TESTHDR_OFFSETOF_MAP} ${CDS_TESTHDR_OFFSETOF_SET} ${CDS_TESTHDR_OFFSETOF_LIST} @@ -374,7 +341,6 @@ if(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC) set(CDS_TESTHDR_SOURCES - ${CDS_TESTHDR_QUEUE} ${CDS_TESTHDR_MAP} ${CDS_TESTHDR_LIST} ${CDS_TESTHDR_SET}