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

Comparing jsr166/src/test/tck/AtomicBooleanTest.java (file contents):
Revision 1.20 by jsr166, Fri Jun 10 20:01:21 2011 UTC vs.
Revision 1.27 by jsr166, Fri Jun 17 19:00:48 2016 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import junit.framework.*;
9   import java.util.concurrent.atomic.AtomicBoolean;
10  
11 + import junit.framework.Test;
12 + import junit.framework.TestSuite;
13 +
14   public class AtomicBooleanTest 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(AtomicBooleanTest.class);
# Line 95 | Line 97 | public class AtomicBooleanTest extends J
97       */
98      public void testWeakCompareAndSet() {
99          AtomicBoolean ai = new AtomicBoolean(true);
100 <        while (!ai.weakCompareAndSet(true, false));
100 >        do {} while (!ai.weakCompareAndSet(true, false));
101          assertFalse(ai.get());
102 <        while (!ai.weakCompareAndSet(false, false));
102 >        do {} while (!ai.weakCompareAndSet(false, false));
103          assertFalse(ai.get());
104 <        while (!ai.weakCompareAndSet(false, true));
104 >        do {} while (!ai.weakCompareAndSet(false, true));
105          assertTrue(ai.get());
106      }
107  
# Line 132 | Line 134 | public class AtomicBooleanTest extends J
134       */
135      public void testToString() {
136          AtomicBoolean ai = new AtomicBoolean();
137 <        assertEquals(ai.toString(), Boolean.toString(false));
137 >        assertEquals(Boolean.toString(false), ai.toString());
138          ai.set(true);
139 <        assertEquals(ai.toString(), Boolean.toString(true));
139 >        assertEquals(Boolean.toString(true), ai.toString());
140      }
141  
142   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines