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

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

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

revision 1.44, Thu May 2 18:01:09 2013 UTC revision 1.45, 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.AbstractQueuedSynchronizer;  import java.util.concurrent.locks.AbstractQueuedSynchronizer;
14  import java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject;  import java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject;
15    
# Line 1213  Line 1214 
1214          assertFalse(l.isSignalled());          assertFalse(l.isSignalled());
1215      }      }
1216    
1217        /**
1218         * awaitNanos/timed await with 0 wait times out immediately
1219         */
1220        public void testAwait_Zero() throws InterruptedException {
1221            final Mutex sync = new Mutex();
1222            final ConditionObject c = sync.newCondition();
1223            sync.acquire();
1224            assertTrue(c.awaitNanos(0L) <= 0);
1225            assertFalse(c.await(0L, NANOSECONDS));
1226            sync.release();
1227        }
1228    
1229        /**
1230         * awaitNanos/timed await with maximum negative wait times does not underflow
1231         */
1232        public void testAwait_NegativeInfinity() throws InterruptedException {
1233            final Mutex sync = new Mutex();
1234            final ConditionObject c = sync.newCondition();
1235            sync.acquire();
1236            assertTrue(c.awaitNanos(Long.MIN_VALUE) <= 0);
1237            assertFalse(c.await(Long.MIN_VALUE, NANOSECONDS));
1238            sync.release();
1239        }
1240    
1241  }  }

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8