[logback-dev] svn commit: r1801 - in logback/trunk/logback-classic: . src/test/java/ch/qos/logback/classic/spi
noreply.ceki at qos.ch
noreply.ceki at qos.ch
Mon Sep 8 21:22:04 CEST 2008
Author: ceki
Date: Mon Sep 8 21:22:04 2008
New Revision: 1801
Modified:
logback/trunk/logback-classic/ (props changed)
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java
Log:
be more lenient with non Sun JVMs
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java Mon Sep 8 21:22:04 2008
@@ -28,11 +28,12 @@
}
}
}
-
- @Test public void otherJD() {
+
+ @Test
+ public void otherJD() {
System.out.println(SystemInfo.getJavaVendor());
}
-
+
@Test
public void smoke() throws Exception {
Throwable t = new Throwable("x");
@@ -87,8 +88,17 @@
double d1 = loop(len, true);
System.out.println("with packaging info " + d1 + " microseconds");
- assertTrue("computing class packaging data (" + d1
- + ") should have been less than six times the time it takes to process an exception " + (d0 * 6),
- d0 * 6 > d1);
+
+ int slackFactor = 6;
+ if (!SystemInfo.getJavaVendor().contains("Sun")) {
+ // be more lenient with other JDKs
+ slackFactor = 10;
+ }
+ assertTrue(
+ "computing class packaging data ("
+ + d1
+ + ") should have been less than "+slackFactor+" times the time it takes to process an exception "
+ + (d0 * slackFactor), d0 * slackFactor > d1);
+
}
}
More information about the logback-dev
mailing list