ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/DequeBash.java
(Generate patch)

Comparing jsr166/src/test/loops/DequeBash.java (file contents):
Revision 1.1 by dl, Mon May 2 19:19:38 2005 UTC vs.
Revision 1.2 by dl, Fri Sep 16 11:15:56 2005 UTC

# Line 64 | Line 64 | public class DequeBash {
64              randomOp(deque);
65  
66              // Test iterator occasionally
67 <            if ((i & 1023) == 0)
67 >            if ((i & 1023) == 0) {
68                  testIter(deque);
69 +                testDescendingIter(deque);
70 +            }
71  
72              // Test serialization and copying
73              if ((i & 4095) == 0) {
# Line 97 | Line 99 | public class DequeBash {
99                  throw new Exception("Element "+ j + " != " + (next-1));
100              count++;
101          }
102 +        if (count != size())
103 +            throw new Exception("Count " + count + " != " + size());
104 +    }
105 +
106 +    static void testDescendingIter(Deque<Integer> deque) throws Exception {                
107 +        int next = deque.size() + nextHead;
108 +        int count = 0;
109 +        for (Iterator<Integer> it = deque.descendingIterator(); it.hasNext();) {
110 +            int j = it.next();
111 +            if (j != next--)
112 +                throw new Exception("Element "+ j + " != " + (next-1));
113 +            count++;
114 +        }
115          if (count != size())
116              throw new Exception("Count " + count + " != " + size());
117      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines