jdk/test/java/awt/FontClass/X11FontPathCrashTest.java
author amurillo
Wed, 15 Aug 2012 16:49:38 -0700
changeset 13465 d3fc5d192448
parent 7932 f4ec6ef455c3
permissions -rw-r--r--
7191765: make jdk8 the default jprt release for hs24 Reviewed-by: jcoomes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7932
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     1
/*
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     2
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     4
 *
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     8
 *
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    13
 * accompanied this code).
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    14
 *
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    18
 *
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    21
 * questions.
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    22
 */
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    23
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    24
/*
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    25
 * @test
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    26
 * @bug 6958221
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    27
 * @summary Test no crashing getting fonts on X11
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    28
 * @run main X11FontPathCrashTest
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    29
 */
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    30
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    31
import java.awt.*;
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    32
import java.awt.font.*;
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    33
import java.awt.geom.*;
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    34
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    35
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    36
public class X11FontPathCrashTest {
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    37
    public static void main(String[] args) {
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    38
        new Font("nonexistentfont", Font.PLAIN, 12).getFamily();
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    39
    }
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    40
}
f4ec6ef455c3 6958221: java.awt.Font.getFamily() leads to JVM crash on Linux on JDK7 for "custom" fonts
prr
parents:
diff changeset
    41