Divide_1.java: Add may more test cases.
2001-07-06 Andrew Haley <aph@cambridge.redhat.com> * libjava.lang/Divide_1.java: Add may more test cases. * libjava.lang/Divide_1.out: Likewise. From-SVN: r43812
This commit is contained in:
parent
936031411f
commit
b32685987f
3 changed files with 117 additions and 3 deletions
|
@ -4,7 +4,7 @@ public class Divide_1
|
|||
int b1 = Integer.parseInt ("-1");
|
||||
static int zero = Integer.parseInt ("0");
|
||||
|
||||
void probe ()
|
||||
void probe_1 ()
|
||||
{
|
||||
try {
|
||||
int a = Integer.parseInt ("-80000000", 16);
|
||||
|
@ -98,8 +98,106 @@ public class Divide_1
|
|||
System.out.println (_);
|
||||
}
|
||||
}
|
||||
|
||||
void probe_2 ()
|
||||
{
|
||||
try {
|
||||
int a = -0x80000000;
|
||||
int c = a/b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
int a = -0x80000000;
|
||||
int c = a/-1;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
public static void main (String[] args) {
|
||||
new Divide_1 ().probe ();
|
||||
try {
|
||||
int a = -0x80000000;
|
||||
int c = a%b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
int a = -0x80000000;
|
||||
int c = a%b1;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
int a = -0x80000000;
|
||||
int c = a%-1;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
int a = 0x8000;
|
||||
int b = 0;
|
||||
int c = a/b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
int a = 0x8000;
|
||||
int b = 0;
|
||||
int c = a%b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
long a = -0x7fffffffffffffffL - 1;
|
||||
long c = a/b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
long a = -0x7fffffffffffffffL - 1;
|
||||
long c = a%b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
long a = 0x8000;
|
||||
long b = 0;
|
||||
long c = a/b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
|
||||
try {
|
||||
long a = 0x8000;
|
||||
long b = 0;
|
||||
long c = a%b;
|
||||
System.out.println (c);
|
||||
} catch (Exception _) {
|
||||
System.out.println (_);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
Divide_1 d = new Divide_1 ();
|
||||
d.probe_1 ();
|
||||
d.probe_2 ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue