mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 21:33:59 +08:00
FileHandleGcTest.out: New file.
2001-12-20 Andrew Haley <aph@redhat.com> * libjava.lang/FileHandleGcTest.out: New file. * libjava.lang/FileHandleGcTest.java: New file. * libjava.lang/Array_3.out: New file. * libjava.lang/Array_3.java: New file. From-SVN: r48201
This commit is contained in:
parent
bcdd764b27
commit
76eceb1ec3
@ -1,3 +1,10 @@
|
||||
2001-12-20 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* libjava.lang/FileHandleGcTest.out: New file.
|
||||
* libjava.lang/FileHandleGcTest.java: New file.
|
||||
* libjava.lang/Array_3.out: New file.
|
||||
* libjava.lang/Array_3.java: New file.
|
||||
|
||||
2001-12-18 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
For PR java/3417:
|
||||
|
59
libjava/testsuite/libjava.lang/Array_3.java
Normal file
59
libjava/testsuite/libjava.lang/Array_3.java
Normal file
@ -0,0 +1,59 @@
|
||||
// Test to make sure null arrays throw the right execption
|
||||
|
||||
public class Array_3
|
||||
{
|
||||
static Object foo ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
static int[] bar ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String args[])
|
||||
{
|
||||
boolean ok = false;
|
||||
int nn = 0;
|
||||
|
||||
try
|
||||
{
|
||||
int[] x = (int[])foo();
|
||||
nn = x.length;
|
||||
}
|
||||
catch (NullPointerException _)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
if (!ok)
|
||||
throw new RuntimeException("test failed");
|
||||
|
||||
ok = false;
|
||||
try
|
||||
{
|
||||
int[] x = bar();
|
||||
nn = x.length;
|
||||
}
|
||||
catch (NullPointerException _)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
if (!ok)
|
||||
throw new RuntimeException("test failed");
|
||||
|
||||
ok = false;
|
||||
try
|
||||
{
|
||||
int[] x = bar();
|
||||
nn = x[0];
|
||||
}
|
||||
catch (NullPointerException _)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (!ok || nn != 0)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
}
|
0
libjava/testsuite/libjava.lang/Array_3.out
Normal file
0
libjava/testsuite/libjava.lang/Array_3.out
Normal file
24
libjava/testsuite/libjava.lang/FileHandleGcTest.java
Normal file
24
libjava/testsuite/libjava.lang/FileHandleGcTest.java
Normal file
@ -0,0 +1,24 @@
|
||||
// Make sure that file handles are garbage collected.
|
||||
import java.io.*;
|
||||
public class FileHandleGcTest
|
||||
{
|
||||
static void kill () throws FileNotFoundException
|
||||
{
|
||||
for (int i = 0; i < 65536; i++)
|
||||
{
|
||||
FileInputStream f = new FileInputStream ("/dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
public static void
|
||||
main (String argv [])
|
||||
{
|
||||
try
|
||||
{
|
||||
kill ();
|
||||
}
|
||||
catch (FileNotFoundException _)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
0
libjava/testsuite/libjava.lang/FileHandleGcTest.out
Normal file
0
libjava/testsuite/libjava.lang/FileHandleGcTest.out
Normal file
Loading…
Reference in New Issue
Block a user