[cvs] / jsr166 / src / test / tck / AbstractQueuedLongSynchronizerTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27, Thu May 2 18:01:09 2013 UTC revision 1.28, Tue Dec 2 07:23:13 2014 UTC
# Line 9  Line 9 
9  import junit.framework.*;  import junit.framework.*;
10  import java.util.*;  import java.util.*;
11  import static java.util.concurrent.TimeUnit.MILLISECONDS;  import static java.util.concurrent.TimeUnit.MILLISECONDS;
12    import static java.util.concurrent.TimeUnit.NANOSECONDS;
13  import java.util.concurrent.locks.AbstractQueuedLongSynchronizer;  import java.util.concurrent.locks.AbstractQueuedLongSynchronizer;
14  import java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject;  import java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject;
15    
# Line 1210  Line 1211 
1211          assertFalse(l.isSignalled());          assertFalse(l.isSignalled());
1212      }      }
1213    
1214        /**
1215         * awaitNanos/timed await with 0 wait times out immediately
1216         */
1217        public void testAwait_Zero() throws InterruptedException {
1218            final Mutex sync = new Mutex();
1219            final ConditionObject c = sync.newCondition();
1220            sync.acquire();
1221            assertTrue(c.awaitNanos(0L) <= 0);
1222            assertFalse(c.await(0L, NANOSECONDS));
1223            sync.release();
1224        }
1225    
1226        /**
1227         * awaitNanos/timed await with maximum negative wait times does not underflow
1228         */
1229        public void testAwait_NegativeInfinity() throws InterruptedException {
1230            final Mutex sync = new Mutex();
1231            final ConditionObject c = sync.newCondition();
1232            sync.acquire();
1233            assertTrue(c.awaitNanos(Long.MIN_VALUE) <= 0);
1234            assertFalse(c.await(Long.MIN_VALUE, NANOSECONDS));
1235            sync.release();
1236        }
1237    
1238  }  }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8