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

Comparing jsr166/src/test/tck/ConcurrentSkipListSubSetTest.java (file contents):
Revision 1.13 by jsr166, Wed Aug 25 00:07:03 2010 UTC vs.
Revision 1.15 by jsr166, Thu Nov 4 01:04:54 2010 UTC

# Line 178 | Line 178 | public class ConcurrentSkipListSubSetTes
178              shouldThrow();
179          } catch (NullPointerException success) {}
180      }
181 +
182      /**
183       * addAll of a collection with null elements throws NPE
184       */
# Line 189 | Line 190 | public class ConcurrentSkipListSubSetTes
190              shouldThrow();
191          } catch (NullPointerException success) {}
192      }
193 +
194      /**
195       * addAll of a collection with any null elements throws NPE after
196       * possibly adding some elements
# Line 395 | Line 397 | public class ConcurrentSkipListSubSetTes
397      }
398  
399      /**
400 <     * toArray contains all elements
400 >     * toArray contains all elements in sorted order
401       */
402      public void testToArray() {
403          NavigableSet q = populatedSet(SIZE);
404          Object[] o = q.toArray();
403        Arrays.sort(o);
405          for (int i = 0; i < o.length; i++)
406 <            assertEquals(o[i], q.pollFirst());
406 >            assertSame(o[i], q.pollFirst());
407      }
408  
409      /**
410 <     * toArray(a) contains all elements
410 >     * toArray(a) contains all elements in sorted order
411       */
412      public void testToArray2() {
413          NavigableSet q = populatedSet(SIZE);
414          Integer[] ints = new Integer[SIZE];
415 <        ints = (Integer[])q.toArray(ints);
415 <        Arrays.sort(ints);
415 >        assertSame(ints, q.toArray(ints));
416          for (int i = 0; i < ints.length; i++)
417 <            assertEquals(ints[i], q.pollFirst());
417 >            assertSame(ints[i], q.pollFirst());
418      }
419  
420      /**
# Line 680 | Line 680 | public class ConcurrentSkipListSubSetTes
680              shouldThrow();
681          } catch (NullPointerException success) {}
682      }
683 +
684      /**
685       * addAll of a collection with null elements throws NPE
686       */
# Line 691 | Line 692 | public class ConcurrentSkipListSubSetTes
692              shouldThrow();
693          } catch (NullPointerException success) {}
694      }
695 +
696      /**
697       * addAll of a collection with any null elements throws NPE after
698       * possibly adding some elements
# Line 913 | Line 915 | public class ConcurrentSkipListSubSetTes
915      public void testDescendingToArray2() {
916          NavigableSet q = populatedSet(SIZE);
917          Integer[] ints = new Integer[SIZE];
918 <        ints = (Integer[])q.toArray(ints);
918 >        assertSame(ints, q.toArray(ints));
919          Arrays.sort(ints);
920          for (int i = 0; i < ints.length; i++)
921              assertEquals(ints[i], q.pollFirst());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines