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

Comparing jsr166/src/test/tck/MapTest.java (file contents):
Revision 1.1 by jsr166, Wed Aug 23 05:33:00 2017 UTC vs.
Revision 1.3 by jsr166, Wed Dec 12 19:50:16 2018 UTC

# Line 102 | Line 102 | public class MapTest extends JSR166TestC
102          final Object v2 = (permitsNullValues && rnd.nextBoolean() && v1 != null)
103              ? null : impl.makeValue(2);
104  
105 <        /** If true, always lands in first bucket in hash tables. */
105 >        // If true, always lands in first bucket in hash tables.
106          final boolean poorHash = rnd.nextBoolean();
107          class Key implements Comparable<Key> {
108              final int i;
# Line 139 | Line 139 | public class MapTest extends JSR166TestC
139          assertEquals(1, m.size());
140      }
141  
142 +    /**
143 +     * "Missing" test found while investigating JDK-8210280.
144 +     * See discussion on mailing list.
145 +     * TODO: randomize
146 +     */
147 +    public void testBug8210280() {
148 +        Map m = impl.emptyMap();
149 +        for (int i = 0; i < 4; i++) m.put(7 + i * 16, 0);
150 +        Map more = impl.emptyMap();
151 +        for (int i = 0; i < 128; i++) more.put(-i, 42);
152 +        m.putAll(more);
153 +        for (int i = 0; i < 4; i++) assertEquals(0, m.get(7 + i * 16));
154 +    }
155 +
156   //     public void testFailsIntentionallyForDebugging() {
157   //         fail(impl.klazz().getSimpleName());
158   //     }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines