[cvs] / jsr166 / src / test / tck / Atomic8Test.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/Atomic8Test.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8, Sat Sep 24 18:38:13 2016 UTC revision 1.9, Wed Jan 4 06:09:58 2017 UTC
# Line 289  Line 289 
289       * result of supplied function       * result of supplied function
290       */       */
291      public void testReferenceArrayGetAndUpdate() {      public void testReferenceArrayGetAndUpdate() {
292          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<Integer>(1);          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<>(1);
293          a.set(0, one);          a.set(0, one);
294          assertEquals((Integer) 1, a.getAndUpdate(0, Atomic8Test::addInteger17));          assertEquals((Integer) 1, a.getAndUpdate(0, Atomic8Test::addInteger17));
295          assertEquals((Integer) 18, a.getAndUpdate(0, Atomic8Test::addInteger17));          assertEquals((Integer) 18, a.getAndUpdate(0, Atomic8Test::addInteger17));
# Line 301  Line 301 
301       * returns result.       * returns result.
302       */       */
303      public void testReferenceArrayUpdateAndGet() {      public void testReferenceArrayUpdateAndGet() {
304          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<Integer>(1);          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<>(1);
305          a.set(0, one);          a.set(0, one);
306          assertEquals((Integer) 18, a.updateAndGet(0, Atomic8Test::addInteger17));          assertEquals((Integer) 18, a.updateAndGet(0, Atomic8Test::addInteger17));
307          assertEquals((Integer) 35, a.updateAndGet(0, Atomic8Test::addInteger17));          assertEquals((Integer) 35, a.updateAndGet(0, Atomic8Test::addInteger17));
# Line 312  Line 312 
312       * with supplied function.       * with supplied function.
313       */       */
314      public void testReferenceArrayGetAndAccumulate() {      public void testReferenceArrayGetAndAccumulate() {
315          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<Integer>(1);          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<>(1);
316          a.set(0, one);          a.set(0, one);
317          assertEquals((Integer) 1, a.getAndAccumulate(0, 2, Atomic8Test::sumInteger));          assertEquals((Integer) 1, a.getAndAccumulate(0, 2, Atomic8Test::sumInteger));
318          assertEquals((Integer) 3, a.getAndAccumulate(0, 3, Atomic8Test::sumInteger));          assertEquals((Integer) 3, a.getAndAccumulate(0, 3, Atomic8Test::sumInteger));
# Line 324  Line 324 
324       * returns result.       * returns result.
325       */       */
326      public void testReferenceArrayAccumulateAndGet() {      public void testReferenceArrayAccumulateAndGet() {
327          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<Integer>(1);          AtomicReferenceArray<Integer> a = new AtomicReferenceArray<>(1);
328          a.set(0, one);          a.set(0, one);
329          assertEquals((Integer) 7, a.accumulateAndGet(0, 6, Atomic8Test::sumInteger));          assertEquals((Integer) 7, a.accumulateAndGet(0, 6, Atomic8Test::sumInteger));
330          assertEquals((Integer) 10, a.accumulateAndGet(0, 3, Atomic8Test::sumInteger));          assertEquals((Integer) 10, a.accumulateAndGet(0, 3, Atomic8Test::sumInteger));

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8