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

Comparing jsr166/src/test/tck/AtomicLongArrayTest.java (file contents):
Revision 1.27 by jsr166, Tue Sep 24 18:50:44 2013 UTC vs.
Revision 1.32 by jsr166, Sun May 24 01:42:14 2015 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import junit.framework.*;
9   import java.util.Arrays;
10   import java.util.concurrent.atomic.AtomicLongArray;
11  
12 + import junit.framework.Test;
13 + import junit.framework.TestSuite;
14 +
15   public class AtomicLongArrayTest extends JSR166TestCase {
16      public static void main(String[] args) {
17 <        junit.textui.TestRunner.run(suite());
17 >        main(suite(), args);
18      }
19      public static Test suite() {
20          return new TestSuite(AtomicLongArrayTest.class);
# Line 33 | Line 35 | public class AtomicLongArrayTest extends
35      public void testConstructor2NPE() {
36          try {
37              long[] a = null;
38 <            AtomicLongArray aa = new AtomicLongArray(a);
38 >            new AtomicLongArray(a);
39              shouldThrow();
40          } catch (NullPointerException success) {}
41      }
# Line 161 | Line 163 | public class AtomicLongArrayTest extends
163          AtomicLongArray aa = new AtomicLongArray(SIZE);
164          for (int i = 0; i < SIZE; i++) {
165              aa.set(i, 1);
166 <            while (!aa.weakCompareAndSet(i, 1, 2));
167 <            while (!aa.weakCompareAndSet(i, 2, -4));
166 >            do {} while (!aa.weakCompareAndSet(i, 1, 2));
167 >            do {} while (!aa.weakCompareAndSet(i, 2, -4));
168              assertEquals(-4, aa.get(i));
169 <            while (!aa.weakCompareAndSet(i, -4, 7));
169 >            do {} while (!aa.weakCompareAndSet(i, -4, 7));
170              assertEquals(7, aa.get(i));
171          }
172      }
# Line 283 | Line 285 | public class AtomicLongArrayTest extends
285                      assertTrue(v >= 0);
286                      if (v != 0) {
287                          done = false;
288 <                        if (aa.compareAndSet(i, v, v-1))
288 >                        if (aa.compareAndSet(i, v, v - 1))
289                              ++counts;
290                      }
291                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines