test/java/lang/Long/ParsingTest.java
Print this page
rev 10452 : 8054828: [TESTBUG] Typos in java/lang/Long/ParsingTest
@@ -126,14 +126,14 @@
; // Expected
}
}
private static void checkNumberFormatException(String val, int radix, int start) {
- int n = 0;
+ long n = 0;
try {
- n = Integer.parseInt(val, radix, start);
- System.err.println("parseInt(" + val + ", " + radix + ", " + start +
+ n = Long.parseLong(val, radix, start);
+ System.err.println("parseLong(" + val + ", " + radix + ", " + start +
") incorrectly returned " + n);
throw new RuntimeException();
} catch (NumberFormatException nfe) {
; // Expected
}
@@ -141,23 +141,23 @@
private static void checkNumberFormatException(String val, int radix, int start, int end) {
long n = 0;
try {
n = Long.parseLong(val, radix, start, end);
- System.err.println("parseInt(" + val + ", " + radix + ", " + start + ", " + end +
+ System.err.println("parseLong(" + val + ", " + radix + ", " + start + ", " + end +
") incorrectly returned " + n);
throw new RuntimeException();
} catch (NumberFormatException nfe) {
; // Expected
}
}
private static void checkIndexOutOfBoundsException(String val, int radix, int start) {
- int n = 0;
+ long n = 0;
try {
- n = Integer.parseInt(val, radix, start);
- System.err.println("parseInt(" + val + ", " + radix + ", " + start +
+ n = Long.parseLong(val, radix, start);
+ System.err.println("parseLong(" + val + ", " + radix + ", " + start +
") incorrectly returned " + n);
throw new RuntimeException();
} catch (IndexOutOfBoundsException ioob) {
; // Expected
}
@@ -165,11 +165,11 @@
private static void checkIndexOutOfBoundsException(String val, int radix, int start, int end) {
long n = 0;
try {
n = Long.parseLong(val, radix, start, end);
- System.err.println("parseInt(" + val + ", " + radix + ", " + start + ", " + end +
+ System.err.println("parseLong(" + val + ", " + radix + ", " + start + ", " + end +
") incorrectly returned " + n);
throw new RuntimeException();
} catch (IndexOutOfBoundsException ioob) {
; // Expected
}
@@ -177,11 +177,11 @@
private static void checkNull(int radix, int start, int end) {
long n = 0;
try {
n = Long.parseLong(null, 10, start, end);
- System.err.println("parseInt(null, " + radix + ", " + start + ", " + end +
+ System.err.println("parseLong(null, " + radix + ", " + start + ", " + end +
") incorrectly returned " + n);
throw new RuntimeException();
} catch (NullPointerException npe) {
; // Expected
}