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

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.5 by jsr166, Tue Oct 25 01:32:55 2016 UTC vs.
Revision 1.7 by jsr166, Mon Oct 31 20:08:40 2016 UTC

# Line 105 | Line 105 | public class Collection8Test extends JSR
105              () -> c.retainAll(null),
106              () -> c.removeAll(null),
107              () -> c.removeIf(null),
108 +            () -> c.forEach(null),
109 +            () -> c.iterator().forEachRemaining(null),
110 +            () -> c.spliterator().forEachRemaining(null),
111 +            () -> c.spliterator().tryAdvance(null),
112              () -> c.toArray(null));
113  
114          if (!impl.permitsNulls()) {
# Line 128 | Line 132 | public class Collection8Test extends JSR
132                  () -> d.addLast(null),
133                  () -> d.offerFirst(null),
134                  () -> d.offerLast(null),
135 <                () -> d.push(null));
135 >                () -> d.push(null),
136 >                () -> d.descendingIterator().forEachRemaining(null));
137          }
138      }
139  
# Line 177 | Line 182 | public class Collection8Test extends JSR
182              }
183          };
184          try {
185 <            boolean modified = c.removeIf(randomPredicate);
186 <            if (!modified) {
187 <                assertNull(threwAt.get());
188 <                assertEquals(n, rejects.size());
189 <                assertEquals(0, accepts.size());
190 <            }
191 <        } catch (ArithmeticException ok) {}
192 <        survivors.removeAll(accepts);
193 <        if (n - accepts.size() != c.size()) {
185 >            try {
186 >                boolean modified = c.removeIf(randomPredicate);
187 >                if (!modified) {
188 >                    assertNull(threwAt.get());
189 >                    assertEquals(n, rejects.size());
190 >                    assertEquals(0, accepts.size());
191 >                }
192 >            } catch (ArithmeticException ok) {}
193 >            survivors.removeAll(accepts);
194 >            assertEquals(n - accepts.size(), c.size());
195 >            assertTrue(c.containsAll(survivors));
196 >            assertTrue(survivors.containsAll(rejects));
197 >            for (Object x : accepts) assertFalse(c.contains(x));
198 >            if (threwAt.get() == null)
199 >                assertEquals(accepts.size() + rejects.size(), n);
200 >        } catch (Throwable ex) {
201              System.err.println(impl.klazz());
202 <            System.err.println(c);
203 <            System.err.println(accepts);
204 <            System.err.println(rejects);
202 >            System.err.printf("c=%s%n", c);
203 >            System.err.printf("n=%d%n", n);
204 >            System.err.printf("accepts=%s%n", accepts);
205 >            System.err.printf("rejects=%s%n", rejects);
206              System.err.println(survivors);
207 <            System.err.println(threwAt.get());
207 >            System.err.printf("threw=%s%n", threwAt.get());
208 >            throw ex;
209          }
196        assertEquals(n - accepts.size(), c.size());
197        assertTrue(c.containsAll(survivors));
198        assertTrue(survivors.containsAll(rejects));
199        for (Object x : accepts) assertFalse(c.contains(x));
200        if (threwAt.get() == null)
201            assertEquals(accepts.size() + rejects.size(), n);
210      }
211  
212      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines