diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-04 14:32:06 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-04 14:32:06 +0000 |
commit | 233a550282ef520784e4da3a1cfa3c13de16193e (patch) | |
tree | 853fc22fa101a5d1101f7ac2f228ddb9a6c93a01 /tests/Map_Manager_Test.cpp | |
parent | 62209e446ab514fd11256715a93a043f64695427 (diff) | |
download | ATCD-233a550282ef520784e4da3a1cfa3c13de16193e.tar.gz |
Changed to use STL-styled iterator for ACE_Map_Manager test.
Diffstat (limited to 'tests/Map_Manager_Test.cpp')
-rw-r--r-- | tests/Map_Manager_Test.cpp | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/tests/Map_Manager_Test.cpp b/tests/Map_Manager_Test.cpp index 223d6832a59..2407d9cc32f 100644 --- a/tests/Map_Manager_Test.cpp +++ b/tests/Map_Manager_Test.cpp @@ -129,10 +129,11 @@ test_map_manager (size_t table_size, size_t iterations) for (i = 0; i < iterations; i++) ACE_ASSERT (map.bind (i, i) != -1); -#if defined (ACE_TEST_STL_ITERATOR_FUNCTIONS) +#if 1 { ENTRY item; - for (MAP_MANAGER::iterator iter = map.begin (); + i = 0; + for (ITERATOR iter = map.begin (); iter != map.end (); i++, iter ++) { item = *iter; @@ -150,8 +151,21 @@ test_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } -#endif /* ACE_TEST_STL_ITERATOR_FUNCTIONS */ +#endif /* 1 */ +#if 1 + { + ENTRY item; + i = iterations - 1; + for (REVERSE_ITERATOR iter = map.rbegin (); + iter != map.rend (); i--, iter ++) + { + item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { REVERSE_ITERATOR iterator (map); @@ -162,7 +176,21 @@ test_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ +#if 1 + { + MAP_MANAGER::ENTRY item; + i = 0; + for (MAP_MANAGER::iterator iter = map.begin (); + iter != map.end (); i++, iter ++) + { + item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { MAP_MANAGER::ITERATOR iterator (map); @@ -173,7 +201,21 @@ test_map_manager (size_t table_size, size_t iterations) ACE_DEBUG ((LM_DEBUG, "%d ", i)); ACE_DEBUG ((LM_DEBUG, "\n")); } +#endif /* 1 */ +#if 1 + { + ENTRY item; + i = iterations - 1; + for (MAP_MANAGER::reverse_iterator iter = map.rbegin (); + iter != map.rend (); i--, iter ++) + { + item = *iter; + ACE_DEBUG ((LM_DEBUG, "%d ", i)); + } + ACE_DEBUG ((LM_DEBUG, "\n")); + } +#else { MAP_MANAGER::REVERSE_ITERATOR iterator (map); @@ -184,6 +226,7 @@ test_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++) { @@ -214,7 +257,8 @@ run_test (void (*ptf) (size_t, size_t), timer.elapsed_time (et); - ACE_DEBUG ((LM_DEBUG, "time to test a %d item map for %d iterations using %s\n", + ACE_DEBUG ((LM_DEBUG, "time to test a %d item map for %d iterations using %s\ +n", table_size, iterations, test_name)); ACE_DEBUG ((LM_DEBUG, "real time = %f secs, user time = %f secs, system time = %f secs\n", et.real_time, et.user_time, et.system_time)); |