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.7 by jsr166, Mon Oct 31 20:08:40 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 >            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          }
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);
210      }
211  
212      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines