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

Comparing jsr166/src/test/tck/AtomicReferenceArrayTest.java (file contents):
Revision 1.28 by jsr166, Thu May 30 03:28:55 2013 UTC vs.
Revision 1.32 by jsr166, Sat Apr 25 04:55:30 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.AtomicReferenceArray;
11  
12 + import junit.framework.Test;
13 + import junit.framework.TestSuite;
14 +
15   public class AtomicReferenceArrayTest 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(AtomicReferenceArrayTest.class);
# Line 34 | Line 36 | public class AtomicReferenceArrayTest ex
36      public void testConstructor2NPE() {
37          try {
38              Integer[] a = null;
39 <            AtomicReferenceArray<Integer> aa = new AtomicReferenceArray<Integer>(a);
39 >            new AtomicReferenceArray<Integer>(a);
40              shouldThrow();
41          } catch (NullPointerException success) {}
42      }
# Line 169 | Line 171 | public class AtomicReferenceArrayTest ex
171          AtomicReferenceArray aa = new AtomicReferenceArray(SIZE);
172          for (int i = 0; i < SIZE; i++) {
173              aa.set(i, one);
174 <            while (!aa.weakCompareAndSet(i, one, two));
175 <            while (!aa.weakCompareAndSet(i, two, m4));
174 >            do {} while (!aa.weakCompareAndSet(i, one, two));
175 >            do {} while (!aa.weakCompareAndSet(i, two, m4));
176              assertSame(m4, aa.get(i));
177 <            while (!aa.weakCompareAndSet(i, m4, seven));
177 >            do {} while (!aa.weakCompareAndSet(i, m4, seven));
178              assertSame(seven, aa.get(i));
179          }
180      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines