summaryrefslogtreecommitdiff
path: root/tests/Vector_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2003-12-03 17:19:20 +0000
committerSteve Huston <shuston@riverace.com>2003-12-03 17:19:20 +0000
commit6151fa1d107ff2cf737708bfbca9eeb8aad58d99 (patch)
treeb677db883d41a161c97bc4c54296c4f67f2834f1 /tests/Vector_Test.cpp
parentd28c8c8222b10a0aabce0e305a2d093a7027a41a (diff)
downloadATCD-6151fa1d107ff2cf737708bfbca9eeb8aad58d99.tar.gz
ChangeLogTag:Wed Dec 3 12:14:51 2003 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'tests/Vector_Test.cpp')
-rw-r--r--tests/Vector_Test.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Vector_Test.cpp b/tests/Vector_Test.cpp
index 1c9363233b7..322df040766 100644
--- a/tests/Vector_Test.cpp
+++ b/tests/Vector_Test.cpp
@@ -48,6 +48,25 @@ int run_main (int, ACE_TCHAR *[])
for (i = 0; i < TOP; ++i)
ACE_ASSERT (vector[i] == i);
+ // Test to be sure the iterator gets the correct count and entries.
+ ITERATOR iter (vector);
+ DATA *p_item = 0 ;
+ size_t iter_count = 0;
+ while (!iter.done ())
+ {
+ if (iter.next (p_item) == 0)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Fail to get value on iter pass %d\n"),
+ iter_count));
+ if (*p_item != iter_count)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Iter pass %d got %d\n"),
+ iter_count, *p_item));
+ iter_count++;
+ iter.advance();
+ }
+ if (iter_count != TOP)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Iterated %d elements; expected %d\n"),
+ iter_count, TOP));
+
for (i = 0; i < (TOP - LEFT); ++i)
vector.pop_back ();