summaryrefslogtreecommitdiff
path: root/tests
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
commit74f827588867a7f97eb42d928968e7e5e5d4de9f (patch)
treeb677db883d41a161c97bc4c54296c4f67f2834f1 /tests
parentd49d73963ccdd5504c7db5ccd0af12a82ac7c0f1 (diff)
downloadATCD-74f827588867a7f97eb42d928968e7e5e5d4de9f.tar.gz
ChangeLogTag:Wed Dec 3 12:14:51 2003 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'tests')
-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 ();