ICU-8022 #7316 is also reproduced with OpenJDK 6. Updated the test case to make it work on OpenJDK 6.

X-SVN-Rev: 29127
This commit is contained in:
Yoshito Umaoka 2010-12-01 22:37:53 +00:00
parent 3357036c2e
commit 8566e3907d

View file

@ -4551,12 +4551,9 @@ public class DiagBigDecimal extends TestFmwk {
d = d / ((double) 10);
(new Test("val211")).ok = (com.ibm.icu.math.BigDecimal.valueOf(d).toString()).equals("0.09");
d = d / ((double) 10);
// The primitive double 0.009 is different in java 7. In java <= 6, there is a trailing 0 (e.g 0.0090).
if (System.getProperty("java.version").charAt(2) >= '7') {
(new Test("val212")).ok = (com.ibm.icu.math.BigDecimal.valueOf(d).toString()).equals("0.009");
} else {
(new Test("val212")).ok = (com.ibm.icu.math.BigDecimal.valueOf(d).toString()).equals("0.0090");
}
// The primitive double 0.009 is different in OpenJDK. In Oracle/IBM java <= 6, there is a trailing 0 (e.g 0.0090).
String s = com.ibm.icu.math.BigDecimal.valueOf(d).toString();
(new Test("val212")).ok = s.equals("0.0090") || s.equals("0.009");;
d = d / ((double) 10);
(new Test("val213")).ok = (com.ibm.icu.math.BigDecimal.valueOf(d).toString()).equals("9.0E-4");
d = d / ((double) 10);