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

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

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

revision 1.22, Wed Nov 3 16:46:34 2010 UTC revision 1.23, Thu Nov 4 01:04:54 2010 UTC
# Line 318  Line 318 
318      }      }
319    
320      /**      /**
321       * toArray contains all elements       * toArray contains all elements in FIFO order
322       */       */
323      public void testToArray() {      public void testToArray() {
324          LinkedList q = populatedQueue(SIZE);          LinkedList q = populatedQueue(SIZE);
325          Object[] o = q.toArray();          Object[] o = q.toArray();
         Arrays.sort(o);  
326          for (int i = 0; i < o.length; i++)          for (int i = 0; i < o.length; i++)
327              assertEquals(o[i], q.poll());              assertSame(o[i], q.poll());
328      }      }
329    
330      /**      /**
331       * toArray(a) contains all elements       * toArray(a) contains all elements in FIFO order
332       */       */
333      public void testToArray2() {      public void testToArray2() {
334          LinkedList q = populatedQueue(SIZE);          LinkedList q = populatedQueue(SIZE);
335          Integer[] ints = new Integer[SIZE];          Integer[] ints = new Integer[SIZE];
336          ints = (Integer[])q.toArray(ints);          assertSame(ints, q.toArray(ints));
         Arrays.sort(ints);  
337          for (int i = 0; i < ints.length; i++)          for (int i = 0; i < ints.length; i++)
338              assertEquals(ints[i], q.poll());              assertSame(ints[i], q.poll());
339      }      }
340    
341      /**      /**

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8