[cvs] / jsr166 / src / test / tck / ArrayDequeTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/ArrayDequeTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19, Thu Nov 4 01:04:54 2010 UTC revision 1.20, Fri Nov 5 00:17:22 2010 UTC
# Line 26  Line 26 
26       * Create a deque of given size containing consecutive       * Create a deque of given size containing consecutive
27       * Integers 0 ... n.       * Integers 0 ... n.
28       */       */
29      private ArrayDeque populatedDeque(int n) {      private ArrayDeque<Integer> populatedDeque(int n) {
30          ArrayDeque q = new ArrayDeque();          ArrayDeque<Integer> q = new ArrayDeque<Integer>();
31          assertTrue(q.isEmpty());          assertTrue(q.isEmpty());
32          for (int i = 0; i < n; ++i)          for (int i = 0; i < n; ++i)
33              assertTrue(q.offerLast(new Integer(i)));              assertTrue(q.offerLast(new Integer(i)));
# Line 633  Line 633 
633       * toArray(a) contains all elements in FIFO order       * toArray(a) contains all elements in FIFO order
634       */       */
635      public void testToArray2() {      public void testToArray2() {
636          ArrayDeque q = populatedDeque(SIZE);          ArrayDeque<Integer> q = populatedDeque(SIZE);
637          Integer[] ints = new Integer[SIZE];          Integer[] ints = new Integer[SIZE];
638          assertSame(ints, q.toArray(ints));          Integer[] array = q.toArray(ints);
639            assertSame(ints, array);
640          for (int i = 0; i < ints.length; i++)          for (int i = 0; i < ints.length; i++)
641              assertSame(ints[i], q.remove());              assertSame(ints[i], q.remove());
642      }      }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8