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

Comparing jsr166/src/test/tck/AtomicInteger9Test.java (file contents):
Revision 1.1 by jsr166, Fri Jun 17 19:00:48 2016 UTC vs.
Revision 1.2 by jsr166, Tue Oct 11 20:38:07 2016 UTC

# Line 135 | Line 135 | public class AtomicInteger9Test extends
135      }
136  
137      /**
138 +     * repeated weakCompareAndSetPlain succeeds in changing value when equal
139 +     * to expected
140 +     */
141 +    public void testWeakCompareAndSetPlain() {
142 +        AtomicInteger ai = new AtomicInteger(1);
143 +        do {} while (!ai.weakCompareAndSetPlain(1, 2));
144 +        do {} while (!ai.weakCompareAndSetPlain(2, -4));
145 +        assertEquals(-4, ai.get());
146 +        do {} while (!ai.weakCompareAndSetPlain(-4, 7));
147 +        assertEquals(7, ai.get());
148 +    }
149 +
150 +    /**
151       * repeated weakCompareAndSetVolatile succeeds in changing value when equal
152       * to expected
153       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines