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.6 by jsr166, Sat Oct 29 22:47:55 2016 UTC vs.
Revision 1.8 by jsr166, Thu Nov 3 15:31:25 2016 UTC

# Line 182 | 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 >            assertFalse(survivors.contains(null));
186 >            try {
187 >                boolean modified = c.removeIf(randomPredicate);
188 >                if (!modified) {
189 >                    assertNull(threwAt.get());
190 >                    assertEquals(n, rejects.size());
191 >                    assertEquals(0, accepts.size());
192 >                }
193 >            } catch (ArithmeticException ok) {}
194 >            survivors.removeAll(accepts);
195 >            assertEquals(n - accepts.size(), c.size());
196 >            assertTrue(c.containsAll(survivors));
197 >            assertTrue(survivors.containsAll(rejects));
198 >            for (Object x : accepts) assertFalse(c.contains(x));
199 >            if (threwAt.get() == null)
200 >                assertEquals(accepts.size() + rejects.size(), n);
201 >        } catch (Throwable ex) {
202              System.err.println(impl.klazz());
203 <            System.err.println(c);
204 <            System.err.println(accepts);
205 <            System.err.println(rejects);
206 <            System.err.println(survivors);
207 <            System.err.println(threwAt.get());
203 >            System.err.printf("c=%s%n", c);
204 >            System.err.printf("n=%d%n", n);
205 >            System.err.printf("accepts=%s%n", accepts);
206 >            System.err.printf("rejects=%s%n", rejects);
207 >            System.err.printf("survivors=%s%n", survivors);
208 >            System.err.printf("threw=%s%n", threwAt.get());
209 >            throw ex;
210          }
201        assertEquals(n - accepts.size(), c.size());
202        assertTrue(c.containsAll(survivors));
203        assertTrue(survivors.containsAll(rejects));
204        for (Object x : accepts) assertFalse(c.contains(x));
205        if (threwAt.get() == null)
206            assertEquals(accepts.size() + rejects.size(), n);
211      }
212  
213      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines