6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
import junit.framework.*; |
9 |
|
import java.util.concurrent.atomic.AtomicMarkableReference; |
10 |
|
|
11 |
+ |
import junit.framework.Test; |
12 |
+ |
import junit.framework.TestSuite; |
13 |
+ |
|
14 |
|
public class AtomicMarkableReferenceTest 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(AtomicMarkableReferenceTest.class); |
141 |
|
assertFalse(ai.isMarked()); |
142 |
|
assertFalse(mark[0]); |
143 |
|
|
144 |
< |
while (!ai.weakCompareAndSet(one, two, false, false)); |
144 |
> |
do {} while (!ai.weakCompareAndSet(one, two, false, false)); |
145 |
|
assertSame(two, ai.get(mark)); |
146 |
|
assertFalse(mark[0]); |
147 |
|
|
148 |
< |
while (!ai.weakCompareAndSet(two, m3, false, true)); |
148 |
> |
do {} while (!ai.weakCompareAndSet(two, m3, false, true)); |
149 |
|
assertSame(m3, ai.get(mark)); |
150 |
|
assertTrue(mark[0]); |
151 |
|
} |