From 6fe4c5c3ab16b4dcbb6083d2aeb98c79245e7167 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 23 Mar 2015 23:10:57 +0300 Subject: [PATCH] Splitted up map_find_int test to reduce compiling time and memory requirements --- projects/Win/vc12/unit-map-find.vcxproj | 10 + projects/source.unit.map.mk | 9 + tests/unit/map2/map_find_int.cpp | 334 ++++-------------- tests/unit/map2/map_find_int.h | 268 ++++++++++++++ .../unit/map2/map_find_int_bronsonavltree.cpp | 9 + tests/unit/map2/map_find_int_cuckoo.cpp | 9 + tests/unit/map2/map_find_int_ellentree.cpp | 9 + tests/unit/map2/map_find_int_michael.cpp | 10 + tests/unit/map2/map_find_int_refinable.cpp | 9 + tests/unit/map2/map_find_int_skip.cpp | 10 + tests/unit/map2/map_find_int_split.cpp | 10 + tests/unit/map2/map_find_int_std.cpp | 9 + tests/unit/map2/map_find_int_striped.cpp | 9 + tests/unit/map2/map_insfind_int.cpp | 4 +- tests/unit/map2/map_insfind_int.h | 17 - 15 files changed, 432 insertions(+), 294 deletions(-) create mode 100644 tests/unit/map2/map_find_int.h create mode 100644 tests/unit/map2/map_find_int_bronsonavltree.cpp create mode 100644 tests/unit/map2/map_find_int_cuckoo.cpp create mode 100644 tests/unit/map2/map_find_int_ellentree.cpp create mode 100644 tests/unit/map2/map_find_int_michael.cpp create mode 100644 tests/unit/map2/map_find_int_refinable.cpp create mode 100644 tests/unit/map2/map_find_int_skip.cpp create mode 100644 tests/unit/map2/map_find_int_split.cpp create mode 100644 tests/unit/map2/map_find_int_std.cpp create mode 100644 tests/unit/map2/map_find_int_striped.cpp diff --git a/projects/Win/vc12/unit-map-find.vcxproj b/projects/Win/vc12/unit-map-find.vcxproj index 587e2dfb..5beceb54 100644 --- a/projects/Win/vc12/unit-map-find.vcxproj +++ b/projects/Win/vc12/unit-map-find.vcxproj @@ -44,6 +44,15 @@ + + + + + + + + + @@ -57,6 +66,7 @@ + diff --git a/projects/source.unit.map.mk b/projects/source.unit.map.mk index 73c9e518..f44c1a47 100644 --- a/projects/source.unit.map.mk +++ b/projects/source.unit.map.mk @@ -1,6 +1,15 @@ CDSUNIT_MAP_SOURCES := \ tests/unit/map2/map_find_int.cpp \ + tests/unit/map2/map_find_int_bronsonavltree.cpp \ + tests/unit/map2/map_find_int_cuckoo.cpp \ + tests/unit/map2/map_find_int_ellentree.cpp \ + tests/unit/map2/map_find_int_michael.cpp \ + tests/unit/map2/map_find_int_skip.cpp \ + tests/unit/map2/map_find_int_split.cpp \ + tests/unit/map2/map_find_int_striped.cpp \ + tests/unit/map2/map_find_int_refinable.cpp \ + tests/unit/map2/map_find_int_std.cpp \ tests/unit/map2/map_find_string.cpp \ tests/unit/map2/map_insfind_int.cpp \ tests/unit/map2/map_insfind_int_bronsonavltree.cpp \ diff --git a/tests/unit/map2/map_find_int.cpp b/tests/unit/map2/map_find_int.cpp index 8e4f22c0..c8bfe854 100644 --- a/tests/unit/map2/map_find_int.cpp +++ b/tests/unit/map2/map_find_int.cpp @@ -2,293 +2,77 @@ // defines concurrent access to map::nonconcurrent_iterator::Sequence::TValue::nAccess field -#include "map2/map_types.h" -#include "cppunit/thread.h" - -#include -#include // random_shuffle +#include "map2/map_find_int.h" // find int test in map in mutithreaded mode namespace map2 { + CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_int ); -# define TEST_MAP(X) void X() { test::X >() ; } -# define TEST_MAP_NOLF(X) void X() { test_nolf::X >() ; } -# define TEST_MAP_EXTRACT(X) TEST_MAP(X) -# define TEST_MAP_NOLF_EXTRACT(X) TEST_MAP_NOLF(X) - - namespace { - static size_t c_nThreadCount = 8 ; // thread count - static size_t c_nMapSize = 20000000 ; // map size (count of searching item) - static size_t c_nPercentExists = 50 ; // percent of existing keys in searching sequence - static size_t c_nPassCount = 2; - static size_t c_nMaxLoadFactor = 8 ; // maximum load factor - static bool c_bPrintGCState = true; - } + size_t Map_find_int::c_nThreadCount = 8 ; // thread count + size_t Map_find_int::c_nMapSize = 20000000 ; // map size (count of searching item) + size_t Map_find_int::c_nPercentExists = 50 ; // percent of existing keys in searching sequence + size_t Map_find_int::c_nPassCount = 2; + size_t Map_find_int::c_nMaxLoadFactor = 8 ; // maximum load factor + bool Map_find_int::c_bPrintGCState = true; - class Map_find_int: public CppUnitMini::TestCase + void Map_find_int::generateSequence() { - typedef size_t key_type; - struct value_type { - key_type nKey ; // key - bool bExists ; // true - key in map, false - key not in map - }; - - typedef std::vector ValueVector; - ValueVector m_Arr; - size_t m_nRealMapSize; - bool m_bSequenceInitialized; - - void generateSequence() - { - size_t nPercent = c_nPercentExists; - - if ( nPercent > 100 ) - nPercent = 100; - else if ( nPercent < 1 ) - nPercent = 1; - - m_nRealMapSize = 0; - - m_Arr.resize( c_nMapSize ); - for ( size_t i = 0; i < c_nMapSize; ++i ) { - m_Arr[i].nKey = i * 13; - m_Arr[i].bExists = CppUnitMini::Rand( 100 ) <= nPercent; - if ( m_Arr[i].bExists ) - ++m_nRealMapSize; - } - std::random_shuffle( m_Arr.begin(), m_Arr.end() ); - } - - template - static bool check_result( Iterator const& it, Map const& map ) - { - return it != map.end(); - } - template - static bool check_result( bool b, Map const& ) - { - return b; - } - - template - class TestThread: public CppUnitMini::TestThread - { - Map& m_Map; - - virtual TestThread * clone() - { - return new TestThread( *this ); - } - public: - struct Stat { - size_t nSuccess; - size_t nFailed; - - Stat() - : nSuccess(0) - , nFailed(0) - {} - }; - - Stat m_KeyExists; - Stat m_KeyNotExists; - - public: - TestThread( CppUnitMini::ThreadPool& pool, Map& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - TestThread( TestThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Map_find_int& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - ValueVector& arr = getTest().m_Arr; - //size_t nSize = arr.size(); - - Map& rMap = m_Map; - for ( size_t nPass = 0; nPass < c_nPassCount; ++nPass ) { - if ( m_nThreadNo & 1 ) { - ValueVector::const_iterator itEnd = arr.end(); - for ( ValueVector::const_iterator it = arr.begin(); it != itEnd; ++it ) { - auto bFound = rMap.find( it->nKey ); - if ( it->bExists ) { - if ( check_result( bFound, rMap )) - ++m_KeyExists.nSuccess; - else { - //rMap.find( it->nKey ); - ++m_KeyExists.nFailed; - } - } - else { - if ( check_result( bFound, rMap )) { - //rMap.find( it->nKey ); - ++m_KeyNotExists.nFailed; - } - else - ++m_KeyNotExists.nSuccess; - } - } - } - else { - ValueVector::const_reverse_iterator itEnd = arr.rend(); - for ( ValueVector::const_reverse_iterator it = arr.rbegin(); it != itEnd; ++it ) { - auto bFound = rMap.find( it->nKey ); - if ( it->bExists ) { - if ( check_result( bFound, rMap )) - ++m_KeyExists.nSuccess; - else { - //rMap.find( it->nKey ); - ++m_KeyExists.nFailed; - } - } - else { - if ( check_result( bFound, rMap )) { - //rMap.find( it->nKey ); - ++m_KeyNotExists.nFailed; - } - else - ++m_KeyNotExists.nSuccess; - } - } - } - } - } - }; - - protected: + size_t nPercent = c_nPercentExists; - template - void find_int_test( Map& testMap ) - { - typedef TestThread Thread; - cds::OS::Timer timer; + if ( nPercent > 100 ) + nPercent = 100; + else if ( nPercent < 1 ) + nPercent = 1; - // Fill the map - CPPUNIT_MSG( " Fill map with " << m_Arr.size() << " items..."); - timer.reset(); - for ( size_t i = 0; i < m_Arr.size(); ++i ) { - if ( m_Arr[i].bExists ) { - CPPUNIT_ASSERT( check_result( testMap.insert( m_Arr[i].nKey, m_Arr[i] ), testMap )); - } - } - CPPUNIT_MSG( " Duration=" << timer.duration() ); + m_nRealMapSize = 0; - CPPUNIT_MSG( " Searching..."); - CppUnitMini::ThreadPool pool( *this ); - pool.add( new Thread( pool, testMap ), c_nThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - Thread * pThread = static_cast( *it ); - CPPUNIT_CHECK( pThread->m_KeyExists.nFailed == 0 ); - CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == m_nRealMapSize * c_nPassCount ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nFailed == 0 ); - CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - m_nRealMapSize) * c_nPassCount ); - } - - check_before_cleanup( testMap ); - - testMap.clear(); - additional_check( testMap ); - print_stat( testMap ); - additional_cleanup( testMap ); - } - - void initTestSequence() - { - CPPUNIT_MSG( "Generating test data..."); - cds::OS::Timer timer; - generateSequence(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_MSG( "Map size=" << m_nRealMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" ); - CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount ); - - m_bSequenceInitialized = true; - } - - template - void test() - { - if ( !m_bSequenceInitialized ) - initTestSequence(); - - for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << nLoadFactor ); - Map testMap( c_nMapSize, nLoadFactor ); - find_int_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - template - void test_nolf() - { - if ( !m_bSequenceInitialized ) - initTestSequence(); - - Map testMap; - find_int_test( testMap ); - if ( c_bPrintGCState ) - print_gc_state(); + m_Arr.resize( c_nMapSize ); + for ( size_t i = 0; i < c_nMapSize; ++i ) { + m_Arr[i].nKey = i * 13; + m_Arr[i].bExists = CppUnitMini::Rand( 100 ) <= nPercent; + if ( m_Arr[i].bExists ) + ++m_nRealMapSize; } + std::random_shuffle( m_Arr.begin(), m_Arr.end() ); + } - void setUpParams( const CppUnitMini::TestCfg& cfg ) { - c_nThreadCount = cfg.getULong("ThreadCount", 8 ) ; // thread count - c_nMapSize = cfg.getULong("MapSize", 20000000 ) ; // map size (count of searching item) - c_nPercentExists = cfg.getULong("PercentExists", 50 ) ; // percent of existing keys in searching sequence - c_nPassCount = cfg.getULong("PassCount", 2 ); - c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", 8 ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - } - - - public: - Map_find_int() - : m_bSequenceInitialized( false ) - {} + void Map_find_int::initTestSequence() + { + CPPUNIT_MSG( "Generating test data..."); + cds::OS::Timer timer; + generateSequence(); + CPPUNIT_MSG( " Duration=" << timer.duration() ); + CPPUNIT_MSG( "Map size=" << m_nRealMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" ); + CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount ); + + m_bSequenceInitialized = true; + } -# include "map2/map_defs.h" - CDSUNIT_DECLARE_MichaelMap - CDSUNIT_DECLARE_MichaelMap_nogc - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SplitList_nogc - CDSUNIT_DECLARE_SkipListMap - CDSUNIT_DECLARE_SkipListMap_nogc - CDSUNIT_DECLARE_EllenBinTreeMap - CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_StripedMap - CDSUNIT_DECLARE_RefinableMap - CDSUNIT_DECLARE_CuckooMap - CDSUNIT_DECLARE_StdMap + void Map_find_int::setUpParams( const CppUnitMini::TestCfg& cfg ) + { + c_nThreadCount = cfg.getULong("ThreadCount", static_cast(c_nThreadCount)); // thread count + c_nMapSize = cfg.getULong("MapSize", static_cast(c_nMapSize)); // map size (count of searching item) + c_nPercentExists = cfg.getULong("PercentExists", static_cast(c_nPercentExists)); // percent of existing keys in searching sequence + c_nPassCount = cfg.getULong("PassCount", static_cast(c_nPassCount)); + c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", static_cast(c_nMaxLoadFactor)); + c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); + } - CPPUNIT_TEST_SUITE( Map_find_int ) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_MichaelMap_nogc - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SplitList_nogc - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_SkipListMap_nogc - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END() - }; + void Map_find_int::myRun(const char *in_name, bool invert /*= false*/) + { + setUpParams( m_Cfg.get( "Map_find_int" )); + + run_MichaelMap(in_name, invert); + run_SplitList(in_name, invert); + run_SkipListMap(in_name, invert); + run_EllenBinTreeMap(in_name, invert); + run_BronsonAVLTreeMap(in_name, invert); + run_StripedMap(in_name, invert); + run_RefinableMap(in_name, invert); + run_CuckooMap(in_name, invert); + run_StdMap(in_name, invert); + + endTestCase(); + } - CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_int ); } // namespace map diff --git a/tests/unit/map2/map_find_int.h b/tests/unit/map2/map_find_int.h new file mode 100644 index 00000000..0408d4c3 --- /dev/null +++ b/tests/unit/map2/map_find_int.h @@ -0,0 +1,268 @@ +//$$CDS-header$$ + +// defines concurrent access to map::nonconcurrent_iterator::Sequence::TValue::nAccess field + +#include "map2/map_types.h" +#include "cppunit/thread.h" + +#include +#include // random_shuffle + +// find int test in map in mutithreaded mode +namespace map2 { + +# define TEST_MAP(X) void X() { test::X >() ; } +# define TEST_MAP_NOLF(X) void X() { test_nolf::X >() ; } +# define TEST_MAP_EXTRACT(X) TEST_MAP(X) +# define TEST_MAP_NOLF_EXTRACT(X) TEST_MAP_NOLF(X) + + class Map_find_int: public CppUnitMini::TestCase + { + static size_t c_nThreadCount; // thread count + static size_t c_nMapSize; // map size (count of searching item) + static size_t c_nPercentExists; // percent of existing keys in searching sequence + static size_t c_nPassCount; + static size_t c_nMaxLoadFactor; // maximum load factor + static bool c_bPrintGCState; + + typedef CppUnitMini::TestCase Base; + typedef size_t key_type; + struct value_type { + key_type nKey ; // key + bool bExists ; // true - key in map, false - key not in map + }; + + typedef std::vector ValueVector; + ValueVector m_Arr; + size_t m_nRealMapSize; + bool m_bSequenceInitialized; + + void generateSequence(); + + template + static bool check_result( Iterator const& it, Map const& map ) + { + return it != map.end(); + } + template + static bool check_result( bool b, Map const& ) + { + return b; + } + + template + class TestThread: public CppUnitMini::TestThread + { + Map& m_Map; + + virtual TestThread * clone() + { + return new TestThread( *this ); + } + public: + struct Stat { + size_t nSuccess; + size_t nFailed; + + Stat() + : nSuccess(0) + , nFailed(0) + {} + }; + + Stat m_KeyExists; + Stat m_KeyNotExists; + + public: + TestThread( CppUnitMini::ThreadPool& pool, Map& rMap ) + : CppUnitMini::TestThread( pool ) + , m_Map( rMap ) + {} + TestThread( TestThread& src ) + : CppUnitMini::TestThread( src ) + , m_Map( src.m_Map ) + {} + + Map_find_int& getTest() + { + return reinterpret_cast( m_Pool.m_Test ); + } + + virtual void init() { cds::threading::Manager::attachThread() ; } + virtual void fini() { cds::threading::Manager::detachThread() ; } + + virtual void test() + { + ValueVector& arr = getTest().m_Arr; + //size_t nSize = arr.size(); + + Map& rMap = m_Map; + for ( size_t nPass = 0; nPass < c_nPassCount; ++nPass ) { + if ( m_nThreadNo & 1 ) { + ValueVector::const_iterator itEnd = arr.end(); + for ( ValueVector::const_iterator it = arr.begin(); it != itEnd; ++it ) { + auto bFound = rMap.find( it->nKey ); + if ( it->bExists ) { + if ( check_result( bFound, rMap )) + ++m_KeyExists.nSuccess; + else { + //rMap.find( it->nKey ); + ++m_KeyExists.nFailed; + } + } + else { + if ( check_result( bFound, rMap )) { + //rMap.find( it->nKey ); + ++m_KeyNotExists.nFailed; + } + else + ++m_KeyNotExists.nSuccess; + } + } + } + else { + ValueVector::const_reverse_iterator itEnd = arr.rend(); + for ( ValueVector::const_reverse_iterator it = arr.rbegin(); it != itEnd; ++it ) { + auto bFound = rMap.find( it->nKey ); + if ( it->bExists ) { + if ( check_result( bFound, rMap )) + ++m_KeyExists.nSuccess; + else { + //rMap.find( it->nKey ); + ++m_KeyExists.nFailed; + } + } + else { + if ( check_result( bFound, rMap )) { + //rMap.find( it->nKey ); + ++m_KeyNotExists.nFailed; + } + else + ++m_KeyNotExists.nSuccess; + } + } + } + } + } + }; + + protected: + + template + void find_int_test( Map& testMap ) + { + typedef TestThread Thread; + cds::OS::Timer timer; + + // Fill the map + CPPUNIT_MSG( " Fill map with " << m_Arr.size() << " items..."); + timer.reset(); + for ( size_t i = 0; i < m_Arr.size(); ++i ) { + if ( m_Arr[i].bExists ) { + CPPUNIT_ASSERT( check_result( testMap.insert( m_Arr[i].nKey, m_Arr[i] ), testMap )); + } + } + CPPUNIT_MSG( " Duration=" << timer.duration() ); + + CPPUNIT_MSG( " Searching..."); + CppUnitMini::ThreadPool pool( *this ); + pool.add( new Thread( pool, testMap ), c_nThreadCount ); + pool.run(); + CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); + + for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { + Thread * pThread = static_cast( *it ); + CPPUNIT_CHECK( pThread->m_KeyExists.nFailed == 0 ); + CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == m_nRealMapSize * c_nPassCount ); + CPPUNIT_CHECK( pThread->m_KeyNotExists.nFailed == 0 ); + CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - m_nRealMapSize) * c_nPassCount ); + } + + check_before_cleanup( testMap ); + + testMap.clear(); + additional_check( testMap ); + print_stat( testMap ); + additional_cleanup( testMap ); + } + + void initTestSequence(); + + template + void test() + { + if ( !m_bSequenceInitialized ) + initTestSequence(); + + for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) { + CPPUNIT_MSG( "Load factor=" << nLoadFactor ); + Map testMap( c_nMapSize, nLoadFactor ); + find_int_test( testMap ); + if ( c_bPrintGCState ) + print_gc_state(); + } + } + + template + void test_nolf() + { + if ( !m_bSequenceInitialized ) + initTestSequence(); + + Map testMap; + find_int_test( testMap ); + if ( c_bPrintGCState ) + print_gc_state(); + } + + void setUpParams( const CppUnitMini::TestCfg& cfg ); + + void run_MichaelMap(const char *in_name, bool invert = false); + void run_SplitList(const char *in_name, bool invert = false); + void run_StripedMap(const char *in_name, bool invert = false); + void run_RefinableMap(const char *in_name, bool invert = false); + void run_CuckooMap(const char *in_name, bool invert = false); + void run_SkipListMap(const char *in_name, bool invert = false); + void run_EllenBinTreeMap(const char *in_name, bool invert = false); + void run_BronsonAVLTreeMap(const char *in_name, bool invert = false); + void run_StdMap(const char *in_name, bool invert = false); + + virtual void myRun(const char *in_name, bool invert = false); + + public: + Map_find_int() + : m_bSequenceInitialized( false ) + {} + +# include "map2/map_defs.h" + CDSUNIT_DECLARE_MichaelMap + CDSUNIT_DECLARE_MichaelMap_nogc + CDSUNIT_DECLARE_SplitList + CDSUNIT_DECLARE_SplitList_nogc + CDSUNIT_DECLARE_SkipListMap + CDSUNIT_DECLARE_SkipListMap_nogc + CDSUNIT_DECLARE_EllenBinTreeMap + CDSUNIT_DECLARE_BronsonAVLTreeMap + CDSUNIT_DECLARE_StripedMap + CDSUNIT_DECLARE_RefinableMap + CDSUNIT_DECLARE_CuckooMap + CDSUNIT_DECLARE_StdMap + + /* + CPPUNIT_TEST_SUITE( Map_find_int ) + CDSUNIT_TEST_MichaelMap + CDSUNIT_TEST_MichaelMap_nogc + CDSUNIT_TEST_SplitList + CDSUNIT_TEST_SplitList_nogc + CDSUNIT_TEST_SkipListMap + CDSUNIT_TEST_SkipListMap_nogc + CDSUNIT_TEST_EllenBinTreeMap + CDSUNIT_TEST_BronsonAVLTreeMap + CDSUNIT_TEST_StripedMap + CDSUNIT_TEST_RefinableMap + CDSUNIT_TEST_CuckooMap + CDSUNIT_TEST_StdMap + CPPUNIT_TEST_SUITE_END() + */ + }; +} // namespace map diff --git a/tests/unit/map2/map_find_int_bronsonavltree.cpp b/tests/unit/map2/map_find_int_bronsonavltree.cpp new file mode 100644 index 00000000..2c915a6e --- /dev/null +++ b/tests/unit/map2/map_find_int_bronsonavltree.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_BronsonAVLTreeMap ) + CDSUNIT_TEST_BronsonAVLTreeMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_cuckoo.cpp b/tests/unit/map2/map_find_int_cuckoo.cpp new file mode 100644 index 00000000..b397fcac --- /dev/null +++ b/tests/unit/map2/map_find_int_cuckoo.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_CuckooMap ) + CDSUNIT_TEST_CuckooMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_ellentree.cpp b/tests/unit/map2/map_find_int_ellentree.cpp new file mode 100644 index 00000000..3f5e9ffe --- /dev/null +++ b/tests/unit/map2/map_find_int_ellentree.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_EllenBinTreeMap ) + CDSUNIT_TEST_EllenBinTreeMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_michael.cpp b/tests/unit/map2/map_find_int_michael.cpp new file mode 100644 index 00000000..6ab77021 --- /dev/null +++ b/tests/unit/map2/map_find_int_michael.cpp @@ -0,0 +1,10 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_MichaelMap ) + CDSUNIT_TEST_MichaelMap + CDSUNIT_TEST_MichaelMap_nogc + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_refinable.cpp b/tests/unit/map2/map_find_int_refinable.cpp new file mode 100644 index 00000000..d047537c --- /dev/null +++ b/tests/unit/map2/map_find_int_refinable.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_RefinableMap ) + CDSUNIT_TEST_RefinableMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_skip.cpp b/tests/unit/map2/map_find_int_skip.cpp new file mode 100644 index 00000000..edfcc410 --- /dev/null +++ b/tests/unit/map2/map_find_int_skip.cpp @@ -0,0 +1,10 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_SkipListMap ) + CDSUNIT_TEST_SkipListMap + CDSUNIT_TEST_SkipListMap_nogc + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_split.cpp b/tests/unit/map2/map_find_int_split.cpp new file mode 100644 index 00000000..b565e3e6 --- /dev/null +++ b/tests/unit/map2/map_find_int_split.cpp @@ -0,0 +1,10 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_SplitList ) + CDSUNIT_TEST_SplitList + CDSUNIT_TEST_SplitList_nogc + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_std.cpp b/tests/unit/map2/map_find_int_std.cpp new file mode 100644 index 00000000..bcb759e0 --- /dev/null +++ b/tests/unit/map2/map_find_int_std.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_StdMap ) + CDSUNIT_TEST_StdMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_find_int_striped.cpp b/tests/unit/map2/map_find_int_striped.cpp new file mode 100644 index 00000000..d93dbf1a --- /dev/null +++ b/tests/unit/map2/map_find_int_striped.cpp @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#include "map2/map_find_int.h" + +namespace map2 { + CPPUNIT_TEST_SUITE_PART( Map_find_int, run_StripedMap ) + CDSUNIT_TEST_StripedMap + CPPUNIT_TEST_SUITE_END_PART() +} // namespace map2 diff --git a/tests/unit/map2/map_insfind_int.cpp b/tests/unit/map2/map_insfind_int.cpp index a1f47782..119f1078 100644 --- a/tests/unit/map2/map_insfind_int.cpp +++ b/tests/unit/map2/map_insfind_int.cpp @@ -13,8 +13,8 @@ namespace map2 { void Map_InsFind_int::setUpParams( const CppUnitMini::TestCfg& cfg ) { c_nThreadCount = cfg.getULong("ThreadCount", 0 ); - c_nMapSize = cfg.getULong("MapSize", c_nMapSize ); - c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", c_nMaxLoadFactor ); + c_nMapSize = cfg.getULong("MapSize", static_cast(c_nMapSize)); + c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", static_cast(c_nMaxLoadFactor)); c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); if ( c_nThreadCount == 0 ) c_nThreadCount = cds::OS::topology::processor_count(); diff --git a/tests/unit/map2/map_insfind_int.h b/tests/unit/map2/map_insfind_int.h index f84bdcb3..2003896a 100644 --- a/tests/unit/map2/map_insfind_int.h +++ b/tests/unit/map2/map_insfind_int.h @@ -214,22 +214,5 @@ namespace map2 { CDSUNIT_DECLARE_RefinableMap CDSUNIT_DECLARE_CuckooMap CDSUNIT_DECLARE_StdMap - - /* - CPPUNIT_TEST_SUITE( Map_InsFind_int ) - CDSUNIT_TEST_MichaelMap - CDSUNIT_TEST_MichaelMap_nogc - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SplitList_nogc - CDSUNIT_TEST_SkipListMap - CDSUNIT_TEST_SkipListMap_nogc - CDSUNIT_TEST_EllenBinTreeMap - CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_StripedMap - CDSUNIT_TEST_RefinableMap - CDSUNIT_TEST_CuckooMap - CDSUNIT_TEST_StdMap - CPPUNIT_TEST_SUITE_END() - */ }; } // namespace map2 -- 2.34.1