--- jsr166/src/test/tck/SystemTest.java 2003/09/14 20:42:41 1.2 +++ jsr166/src/test/tck/SystemTest.java 2003/12/27 19:26:44 1.5 @@ -1,23 +1,25 @@ /* - * Written by members of JCP JSR-166 Expert Group and released to the - * public domain. Use, modify, and redistribute this code in any way - * without acknowledgement. Other contributors include Andrew Wright, - * Jeffrey Hayes, Pat Fischer, Mike Judd. + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/licenses/publicdomain + * Other contributors include Andrew Wright, Jeffrey Hayes, + * Pat Fisher, Mike Judd. */ import junit.framework.*; public class SystemTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); + junit.textui.TestRunner.run(suite()); } public static Test suite() { - return new TestSuite(SystemTest.class); + return new TestSuite(SystemTest.class); } /** - * Nanos between readings of millis is no longer than millis. + * Nanos between readings of millis is no longer than millis (plus + * one milli to allow for rounding). * This shows only that nano timing not (much) worse than milli. */ public void testNanoTime1() { @@ -33,10 +35,10 @@ public class SystemTest extends JSR166Te long nanos = n2 - n1; assertTrue(nanos >= 0); - assertTrue(nanos <= millis * 1000000); + assertTrue(nanos < (millis+1) * 1000000); } catch(InterruptedException ie) { - fail("unexpected exception"); + unexpectedException(); } } @@ -60,7 +62,7 @@ public class SystemTest extends JSR166Te assertTrue(millis * 1000000 <= nanos); } catch(InterruptedException ie) { - fail("unexpected exception"); + unexpectedException(); } }