diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-10-16 23:43:00 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-10-16 23:43:00 +0000 |
commit | 3198a486c0ee60c5e0d5635a22c0b2366b10a2c1 (patch) | |
tree | 114977323ad2cad9b10e1333e5ab468962a097d4 /tests | |
parent | f206f5f0c59d44bf57cf207e772c8681248abd18 (diff) | |
download | ATCD-3198a486c0ee60c5e0d5635a22c0b2366b10a2c1.tar.gz |
*** empty log message ***
Diffstat (limited to 'tests')
-rw-r--r-- | tests/OrdMultiSet_Test.cpp | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/tests/OrdMultiSet_Test.cpp b/tests/OrdMultiSet_Test.cpp index b989d7e888a..5773bc29ec5 100644 --- a/tests/OrdMultiSet_Test.cpp +++ b/tests/OrdMultiSet_Test.cpp @@ -43,18 +43,14 @@ main (int, ASYS_TCHAR *[]) ACE_Ordered_MultiSet<int> set; ACE_Ordered_MultiSet_Iterator<int> iter(set); - // put in a range of odd ints, without an iterator + // Put in a range of odd ints, without an iterator. int i; for (i = -10; i < 10; ++i) - { set.insert (2 * i + 1); - } // put in an interleaved range of even ints, using an iterator for (i = -10; i <= 10; ++i) - { set.insert (2 * i, iter); - } // remove the first and last elements of range while (set.remove (-20) == 0); @@ -67,18 +63,18 @@ main (int, ASYS_TCHAR *[]) // iterate forward through the range we created: should be one of each iter.first (); for (i = -19; i <= 19; ++i) - { - // we should still be in the set - ACE_ASSERT (iter.done () == 0); - - // make sure the current element is what we expect - iter.next (ptr); - ACE_ASSERT (ptr != 0); - ACE_ASSERT (*ptr == i); + { + // we should still be in the set + ACE_ASSERT (iter.done () == 0); + + // make sure the current element is what we expect + iter.next (ptr); + ACE_ASSERT (ptr != 0); + ACE_ASSERT (*ptr == i); - // move to the next element in the set - iter.advance (); - } + // move to the next element in the set + iter.advance (); + } // we should have iterated through the entire set ACE_ASSERT (iter.done () != 0); @@ -86,19 +82,19 @@ main (int, ASYS_TCHAR *[]) // iterate backward through the range we created: should be one of each iter.last (); for (i = 19; i >= -19; --i) - { - // we should still be in the set - ACE_ASSERT (iter.done () == 0); - - // make sure the current element is what we expect - int *ptr; - iter.next (ptr); - ACE_ASSERT (ptr != 0); - ACE_ASSERT (*ptr == i); + { + // we should still be in the set + ACE_ASSERT (iter.done () == 0); + + // make sure the current element is what we expect + int *ptr; + iter.next (ptr); + ACE_ASSERT (ptr != 0); + ACE_ASSERT (*ptr == i); - // move to the previous element in the set - iter.retreat (); - } + // move to the previous element in the set + iter.retreat (); + } // we should have iterated through the entire set ACE_ASSERT (iter.done () != 0); @@ -173,16 +169,16 @@ main (int, ASYS_TCHAR *[]) ACE_ASSERT (*ptr == 201); iter.advance (); for (i = 1; i <= 5; ++i) - { - // should be in the set, able to access the element, value should be 205 - ACE_ASSERT (iter.done () == 0); - iter.next (ptr); - ACE_ASSERT (ptr != 0); - ACE_ASSERT (*ptr == 205); - - // move to the next element in the set - iter.advance (); - } + { + // should be in the set, able to access the element, value should be 205 + ACE_ASSERT (iter.done () == 0); + iter.next (ptr); + ACE_ASSERT (ptr != 0); + ACE_ASSERT (*ptr == 205); + + // move to the next element in the set + iter.advance (); + } // should not be anything else in the set ACE_ASSERT (iter.done () != 0); |