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

Comparing jsr166/src/test/tck/AtomicIntegerArrayTest.java (file contents):
Revision 1.28 by jsr166, Tue Sep 24 18:50:44 2013 UTC vs.
Revision 1.30 by jsr166, Wed Dec 31 19:21:20 2014 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.AtomicIntegerArray;
11  
12 + import junit.framework.Test;
13 + import junit.framework.TestSuite;
14 +
15   public class AtomicIntegerArrayTest extends JSR166TestCase {
16  
17      public static void main(String[] args) {
# Line 162 | Line 164 | public class AtomicIntegerArrayTest exte
164          AtomicIntegerArray aa = new AtomicIntegerArray(SIZE);
165          for (int i = 0; i < SIZE; i++) {
166              aa.set(i, 1);
167 <            while (!aa.weakCompareAndSet(i, 1, 2));
168 <            while (!aa.weakCompareAndSet(i, 2, -4));
167 >            do {} while (!aa.weakCompareAndSet(i, 1, 2));
168 >            do {} while (!aa.weakCompareAndSet(i, 2, -4));
169              assertEquals(-4, aa.get(i));
170 <            while (!aa.weakCompareAndSet(i, -4, 7));
170 >            do {} while (!aa.weakCompareAndSet(i, -4, 7));
171              assertEquals(7, aa.get(i));
172          }
173      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines