3 #include "set2/set_insdelfind.h"
6 CPPUNIT_TEST_SUITE_REGISTRATION( Set_InsDelFind );
8 void Set_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg )
10 c_nSetSize = cfg.getSizeT("InitialMapSize", c_nSetSize );
11 c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
12 c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
13 c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage );
14 c_nDeletePercentage = cfg.getUInt("DeletePercentage", c_nDeletePercentage );
15 c_nDuration = cfg.getUInt("Duration", c_nDuration );
16 c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
18 c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize );
19 c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize );
20 c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold );
22 c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits);
23 c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits);
25 if ( c_nThreadCount == 0 )
26 c_nThreadCount = std::thread::hardware_concurrency();
28 CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 );
30 actions * pFirst = m_arrShuffle;
31 actions * pLast = m_arrShuffle + c_nInsertPercentage;
32 std::fill( pFirst, pLast, do_insert );
34 pLast += c_nDeletePercentage;
35 std::fill( pFirst, pLast, do_delete );
37 pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
38 std::fill( pFirst, pLast, do_find );
39 shuffle( m_arrShuffle, pLast );