diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-08 23:16:50 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-08 23:16:50 +0000 |
commit | 52cf1b9cd6aab8e49bfc8641fea9e0e1cc4086cc (patch) | |
tree | 4a5a381b0c43043d42f67fa864b037a56c5c1df4 /tests/Map_Manager_Test.cpp | |
parent | 6bb3284cc35677916e2b5eb4c2bfa66e2921bc8f (diff) | |
download | ATCD-52cf1b9cd6aab8e49bfc8641fea9e0e1cc4086cc.tar.gz |
Added missing template instantiation codes.
Changed to use STL-styled iterator functions in
ACE_Hash_Map_Manager tests.
Diffstat (limited to 'tests/Map_Manager_Test.cpp')
-rw-r--r-- | tests/Map_Manager_Test.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/Map_Manager_Test.cpp b/tests/Map_Manager_Test.cpp index 2407d9cc32f..ceacd056aa3 100644 --- a/tests/Map_Manager_Test.cpp +++ b/tests/Map_Manager_Test.cpp @@ -63,6 +63,20 @@ test_hash_map_manager (size_t table_size, size_t iterations) for (i = 0; i < iterations; i++) ACE_ASSERT (map.bind (i, i) != -1); +#if 1 + { + i = 0; + + for (HASH_ITERATOR iter = map.begin (); + iter != map.end (); + iter++, i++) + { + HASH_ENTRY &item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { HASH_ITERATOR iterator (map); @@ -73,7 +87,22 @@ test_hash_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ +#if 1 + { + i = iterations - 1; + + for (HASH_REVERSE_ITERATOR iter = map.rbegin (); + iter != map.rend (); + iter++, i--) + { + HASH_ENTRY &item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { HASH_REVERSE_ITERATOR iterator (map); @@ -84,7 +113,22 @@ test_hash_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ +#if 1 + { + i = 0; + + for (HASH_MAP_MANAGER::iterator iter = map.begin (); + iter != map.end (); + iter++, i++) + { + HASH_MAP_MANAGER::ENTRY &item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { HASH_MAP_MANAGER::ITERATOR iterator (map); @@ -95,7 +139,22 @@ test_hash_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ +#if 1 + { + i = iterations - 1; + + for (HASH_MAP_MANAGER::reverse_iterator iter = map.rbegin (); + iter != map.rend (); + iter++, i--) + { + HASH_MAP_MANAGER::ENTRY &item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { HASH_MAP_MANAGER::REVERSE_ITERATOR iterator (map); @@ -106,6 +165,7 @@ test_hash_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ for (i = 0; i < iterations; i++) { @@ -288,6 +348,7 @@ main (int argc, char *argv[]) #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Hash_Map_Manager<TYPE, TYPE, MUTEX>; +template class ACE_Hash_Map_Iterator_Base<TYPE, TYPE, MUTEX>; template class ACE_Hash_Map_Iterator<TYPE, TYPE, MUTEX>; template class ACE_Hash_Map_Reverse_Iterator<TYPE, TYPE, MUTEX>; template class ACE_Hash_Map_Entry<TYPE, TYPE>; @@ -298,6 +359,7 @@ template class ACE_Map_Reverse_Iterator<TYPE, TYPE, MUTEX>; template class ACE_Map_Entry<TYPE, TYPE>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Hash_Map_Manager<TYPE, TYPE, MUTEX> +#pragma instantiate ACE_Hash_Map_Iterator_Base<TYPE, TYPE, MUTEX> #pragma instantiate ACE_Hash_Map_Iterator<TYPE, TYPE, MUTEX> #pragma instantiate ACE_Hash_Map_Reverse_Iterator<TYPE, TYPE, MUTEX> #pragma instantiate ACE_Hash_Map_Entry<TYPE, TYPE> |