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

Comparing jsr166/src/test/tck/PriorityQueueTest.java (file contents):
Revision 1.36 by jsr166, Sun May 24 01:42:14 2015 UTC vs.
Revision 1.38 by jsr166, Sun Oct 16 20:44:18 2016 UTC

# Line 33 | Line 33 | public class PriorityQueueTest extends J
33  
34      /**
35       * Returns a new queue of given size containing consecutive
36 <     * Integers 0 ... n.
36 >     * Integers 0 ... n - 1.
37       */
38      private PriorityQueue<Integer> populatedQueue(int n) {
39          PriorityQueue<Integer> q = new PriorityQueue<Integer>(n);
# Line 44 | Line 44 | public class PriorityQueueTest extends J
44              assertTrue(q.offer(new Integer(i)));
45          assertFalse(q.isEmpty());
46          assertEquals(n, q.size());
47 +        assertEquals((Integer) 0, q.peek());
48          return q;
49      }
50  
# Line 191 | Line 192 | public class PriorityQueueTest extends J
192          PriorityQueue q = new PriorityQueue(1);
193          try {
194              q.offer(new Object());
194            q.offer(new Object());
195              shouldThrow();
196 <        } catch (ClassCastException success) {}
196 >        } catch (ClassCastException success) {
197 >            assertTrue(q.isEmpty());
198 >            assertEquals(0, q.size());
199 >            assertNull(q.poll());
200 >        }
201      }
202  
203      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines