4066N/A/*
4066N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4066N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4066N/A *
4066N/A * This code is free software; you can redistribute it and/or modify it
4066N/A * under the terms of the GNU General Public License version 2 only, as
4066N/A * published by the Free Software Foundation.
4066N/A *
4066N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4066N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4066N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4066N/A * version 2 for more details (a copy is included in the LICENSE file that
4066N/A * accompanied this code).
4066N/A *
4066N/A * You should have received a copy of the GNU General Public License version
4066N/A * 2 along with this work; if not, write to the Free Software Foundation,
4066N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4066N/A *
4066N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4066N/A * or visit www.oracle.com if you need additional information or have any
4066N/A * questions.
4066N/A */
4066N/A
4066N/A/**
4066N/A * @test
4066N/A * @bug 7036754
4066N/A *
4066N/A * @summary Verifies that there are no non-finite numbers when stroking
4066N/A * certain quadratic curves.
4066N/A *
4066N/A * @author Jim Graham
4066N/A * @run main Test7036754
4066N/A */
4066N/A
4066N/Aimport java.awt.*;
4066N/Aimport java.awt.geom.*;
4066N/A
4066N/Apublic class Test7036754 {
4066N/A public static void main(String argv[]) {
4066N/A Shape s = new QuadCurve2D.Float(839.24677f, 508.97888f,
4066N/A 839.2953f, 508.97122f,
4066N/A 839.3438f, 508.96353f);
4066N/A s = new BasicStroke(10f).createStrokedShape(s);
4066N/A float nsegs[] = {2, 2, 4, 6, 0};
4066N/A float coords[] = new float[6];
4066N/A PathIterator pi = s.getPathIterator(null);
4066N/A while (!pi.isDone()) {
4066N/A int type = pi.currentSegment(coords);
4066N/A for (int i = 0; i < nsegs[type]; i++) {
4066N/A float c = coords[i];
4066N/A if (Float.isNaN(c) || Float.isInfinite(c)) {
4066N/A throw new RuntimeException("bad value in stroke");
4066N/A }
4066N/A }
4066N/A pi.next();
4066N/A }
4066N/A }
4066N/A}