208 |
|
assertEquals(ai.toString(), Long.toString(i)); |
209 |
|
} |
210 |
|
} |
211 |
+ |
|
212 |
+ |
/** |
213 |
+ |
* longValue returns current value. |
214 |
+ |
*/ |
215 |
+ |
public void testLongValue() { |
216 |
+ |
AtomicLong ai = new AtomicLong(); |
217 |
+ |
for (int i = -12; i < 6; ++i) { |
218 |
+ |
ai.set(i); |
219 |
+ |
assertEquals((long)i, ai.longValue()); |
220 |
+ |
} |
221 |
+ |
} |
222 |
+ |
|
223 |
+ |
/** |
224 |
+ |
* floatValue returns current value. |
225 |
+ |
*/ |
226 |
+ |
public void testFloatValue() { |
227 |
+ |
AtomicLong ai = new AtomicLong(); |
228 |
+ |
for (int i = -12; i < 6; ++i) { |
229 |
+ |
ai.set(i); |
230 |
+ |
assertEquals((float)i, ai.floatValue()); |
231 |
+ |
} |
232 |
+ |
} |
233 |
+ |
|
234 |
+ |
/** |
235 |
+ |
* doubleValue returns current value. |
236 |
+ |
*/ |
237 |
+ |
public void testDoubleValue() { |
238 |
+ |
AtomicLong ai = new AtomicLong(); |
239 |
+ |
for (int i = -12; i < 6; ++i) { |
240 |
+ |
ai.set(i); |
241 |
+ |
assertEquals((double)i, ai.doubleValue()); |
242 |
+ |
} |
243 |
+ |
} |
244 |
+ |
|
245 |
+ |
|
246 |
|
} |