[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.18, Wed Nov 3 16:46:34 2010 UTC revision 1.19, Thu Nov 4 01:04:54 2010 UTC
# Line 620  Line 620 
620      }      }
621    
622      /**      /**
623       * toArray() contains all elements       * toArray() contains all elements in FIFO order
624       */       */
625      public void testToArray() {      public void testToArray() {
626          ArrayDeque q = populatedDeque(SIZE);          ArrayDeque q = populatedDeque(SIZE);
627          Object[] o = q.toArray();          Object[] o = q.toArray();
         Arrays.sort(o);  
628          for (int i = 0; i < o.length; i++)          for (int i = 0; i < o.length; i++)
629              assertEquals(o[i], q.pollFirst());              assertSame(o[i], q.pollFirst());
630      }      }
631    
632      /**      /**
633       * toArray(a) contains all elements       * toArray(a) contains all elements in FIFO order
634       */       */
635      public void testToArray2() {      public void testToArray2() {
636          ArrayDeque q = populatedDeque(SIZE);          ArrayDeque q = populatedDeque(SIZE);
637          Integer[] ints = new Integer[SIZE];          Integer[] ints = new Integer[SIZE];
638          ints = (Integer[])q.toArray(ints);          assertSame(ints, q.toArray(ints));
         Arrays.sort(ints);  
639          for (int i = 0; i < ints.length; i++)          for (int i = 0; i < ints.length; i++)
640              assertEquals(ints[i], q.pollFirst());              assertSame(ints[i], q.remove());
641      }      }
642    
643      /**      /**

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8