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

Comparing jsr166/src/test/tck/LongAccumulatorTest.java (file contents):
Revision 1.6 by jsr166, Fri Oct 16 16:32:15 2015 UTC vs.
Revision 1.7 by jsr166, Sun Apr 23 03:03:16 2017 UTC

# Line 21 | Line 21 | public class LongAccumulatorTest extends
21      }
22  
23      /**
24 <     * default constructed initializes to zero
24 >     * new instance initialized to supplied identity
25       */
26      public void testConstructor() {
27 <        LongAccumulator ai = new LongAccumulator(Long::max, 0L);
28 <        assertEquals(0, ai.get());
27 >        for (long identity : new long[] { Long.MIN_VALUE, 0, Long.MAX_VALUE })
28 >            assertEquals(identity,
29 >                         new LongAccumulator(Long::max, identity).get());
30      }
31  
32      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines