X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Fstress%2Fqueue%2Frandom.cpp;h=ea30b8ebbe3db88c18a989de2070840fdd0c8996;hb=056d289619d45ccf1055c18d63cb3bad072a71a0;hp=1f499841ad0dd7744ee13ca9b9a1725fd5867021;hpb=562e9921b65f98d5018938f4f692247a82f5f312;p=libcds.git diff --git a/test/stress/queue/random.cpp b/test/stress/queue/random.cpp index 1f499841..ea30b8eb 100644 --- a/test/stress/queue/random.cpp +++ b/test/stress/queue/random.cpp @@ -1,11 +1,11 @@ /* This file is a part of libcds - Concurrent Data Structures library - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017 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: @@ -161,26 +161,26 @@ namespace { }; public: - static void SetUpTestCase() - { - cds_test::config const& cfg = get_config( "queue_random" ); - + static void SetUpTestCase() + { + cds_test::config const& cfg = get_config( "queue_random" ); + s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; - } - - //static void TearDownTestCase(); + } + + //static void TearDownTestCase(); protected: template void analyze( Queue& q ) { - EXPECT_TRUE( q.empty() ); + EXPECT_TRUE( q.empty()); std::vector< size_t > arrPushCount; arrPushCount.resize( s_nThreadCount, 0 ); @@ -192,9 +192,9 @@ namespace { cds_test::thread_pool& pool = get_pool(); for ( size_t i = 0; i < pool.size(); ++i ) { Strain& thr = static_cast &>( pool.get(i)); - EXPECT_EQ( thr.m_nUndefWriter, 0 ); - EXPECT_EQ( thr.m_nRepeatValue, 0 ); - EXPECT_EQ( thr.m_nPushError, 0 ); + EXPECT_EQ( thr.m_nUndefWriter, 0u ); + EXPECT_EQ( thr.m_nRepeatValue, 0u ); + EXPECT_EQ( thr.m_nPushError, 0u ); nPushError += thr.m_nPushError; arrPushCount[ thr.id() ] += thr.m_nPushCount; @@ -252,7 +252,6 @@ namespace { test( queue ); \ } - CDSSTRESS_TsigasQueue( queue_random ) CDSSTRESS_VyukovQueue( queue_random ) #undef CDSSTRESS_Queue_F