modules/graphics/src/test/java/test/com/sun/prism/impl/shape/NativePiscesRasterizerTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:

*** 21,34 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package com.sun.prism.impl.shape; import com.sun.javafx.geom.PathIterator; import com.sun.prism.BasicStroke; import org.junit.Test; public class NativePiscesRasterizerTest { static final int JOIN_BEVEL = BasicStroke.JOIN_BEVEL; static final int JOIN_MITER = BasicStroke.JOIN_MITER; --- 21,35 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package test.com.sun.prism.impl.shape; import com.sun.javafx.geom.PathIterator; import com.sun.prism.BasicStroke; + import com.sun.prism.impl.shape.NativePiscesRasterizerShim; import org.junit.Test; public class NativePiscesRasterizerTest { static final int JOIN_BEVEL = BasicStroke.JOIN_BEVEL; static final int JOIN_MITER = BasicStroke.JOIN_MITER;
*** 56,101 **** static final int bounds10[] = { 0, 0, 10, 10 }; static final byte mask1k[] = new byte[1024]; @Test(expected=java.lang.NullPointerException.class) public void FillNullCoords() { ! NativePiscesRasterizer.produceFillAlphas(null, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullCommands() { ! NativePiscesRasterizer.produceFillAlphas(coords6, null, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullBounds() { ! NativePiscesRasterizer.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, null, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullMask() { ! NativePiscesRasterizer.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, null); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortBounds() { ! NativePiscesRasterizer.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, new int[3], mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortCommands() { ! NativePiscesRasterizer.produceFillAlphas(coords6, move_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test --- 57,102 ---- static final int bounds10[] = { 0, 0, 10, 10 }; static final byte mask1k[] = new byte[1024]; @Test(expected=java.lang.NullPointerException.class) public void FillNullCoords() { ! NativePiscesRasterizerShim.produceFillAlphas(null, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullCommands() { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, null, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullBounds() { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, null, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void FillNullMask() { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, null); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortBounds() { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, move_arr, 1, true, 1, 0, 0, 0, 1, 0, new int[3], mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortCommands() { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, move_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test
*** 111,121 **** case SEG_CLOSE: continue; default: badcmd_arr[1] = (byte) i; try { ! NativePiscesRasterizer.produceFillAlphas(coords6, badcmd_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); throw new RuntimeException("allowed bad command: "+i); } catch (InternalError e) { } --- 112,122 ---- case SEG_CLOSE: continue; default: badcmd_arr[1] = (byte) i; try { ! NativePiscesRasterizerShim.produceFillAlphas(coords6, badcmd_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); throw new RuntimeException("allowed bad command: "+i); } catch (InternalError e) { }
*** 124,202 **** } } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortMoveCoords() { ! NativePiscesRasterizer.produceFillAlphas(coords1, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortLineCoords() { ! NativePiscesRasterizer.produceFillAlphas(coords3, moveline_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortQuadCoords() { ! NativePiscesRasterizer.produceFillAlphas(coords5, movequad_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortCubicCoords() { ! NativePiscesRasterizer.produceFillAlphas(coords7, movecubic_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullCoords() { ! NativePiscesRasterizer.produceStrokeAlphas(null, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullCommands() { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, null, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullBounds() { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, null, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullMask() { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, null); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortBounds() { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, new int[3], mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortCommands() { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, move_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } --- 125,203 ---- } } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortMoveCoords() { ! NativePiscesRasterizerShim.produceFillAlphas(coords1, move_arr, 1, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortLineCoords() { ! NativePiscesRasterizerShim.produceFillAlphas(coords3, moveline_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortQuadCoords() { ! NativePiscesRasterizerShim.produceFillAlphas(coords5, movequad_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void FillShortCubicCoords() { ! NativePiscesRasterizerShim.produceFillAlphas(coords7, movecubic_arr, 2, true, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullCoords() { ! NativePiscesRasterizerShim.produceStrokeAlphas(null, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullCommands() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, null, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullBounds() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, null, mask1k); } @Test(expected=java.lang.NullPointerException.class) public void StrokeNullMask() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, null); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortBounds() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, new int[3], mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortCommands() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, move_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); }
*** 213,223 **** case SEG_CLOSE: continue; default: badcmd_arr[1] = (byte) i; try { ! NativePiscesRasterizer.produceStrokeAlphas(coords6, badcmd_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); throw new RuntimeException("allowed bad command: "+i); } catch (InternalError e) { --- 214,224 ---- case SEG_CLOSE: continue; default: badcmd_arr[1] = (byte) i; try { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords6, badcmd_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); throw new RuntimeException("allowed bad command: "+i); } catch (InternalError e) {
*** 227,261 **** } } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortMoveCoords() { ! NativePiscesRasterizer.produceStrokeAlphas(coords1, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortLineCoords() { ! NativePiscesRasterizer.produceStrokeAlphas(coords3, moveline_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortQuadCoords() { ! NativePiscesRasterizer.produceStrokeAlphas(coords5, movequad_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortCubicCoords() { ! NativePiscesRasterizer.produceStrokeAlphas(coords7, movecubic_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } } --- 228,262 ---- } } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortMoveCoords() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords1, move_arr, 1, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortLineCoords() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords3, moveline_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortQuadCoords() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords5, movequad_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class) public void StrokeShortCubicCoords() { ! NativePiscesRasterizerShim.produceStrokeAlphas(coords7, movecubic_arr, 2, 10, CAP_ROUND, JOIN_ROUND, 10, null, 0, 1, 0, 0, 0, 1, 0, bounds10, mask1k); } }