ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/CheckedMapBash.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/CheckedMapBash.java (file contents):
Revision 1.7 by jsr166, Sun Oct 18 06:58:01 2015 UTC vs.
Revision 1.8 by jsr166, Sun Oct 18 07:32:34 2015 UTC

# Line 53 | Line 53 | public class CheckedMapBash {
53              Object newHead;
54              do {
55                  newHead = new Integer(rnd.nextInt());
56 <            } while (m.containsKey(newHead));
56 >            } while (m.containsKey(newHead) || newHead.equals(nil));
57              m.put(newHead, head);
58              head = newHead;
59          }
# Line 99 | Line 99 | public class CheckedMapBash {
99      }
100  
101      @Test(dataProvider = "Supplier<Map<Integer,Integer>>")
102 <    public static void testCheckeMap2(String description, Supplier<Map<Integer,Integer>> supplier) {
102 >    public static void testCheckedMap2(String description, Supplier<Map<Integer,Integer>> supplier) {
103          Map m = supplier.get();
104          for (int i=0; i<mapSize; i++)
105              if (m.put(new Integer(i), new Integer(2*i)) != null)
106 <                fail("put returns a non-null value erroenously.");
106 >                fail("put returns a non-null value erroneously.");
107          for (int i=0; i<2*mapSize; i++)
108              if (m.containsValue(new Integer(i)) != (i%2==0))
109                  fail("contains value "+i);
110          if (m.put(nil, nil) == null)
111 <            fail("put returns a null value erroenously.");
111 >            fail("put returns a null value erroneously.");
112          Map m2 = supplier.get(); m2.putAll(m);
113          if (!m.equals(m2))
114              fail("Clone not equal to original. (1)");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines