test/java/lang/Long/Unsigned.java
Print this page
rev 10594 : 8055251: Re-examine Integer.parseInt and Long.parseLong methods
*** 287,296 ****
--- 287,307 ----
errors++;
System.err.printf("Bad roundtrip conversion of %d in base %d" +
"\tconverting back ''%s'' resulted in %d%n",
value, radix, bigString, longResult);
}
+
+ // test offset based parse method
+ longResult = Long.parseUnsignedLong("prefix" + bigString + "suffix", "prefix".length(),
+ "prefix".length() + bigString.length(), radix);
+
+ if (!toUnsignedBigInt(longResult).equals(value)) {
+ errors++;
+ System.err.printf("Bad roundtrip conversion of %d in base %d" +
+ "\tconverting back ''%s'' resulted in %d%n",
+ value, radix, bigString, longResult);
+ }
}
}
String[] outOfRange = {
null,