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

Comparing jsr166/src/test/tck/AtomicLongTest.java (file contents):
Revision 1.6 by dl, Sat Dec 27 19:26:43 2003 UTC vs.
Revision 1.9 by dl, Sun Jan 11 01:31:34 2004 UTC

# Line 27 | Line 27 | public class AtomicLongTest extends JSR1
27      }
28  
29      /**
30 <     * default constructed intializes to zero
30 >     * default constructed initializes to zero
31       */
32      public void testConstructor2(){
33          AtomicLong ai = new AtomicLong();
# Line 198 | Line 198 | public class AtomicLongTest extends JSR1
198          }
199      }
200  
201 +    /**
202 +     * toString returns current value.
203 +     */
204 +    public void testToString() {
205 +        AtomicLong ai = new AtomicLong();
206 +        for (long i = -12; i < 6; ++i) {
207 +            ai.set(i);
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines