/hg/gfx-test: Added nine new tests to the test suite src/org/gfx...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Oct 9 00:22:14 PDT 2012
changeset 26cb5bb2ccf5 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=26cb5bb2ccf5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Oct 09 09:24:59 2012 +0200
Added nine new tests to the test suite src/org/gfxtest/testsuites/PrintTestCubicCurves.java.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/testsuites/PrintTestCubicCurves.java | 361 +++++++++++++++++++
2 files changed, 366 insertions(+), 0 deletions(-)
diffs (383 lines):
diff -r 40480b1689fa -r 26cb5bb2ccf5 ChangeLog
--- a/ChangeLog Mon Oct 08 11:32:50 2012 +0200
+++ b/ChangeLog Tue Oct 09 09:24:59 2012 +0200
@@ -1,3 +1,8 @@
+2012-10-09 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/testsuites/PrintTestCubicCurves.java:
+ Added nine new tests to this test suite.
+
2012-10-08 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/PrintTestQuadraticCurves.java:
diff -r 40480b1689fa -r 26cb5bb2ccf5 src/org/gfxtest/testsuites/PrintTestCubicCurves.java
--- a/src/org/gfxtest/testsuites/PrintTestCubicCurves.java Mon Oct 08 11:32:50 2012 +0200
+++ b/src/org/gfxtest/testsuites/PrintTestCubicCurves.java Tue Oct 09 09:24:59 2012 +0200
@@ -330,6 +330,367 @@
}
/**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to bevel style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapButtJoinBevel(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to bevel style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapRoundJoinBevel(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to bevel style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapSquareJoinBevel(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to miter style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapButtJoinMiter(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to miter style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapRoundJoinMiter(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to miter style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapSquareJoinMiter(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to round style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapButtJoinRound(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to round style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapRoundJoinRound(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.draw(Shape).
+ * Cubic curves are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to round style.
+ * Color of all rendered curves are selected from a grayscale palette.
+ * All rendered cubic curves are represented by a Shape object.
+ *
+ * @param image
+ * image to which lines are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawCubicCurvesChangeWidthCapSquareJoinRound(TestImage image, Graphics2D graphics)
+ {
+ drawCubicCurve(image, graphics, CUBIC_CURVE_STEP, new CubicCurveDrawCallbacks()
+ {
+ /**
+ * Stroke width.
+ */
+ float strokeWidth = 0.0f;
+
+ /**
+ * Callback function called before each cubic curve is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index)
+ {
+ // set stroke width
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
+ // set new stroke width
+ this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth;
+ return;
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args
More information about the distro-pkg-dev
mailing list