X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Fstress%2Fset%2Finsdel_find%2Fset_insdelfind.cpp;h=f0b5a7b57a1e580324adb2f6bbc361c3e79ab802;hb=8abb8f5e76bd8d723aff8078934ee30e59fa117a;hp=33b3a31f368cbb6a232bbb916e66721593359b3e;hpb=2bb66f1d159d044d2c5dad0f0f968abcb6d53287;p=libcds.git diff --git a/test/stress/set/insdel_find/set_insdelfind.cpp b/test/stress/set/insdel_find/set_insdelfind.cpp index 33b3a31f..f0b5a7b5 100644 --- a/test/stress/set/insdel_find/set_insdelfind.cpp +++ b/test/stress/set/insdel_find/set_insdelfind.cpp @@ -47,6 +47,7 @@ namespace set { size_t Set_InsDelFind::s_nFeldmanSet_ArrayBits = 4; size_t Set_InsDelFind::s_nLoadFactor = 2; + Set_InsDelFind::actions Set_InsDelFind::s_arrShuffle[Set_InsDelFind::c_nShuffleSize]; void Set_InsDelFind::SetUpTestCase() { @@ -93,6 +94,18 @@ namespace set { s_nFeldmanSet_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanSet_ArrayBits ); if ( s_nFeldmanSet_ArrayBits == 0 ) s_nFeldmanSet_ArrayBits = 2; + + actions * pFirst = s_arrShuffle; + actions * pLast = s_arrShuffle + s_nInsertPercentage; + std::fill( pFirst, pLast, do_insert ); + pFirst = pLast; + pLast += s_nDeletePercentage; + std::fill( pFirst, pLast, do_delete ); + pFirst = pLast; + pLast = s_arrShuffle + sizeof( s_arrShuffle ) / sizeof( s_arrShuffle[0] ); + if ( pFirst < pLast ) + std::fill( pFirst, pLast, do_find ); + shuffle( s_arrShuffle, pLast ); } std::vector Set_InsDelFind_LF::get_load_factors() @@ -110,5 +123,14 @@ namespace set { return lf; } - INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors())); +#ifdef CDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG + static std::string get_test_parameter_name( testing::TestParamInfo const& p ) + { + return std::to_string( p.param ); + } + INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors()), get_test_parameter_name ); +#else + INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors()) ); +#endif + } // namespace set