From ec800e5b621b4a365aba472bb6dd0db80c2460d4 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 26 Sep 2016 23:31:53 +0300 Subject: [PATCH] Fixed minor gcc warnings --- test/unit/intrusive-set/test_intrusive_set.h | 36 +++++++++---------- .../intrusive-set/test_intrusive_set_nogc.h | 22 ++++++------ test/unit/map/michael_iterable_dhp.cpp | 6 ++-- test/unit/map/michael_iterable_hp.cpp | 6 ++-- test/unit/map/michael_lazy_dhp.cpp | 6 ++-- test/unit/map/michael_lazy_hp.cpp | 6 ++-- test/unit/map/michael_lazy_nogc.cpp | 6 ++-- test/unit/map/michael_michael_dhp.cpp | 6 ++-- test/unit/map/michael_michael_hp.cpp | 6 ++-- test/unit/map/michael_michael_nogc.cpp | 6 ++-- test/unit/map/test_michael_iterable_hp.h | 4 +-- test/unit/map/test_michael_lazy_rcu.h | 6 ++-- test/unit/map/test_michael_michael_rcu.h | 6 ++-- test/unit/misc/cxx11_atomic_class.cpp | 4 +-- test/unit/queue/intrusive_fcqueue.cpp | 6 ++-- .../queue/intrusive_segmented_queue_hp.cpp | 4 +-- test/unit/queue/test_bounded_queue.h | 2 +- test/unit/set/test_michael_iterable_hp.h | 4 +-- test/unit/set/test_set_hp.h | 10 +++--- .../unit/striped-set/intrusive_cuckoo_set.cpp | 6 ++-- test/unit/striped-set/test_striped_set.h | 12 +++---- 21 files changed, 85 insertions(+), 85 deletions(-) diff --git a/test/unit/intrusive-set/test_intrusive_set.h b/test/unit/intrusive-set/test_intrusive_set.h index 44e1aa4d..acf1f976 100644 --- a/test/unit/intrusive-set/test_intrusive_set.h +++ b/test/unit/intrusive-set/test_intrusive_set.h @@ -313,11 +313,11 @@ namespace cds_test { EXPECT_FALSE( updResult.second ); break; case 1: - EXPECT_EQ( i.nUpdateNewCount, 0 ); + EXPECT_EQ( i.nUpdateNewCount, 0u ); ASSERT_TRUE( s.insert( i, []( value_type& v ) { ++v.nUpdateNewCount;} )); - EXPECT_EQ( i.nUpdateNewCount, 1 ); + EXPECT_EQ( i.nUpdateNewCount, 1u ); ASSERT_FALSE( s.insert( i, []( value_type& v ) { ++v.nUpdateNewCount;} ) ); - EXPECT_EQ( i.nUpdateNewCount, 1 ); + EXPECT_EQ( i.nUpdateNewCount, 1u ); i.nUpdateNewCount = 0; break; case 2: @@ -334,11 +334,11 @@ namespace cds_test { ASSERT_TRUE( s.contains( i.nKey ) ); ASSERT_TRUE( s.contains( i ) ); ASSERT_TRUE( s.contains( other_item( i.key() ), other_less())); - EXPECT_EQ( i.nFindCount, 0 ); + EXPECT_EQ( i.nFindCount, 0u ); ASSERT_TRUE( s.find( i.nKey, []( value_type& v, int ) { ++v.nFindCount; } )); - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); ASSERT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& ) { ++v.nFindCount; } )); - EXPECT_EQ( i.nFindCount, 2 ); + EXPECT_EQ( i.nFindCount, 2u ); } ASSERT_FALSE( s.empty() ); ASSERT_CONTAINER_SIZE( s, nSetSize ); @@ -379,18 +379,18 @@ namespace cds_test { ASSERT_FALSE( s.erase_with( other_item( i.key() ), other_less() ) ); break; case 4: - EXPECT_EQ( i.nEraseCount, 0 ); + EXPECT_EQ( i.nEraseCount, 0u ); ASSERT_TRUE( s.erase( v, []( value_type& val ) { ++val.nEraseCount; } )); - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); ASSERT_FALSE( s.erase( v, []( value_type& val ) { ++val.nEraseCount; } )); - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); break; case 5: - EXPECT_EQ( i.nEraseCount, 0 ); + EXPECT_EQ( i.nEraseCount, 0u ); ASSERT_TRUE( s.erase_with( other_item( i.key() ), other_less(), []( value_type& val ) { ++val.nEraseCount; } )); - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); ASSERT_FALSE( s.erase_with( other_item( i.key() ), other_less(), []( value_type& val ) { ++val.nEraseCount; } )); - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); break; } @@ -401,12 +401,12 @@ namespace cds_test { ASSERT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} )); } ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); // Force retiring cycle Set::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } // clear @@ -422,24 +422,24 @@ namespace cds_test { ++it->nFindCount; } for ( auto it = s.cbegin(); it != s.cend(); ++it ) { - EXPECT_EQ( it->nFindCount, 1 ); + EXPECT_EQ( it->nFindCount, 1u ); } for ( auto& i : data ) { - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); } // clear test s.clear(); ASSERT_TRUE( s.empty()); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); ASSERT_TRUE( s.begin() == s.end() ); ASSERT_TRUE( s.cbegin() == s.cend() ); // Force retiring cycle Set::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } } diff --git a/test/unit/intrusive-set/test_intrusive_set_nogc.h b/test/unit/intrusive-set/test_intrusive_set_nogc.h index 287807d3..f4f4b2c2 100644 --- a/test/unit/intrusive-set/test_intrusive_set_nogc.h +++ b/test/unit/intrusive-set/test_intrusive_set_nogc.h @@ -303,7 +303,7 @@ namespace cds_test { case 0: ASSERT_TRUE( s.insert( i )); ASSERT_FALSE( s.insert( i )); - EXPECT_EQ( i.nUpdateCount, 0 ); + EXPECT_EQ( i.nUpdateCount, 0u ); updResult = s.update( i, []( bool bNew, value_type& val, value_type& arg) { EXPECT_FALSE( bNew ); @@ -312,7 +312,7 @@ namespace cds_test { }, false ); EXPECT_TRUE( updResult.first ); EXPECT_FALSE( updResult.second ); - EXPECT_EQ( i.nUpdateCount, 1 ); + EXPECT_EQ( i.nUpdateCount, 1u ); break; case 1: EXPECT_EQ( i.nUpdateNewCount, 0 ); @@ -324,18 +324,18 @@ namespace cds_test { }); EXPECT_TRUE( updResult.first ); EXPECT_TRUE( updResult.second ); - EXPECT_EQ( i.nUpdateNewCount, 1 ); + EXPECT_EQ( i.nUpdateNewCount, 1u ); break; } ASSERT_TRUE( s.contains( i.nKey ) == &i ); ASSERT_TRUE( s.contains( i ) == &i ); ASSERT_TRUE( s.contains( other_item( i.key() ), other_less()) == &i ); - EXPECT_EQ( i.nFindCount, 0 ); + EXPECT_EQ( i.nFindCount, 0u ); ASSERT_TRUE( s.find( i.nKey, []( value_type& v, int ) { ++v.nFindCount; } )); - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); ASSERT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& ) { ++v.nFindCount; } )); - EXPECT_EQ( i.nFindCount, 2 ); + EXPECT_EQ( i.nFindCount, 2u ); } ASSERT_FALSE( s.empty() ); ASSERT_CONTAINER_SIZE( s, nSetSize ); @@ -347,23 +347,23 @@ namespace cds_test { ++it->nFindCount; } for ( auto it = s.cbegin(); it != s.cend(); ++it ) { - EXPECT_EQ( it->nFindCount, 1 ); + EXPECT_EQ( it->nFindCount, 1u ); } for ( auto& i : data ) { - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); } // clear test for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 0 ); + EXPECT_EQ( i.nDisposeCount, 0u ); } s.clear(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } ASSERT_TRUE( s.empty()); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); ASSERT_TRUE( s.begin() == s.end() ); ASSERT_TRUE( s.cbegin() == s.cend() ); } diff --git a/test/unit/map/michael_iterable_dhp.cpp b/test/unit/map/michael_iterable_dhp.cpp index 8398ddfc..1cf595ec 100644 --- a/test/unit/map/michael_iterable_dhp.cpp +++ b/test/unit/map/michael_iterable_dhp.cpp @@ -5,7 +5,7 @@ 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: @@ -172,7 +172,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelIterableMap_DHP, wrapped_stat ) @@ -192,7 +192,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_iterable_hp.cpp b/test/unit/map/michael_iterable_hp.cpp index 71e37a0f..693762aa 100644 --- a/test/unit/map/michael_iterable_hp.cpp +++ b/test/unit/map/michael_iterable_hp.cpp @@ -5,7 +5,7 @@ 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: @@ -173,7 +173,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelIterableMap_HP, wrapped_stat ) @@ -193,7 +193,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_lazy_dhp.cpp b/test/unit/map/michael_lazy_dhp.cpp index e995945c..c1ee8ed4 100644 --- a/test/unit/map/michael_lazy_dhp.cpp +++ b/test/unit/map/michael_lazy_dhp.cpp @@ -5,7 +5,7 @@ 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: @@ -192,7 +192,7 @@ namespace { map_type m( kSize, 2 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelLazyMap_DHP, wrapped_stat ) @@ -213,7 +213,7 @@ namespace { map_type m( kSize, 2 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_lazy_hp.cpp b/test/unit/map/michael_lazy_hp.cpp index b6db024f..9ec2a16f 100644 --- a/test/unit/map/michael_lazy_hp.cpp +++ b/test/unit/map/michael_lazy_hp.cpp @@ -5,7 +5,7 @@ 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: @@ -193,7 +193,7 @@ namespace { map_type m( kSize, 2 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelLazyMap_HP, wrapped_stat ) @@ -214,7 +214,7 @@ namespace { map_type m( kSize, 2 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_lazy_nogc.cpp b/test/unit/map/michael_lazy_nogc.cpp index 293bb78e..aa7d9038 100644 --- a/test/unit/map/michael_lazy_nogc.cpp +++ b/test/unit/map/michael_lazy_nogc.cpp @@ -5,7 +5,7 @@ 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: @@ -185,7 +185,7 @@ namespace { map_type m( kSize, 4 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelLazyMap_NoGC, wrapped_stat ) @@ -207,7 +207,7 @@ namespace { map_type m( kSize, 4 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_michael_dhp.cpp b/test/unit/map/michael_michael_dhp.cpp index cfd4a2b6..bf9b602d 100644 --- a/test/unit/map/michael_michael_dhp.cpp +++ b/test/unit/map/michael_michael_dhp.cpp @@ -5,7 +5,7 @@ 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: @@ -172,7 +172,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelMap_DHP, wrapped_stat ) @@ -192,7 +192,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_michael_hp.cpp b/test/unit/map/michael_michael_hp.cpp index 4c3a7ae4..c494e36c 100644 --- a/test/unit/map/michael_michael_hp.cpp +++ b/test/unit/map/michael_michael_hp.cpp @@ -5,7 +5,7 @@ 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: @@ -173,7 +173,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelMap_HP, wrapped_stat ) @@ -194,7 +194,7 @@ namespace { map_type m( kSize, 8 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/michael_michael_nogc.cpp b/test/unit/map/michael_michael_nogc.cpp index b66e81b2..6050f002 100644 --- a/test/unit/map/michael_michael_nogc.cpp +++ b/test/unit/map/michael_michael_nogc.cpp @@ -5,7 +5,7 @@ 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: @@ -164,7 +164,7 @@ namespace { map_type m( kSize, 4 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TEST_F( MichaelMap_NoGC, wrapped_stat ) @@ -186,7 +186,7 @@ namespace { map_type m( kSize, 4 ); test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } } // namespace diff --git a/test/unit/map/test_michael_iterable_hp.h b/test/unit/map/test_michael_iterable_hp.h index 19258b62..0bf59321 100644 --- a/test/unit/map/test_michael_iterable_hp.h +++ b/test/unit/map/test_michael_iterable_hp.h @@ -5,7 +5,7 @@ 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: @@ -133,7 +133,7 @@ namespace cds_test { ASSERT_TRUE( !gp ); } EXPECT_TRUE( m.empty() ); - EXPECT_CONTAINER_SIZE( m, 0 ); + EXPECT_CONTAINER_SIZE( m, 0u ); } }; diff --git a/test/unit/map/test_michael_lazy_rcu.h b/test/unit/map/test_michael_lazy_rcu.h index 7c6c2930..2194cd72 100644 --- a/test/unit/map/test_michael_lazy_rcu.h +++ b/test/unit/map/test_michael_lazy_rcu.h @@ -5,7 +5,7 @@ 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: @@ -224,7 +224,7 @@ namespace { map_type m( TestFixture::kSize, 4 ); this->test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( MichaelLazyMap, wrapped_stat ) @@ -250,7 +250,7 @@ namespace { map_type m( TestFixture::kSize, 4 ); this->test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } diff --git a/test/unit/map/test_michael_michael_rcu.h b/test/unit/map/test_michael_michael_rcu.h index 43684bda..e40a2b5e 100644 --- a/test/unit/map/test_michael_michael_rcu.h +++ b/test/unit/map/test_michael_michael_rcu.h @@ -5,7 +5,7 @@ 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: @@ -199,7 +199,7 @@ namespace { map_type m( TestFixture::kSize, 4 ); this->test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( MichaelMap, wrapped_stat ) @@ -225,7 +225,7 @@ namespace { map_type m( TestFixture::kSize, 4 ); this->test( m ); - EXPECT_GE( m.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( m.statistics().m_nInsertSuccess, 0u ); } REGISTER_TYPED_TEST_CASE_P( MichaelMap, diff --git a/test/unit/misc/cxx11_atomic_class.cpp b/test/unit/misc/cxx11_atomic_class.cpp index 04f7d7f5..1e2548e0 100644 --- a/test/unit/misc/cxx11_atomic_class.cpp +++ b/test/unit/misc/cxx11_atomic_class.cpp @@ -225,10 +225,10 @@ namespace { for ( size_t nByte = 0; nByte < sizeof(Integral); ++nByte ) { integral_type n = integral_type(42) << (nByte * 8); - EXPECT_EQ( a.exchange( n, order ), 0 ); + EXPECT_EQ( a.exchange( n, order ), integral_type( 0 )); EXPECT_EQ( a.load( oLoad ), n ); EXPECT_EQ( a.exchange( (integral_type) 0, order ), n ); - EXPECT_EQ( a.load( oLoad ), 0 ); + EXPECT_EQ( a.load( oLoad ), integral_type( 0 )); } integral_type prev = a.load( oLoad ); diff --git a/test/unit/queue/intrusive_fcqueue.cpp b/test/unit/queue/intrusive_fcqueue.cpp index a417dae8..068fed12 100644 --- a/test/unit/queue/intrusive_fcqueue.cpp +++ b/test/unit/queue/intrusive_fcqueue.cpp @@ -124,7 +124,7 @@ namespace { // pop() doesn't call disposer for ( size_t i = 0; i < nSize; ++i ) { - ASSERT_EQ( arr[i].nDisposeCount, 0u ); + ASSERT_EQ( arr[i].nDisposeCount, 0 ); } // clear with disposer @@ -139,7 +139,7 @@ namespace { ASSERT_EQ( q.size(), 0u ); for ( size_t i = 0; i < nSize; ++i ) { - ASSERT_EQ( arr[i].nDisposeCount, 1u ); + ASSERT_EQ( arr[i].nDisposeCount, 1 ); } // clear without disposer @@ -151,7 +151,7 @@ namespace { ASSERT_EQ( q.size(), 0u ); for ( size_t i = 0; i < nSize; ++i ) { - ASSERT_EQ( arr[i].nDisposeCount, 1u ); + ASSERT_EQ( arr[i].nDisposeCount, 1 ); } } }; diff --git a/test/unit/queue/intrusive_segmented_queue_hp.cpp b/test/unit/queue/intrusive_segmented_queue_hp.cpp index b5f26ac8..85008164 100644 --- a/test/unit/queue/intrusive_segmented_queue_hp.cpp +++ b/test/unit/queue/intrusive_segmented_queue_hp.cpp @@ -63,8 +63,8 @@ namespace { void check_array( V& arr ) { for ( size_t i = 0; i < arr.size(); ++i ) { - EXPECT_EQ( arr[i].nDisposeCount, 2 ); - EXPECT_EQ( arr[i].nDispose2Count, 1 ); + EXPECT_EQ( arr[i].nDisposeCount, 2u ); + EXPECT_EQ( arr[i].nDispose2Count, 1u ); } } }; diff --git a/test/unit/queue/test_bounded_queue.h b/test/unit/queue/test_bounded_queue.h index 28f1153a..ff7ffa17 100644 --- a/test/unit/queue/test_bounded_queue.h +++ b/test/unit/queue/test_bounded_queue.h @@ -107,7 +107,7 @@ namespace cds_test { ASSERT_TRUE( q.pop_with( f )); else ASSERT_TRUE( q.dequeue_with( f )); - ASSERT_EQ( it, i ); + ASSERT_EQ( it, static_cast( i )); ASSERT_CONTAINER_SIZE( q, nSize - i - 1 ); } ASSERT_TRUE( q.empty() ); diff --git a/test/unit/set/test_michael_iterable_hp.h b/test/unit/set/test_michael_iterable_hp.h index ca75015e..a9f20ca8 100644 --- a/test/unit/set/test_michael_iterable_hp.h +++ b/test/unit/set/test_michael_iterable_hp.h @@ -101,7 +101,7 @@ namespace cds_test { ASSERT_FALSE( !gp ); } EXPECT_EQ( gp->key(), i.key() ); - EXPECT_EQ( gp->nFindCount, i.key() * 3 ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 3 )); gp->nFindCount *= 2; gp.release(); @@ -127,7 +127,7 @@ namespace cds_test { break; } EXPECT_EQ( gp->key(), i.key() ); - EXPECT_EQ( gp->nFindCount, i.key() * 6 ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 6 )); switch ( idx % 3 ) { case 0: diff --git a/test/unit/set/test_set_hp.h b/test/unit/set/test_set_hp.h index dd5b3513..3f099fad 100644 --- a/test/unit/set/test_set_hp.h +++ b/test/unit/set/test_set_hp.h @@ -5,7 +5,7 @@ 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: @@ -25,7 +25,7 @@ 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. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_SET_TEST_SET_HP_H @@ -76,7 +76,7 @@ namespace cds_test { } for ( auto it = s.cbegin(); it != s.cend(); ++it ) { - EXPECT_EQ( it->nFindCount, it->key() * 3 ); + EXPECT_EQ( it->nFindCount, static_cast( it->key() * 3 )); } typedef typename Set::guarded_ptr guarded_ptr; @@ -101,7 +101,7 @@ namespace cds_test { ASSERT_FALSE( !gp ); } EXPECT_EQ( gp->key(), i.key() ); - EXPECT_EQ( gp->nFindCount, i.key() * 3 ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 3 )); gp->nFindCount *= 2; gp.release(); @@ -127,7 +127,7 @@ namespace cds_test { break; } EXPECT_EQ( gp->key(), i.key() ); - EXPECT_EQ( gp->nFindCount, i.key() * 6 ); + EXPECT_EQ( gp->nFindCount, static_cast( i.key() * 6 )); switch ( idx % 3 ) { case 0: diff --git a/test/unit/striped-set/intrusive_cuckoo_set.cpp b/test/unit/striped-set/intrusive_cuckoo_set.cpp index 05692fb8..bddda565 100644 --- a/test/unit/striped-set/intrusive_cuckoo_set.cpp +++ b/test/unit/striped-set/intrusive_cuckoo_set.cpp @@ -5,7 +5,7 @@ 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: @@ -25,7 +25,7 @@ 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. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test_intrusive_set.h" @@ -67,7 +67,7 @@ namespace { ASSERT_TRUE( s.empty() ); ASSERT_CONTAINER_SIZE( s, 0 ); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } } diff --git a/test/unit/striped-set/test_striped_set.h b/test/unit/striped-set/test_striped_set.h index 5fb4a043..fed3e069 100644 --- a/test/unit/striped-set/test_striped_set.h +++ b/test/unit/striped-set/test_striped_set.h @@ -199,7 +199,7 @@ namespace { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); } ) ); break; case 3: @@ -208,7 +208,7 @@ namespace { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); } ) ); break; case 4: @@ -310,10 +310,10 @@ namespace { } )); ASSERT_TRUE( s.find( i, []( value_type& v, value_type const& ) { - EXPECT_EQ( ++v.nFindCount, 2 ); + EXPECT_EQ( ++v.nFindCount, 2u ); } )); ASSERT_TRUE( (call_find_with< c_hasFindWith, Set >()(s, i.key(), []( value_type& v, other_item const& ) { - EXPECT_EQ( ++v.nFindCount, 3 ); + EXPECT_EQ( ++v.nFindCount, 3u ); }))); int nKey = i.key() - 1; @@ -382,7 +382,7 @@ namespace { ASSERT_FALSE( (call_find_with()( s, i.key(), []( value_type&, other_item const& ) {}))); } ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); // clear @@ -396,7 +396,7 @@ namespace { s.clear(); ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); } }; -- 2.34.1