X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=test%2Fstress%2Fset%2Finsdel_find%2Fset_insdelfind.h;h=a8778307dcd21bfc01079e4f4ea13be67fd6c7b6;hp=a262a877ab9acd649c98db8bb81088ae91c808ce;hb=755e340bdd34d88c52e7aa4f1b08395c3cdca816;hpb=498411c2f35240013f69cc7e319e303a36b53860 diff --git a/test/stress/set/insdel_find/set_insdelfind.h b/test/stress/set/insdel_find/set_insdelfind.h index a262a877..a8778307 100644 --- a/test/stress/set/insdel_find/set_insdelfind.h +++ b/test/stress/set/insdel_find/set_insdelfind.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. */ #include "set_type.h" @@ -107,8 +107,10 @@ namespace set { unsigned int i = 0; size_t const nNormalize = size_t(-1) / ( fixture.s_nSetSize * 2); + typedef typename Set::value_type value_type; + size_t nRand = 0; - while ( !time_elapsed() ) { + while ( !time_elapsed()) { nRand = cds::bitop::RandXorShift(nRand); size_t n = nRand / nNormalize; switch ( pAct[i] ) { @@ -152,7 +154,7 @@ namespace set { pInitArr[i] = i * 2 + 1; shuffle( pInitArr, pEnd ); for ( size_t * p = pInitArr; p < pEnd; ++p ) - testSet.insert( typename Set::value_type( *p, *p ) ); + testSet.insert( typename Set::value_type( *p, *p )); delete [] pInitArr; } @@ -196,7 +198,7 @@ namespace set { { ASSERT_TRUE( std::chrono::duration_cast(duration).count() > 0 ); size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed; - propout() << std::make_pair( "avg_speed", nTotalOps / std::chrono::duration_cast(duration).count() ); + propout() << std::make_pair( "avg_speed", nTotalOps / std::chrono::duration_cast(duration).count()); }