3 #include "map2/map_find_string.h"
6 CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_string );
8 void Map_find_string::generateSequence()
10 size_t nPercent = c_nPercentExists;
14 else if ( nPercent < 1 )
17 std::vector<std::string> const& arrString = CppUnitMini::TestCase::getTestStrings();
18 size_t nSize = arrString.size();
19 if ( nSize > c_nMapSize )
21 m_Arr.reserve( nSize );
24 for ( size_t i = 0; i < nSize && i < arrString.size(); ++i ) {
25 bool bExists = CppUnitMini::Rand( 100 ) <= nPercent;
26 m_Arr.push_back( { &arrString.at(i), bExists } );
33 void Map_find_string::setUpParams( const CppUnitMini::TestCfg& cfg )
35 c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
36 c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize);
37 c_nPercentExists = cfg.getSizeT("PercentExists", c_nPercentExists);
38 c_nPassCount = cfg.getSizeT("PassCount", c_nPassCount);
39 c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor);
40 c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
42 c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize);
43 c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize);
44 c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold);
46 c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits);
47 c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits);
49 if ( c_nThreadCount == 0 )
50 c_nThreadCount = std::thread::hardware_concurrency();
52 CPPUNIT_MSG( "Generating test data...\n");
55 CPPUNIT_MSG( " Duration=" << timer.duration() << "\n" );