Browse Source

Merge "Fix TimeoutInputStreamTest, TimeoutOutputStreamTest assertions"

stable-0.7
Robin Rosenberg 15 years ago committed by Code Review
parent
commit
1dcd2cdfd8
  1. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java
  2. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009, Google Inc. * Copyright (C) 2009-2010, Google Inc.
* and other copyright owners as documented in the project's IP log. * and other copyright owners as documented in the project's IP log.
* *
* This program and the accompanying materials are made available * This program and the accompanying materials are made available
@ -170,7 +170,7 @@ public class TimeoutInputStreamTest extends TestCase {
// 50 ms of the expected timeout. // 50 ms of the expected timeout.
// //
final long wait = now() - start; final long wait = now() - start;
assertTrue(Math.abs(wait - timeout) < 50); assertTrue("waited only " + wait + " ms", timeout - wait < 50);
} }
private static List<Thread> active() { private static List<Thread> active() {

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009, Google Inc. * Copyright (C) 2009-2010, Google Inc.
* and other copyright owners as documented in the project's IP log. * and other copyright owners as documented in the project's IP log.
* *
* This program and the accompanying materials are made available * This program and the accompanying materials are made available
@ -251,7 +251,7 @@ public class TimeoutOutputStreamTest extends TestCase {
// 50 ms of the expected timeout. // 50 ms of the expected timeout.
// //
final long wait = now() - start; final long wait = now() - start;
assertTrue(Math.abs(wait - timeout) < 50); assertTrue("waited only " + wait + " ms", timeout - wait < 50);
} }
private static List<Thread> active() { private static List<Thread> active() {

Loading…
Cancel
Save