jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java
changeset 2609 1db65c97bddc
parent 2606 09ad5edb5330
child 5506 202f599c92aa
--- a/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java	Fri Feb 20 13:48:32 2009 +0300
+++ b/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java	Tue Mar 03 16:10:37 2009 -0800
@@ -55,17 +55,23 @@
         if (!gotException) {
             throw new RuntimeException("No expected IOException");
         }
-        badRead(-2);
-        badRead(8193);
+        badRead(-2, Font.TRUETYPE_FONT);
+        badRead(8193, Font.TRUETYPE_FONT);
+
+        badRead(-2, Font.TYPE1_FONT);
+        badRead(8193, Font.TYPE1_FONT);
+
+        // Make sure GC has a chance to clean up before we exit.
+        System.gc(); System.gc();
     }
 
-    static void badRead(final int retval) {
+    static void badRead(final int retval, int fontType) {
         int num = 2;
         byte[] buff = new byte[16*8192]; // Multiple of 8192 is important.
         for (int ct=0; ct<num; ++ct) {
             try {
                 Font.createFont(
-                    Font.TRUETYPE_FONT,
+                    fontType,
                     new ByteArrayInputStream(buff) {
                         @Override
                         public int read(byte[] buff, int off, int len) {