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

Comparing jsr166/src/test/tck/AtomicReferenceArrayTest.java (file contents):
Revision 1.23 by jsr166, Fri Jun 10 19:45:01 2011 UTC vs.
Revision 1.24 by jsr166, Fri Jun 10 20:01:21 2011 UTC

# Line 99 | Line 99 | public class AtomicReferenceArrayTest ex
99          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
100          for (int i = 0; i < SIZE; ++i) {
101              ai.set(i, one);
102 <            assertSame(one,ai.get(i));
102 >            assertSame(one, ai.get(i));
103              ai.set(i, two);
104 <            assertSame(two,ai.get(i));
104 >            assertSame(two, ai.get(i));
105              ai.set(i, m3);
106 <            assertSame(m3,ai.get(i));
106 >            assertSame(m3, ai.get(i));
107          }
108      }
109  
# Line 114 | Line 114 | public class AtomicReferenceArrayTest ex
114          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
115          for (int i = 0; i < SIZE; ++i) {
116              ai.lazySet(i, one);
117 <            assertSame(one,ai.get(i));
117 >            assertSame(one, ai.get(i));
118              ai.lazySet(i, two);
119 <            assertSame(two,ai.get(i));
119 >            assertSame(two, ai.get(i));
120              ai.lazySet(i, m3);
121 <            assertSame(m3,ai.get(i));
121 >            assertSame(m3, ai.get(i));
122          }
123      }
124  
# Line 129 | Line 129 | public class AtomicReferenceArrayTest ex
129          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
130          for (int i = 0; i < SIZE; ++i) {
131              ai.set(i, one);
132 <            assertTrue(ai.compareAndSet(i, one,two));
133 <            assertTrue(ai.compareAndSet(i, two,m4));
134 <            assertSame(m4,ai.get(i));
135 <            assertFalse(ai.compareAndSet(i, m5,seven));
136 <            assertSame(m4,ai.get(i));
137 <            assertTrue(ai.compareAndSet(i, m4,seven));
138 <            assertSame(seven,ai.get(i));
132 >            assertTrue(ai.compareAndSet(i, one, two));
133 >            assertTrue(ai.compareAndSet(i, two, m4));
134 >            assertSame(m4, ai.get(i));
135 >            assertFalse(ai.compareAndSet(i, m5, seven));
136 >            assertSame(m4, ai.get(i));
137 >            assertTrue(ai.compareAndSet(i, m4, seven));
138 >            assertSame(seven, ai.get(i));
139          }
140      }
141  
# Line 167 | Line 167 | public class AtomicReferenceArrayTest ex
167          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
168          for (int i = 0; i < SIZE; ++i) {
169              ai.set(i, one);
170 <            while (!ai.weakCompareAndSet(i, one,two));
171 <            while (!ai.weakCompareAndSet(i, two,m4));
172 <            assertSame(m4,ai.get(i));
173 <            while (!ai.weakCompareAndSet(i, m4,seven));
174 <            assertSame(seven,ai.get(i));
170 >            while (!ai.weakCompareAndSet(i, one, two));
171 >            while (!ai.weakCompareAndSet(i, two, m4));
172 >            assertSame(m4, ai.get(i));
173 >            while (!ai.weakCompareAndSet(i, m4, seven));
174 >            assertSame(seven, ai.get(i));
175          }
176      }
177  
# Line 182 | Line 182 | public class AtomicReferenceArrayTest ex
182          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
183          for (int i = 0; i < SIZE; ++i) {
184              ai.set(i, one);
185 <            assertSame(one,ai.getAndSet(i,zero));
186 <            assertSame(zero,ai.getAndSet(i,m10));
187 <            assertSame(m10,ai.getAndSet(i,one));
185 >            assertSame(one, ai.getAndSet(i, zero));
186 >            assertSame(zero, ai.getAndSet(i, m10));
187 >            assertSame(m10, ai.getAndSet(i, one));
188          }
189      }
190  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines