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

Comparing jsr166/src/test/tck/AtomicIntegerTest.java (file contents):
Revision 1.26 by jsr166, Wed Dec 31 19:05:42 2014 UTC vs.
Revision 1.32 by jsr166, Fri Aug 4 03:30:21 2017 UTC

# Line 13 | Line 13 | import junit.framework.TestSuite;
13  
14   public class AtomicIntegerTest extends JSR166TestCase {
15      public static void main(String[] args) {
16 <        junit.textui.TestRunner.run(suite());
16 >        main(suite(), args);
17      }
18      public static Test suite() {
19          return new TestSuite(AtomicIntegerTest.class);
# Line 102 | Line 102 | public class AtomicIntegerTest extends J
102       */
103      public void testWeakCompareAndSet() {
104          AtomicInteger ai = new AtomicInteger(1);
105 <        while (!ai.weakCompareAndSet(1, 2));
106 <        while (!ai.weakCompareAndSet(2, -4));
105 >        do {} while (!ai.weakCompareAndSet(1, 2));
106 >        do {} while (!ai.weakCompareAndSet(2, -4));
107          assertEquals(-4, ai.get());
108 <        while (!ai.weakCompareAndSet(-4, 7));
108 >        do {} while (!ai.weakCompareAndSet(-4, 7));
109          assertEquals(7, ai.get());
110      }
111  
# Line 191 | Line 191 | public class AtomicIntegerTest extends J
191      }
192  
193      /**
194 <     * a deserialized serialized atomic holds same value
194 >     * a deserialized/reserialized atomic holds same value
195       */
196      public void testSerialization() throws Exception {
197          AtomicInteger x = new AtomicInteger();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines