/hg/gfx-test: * src/org/gfxtest/testsuites/PrintTestLines.java:

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Jun 1 07:19:48 PDT 2012


changeset fae3942e5a44 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=fae3942e5a44
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jun 01 16:22:21 2012 +0200

	* src/org/gfxtest/testsuites/PrintTestLines.java:
	Added six new tests to this test suite.


diffstat:

 ChangeLog                                      |    5 +
 src/org/gfxtest/testsuites/PrintTestLines.java |  249 ++++++++++++++++++++++++-
 2 files changed, 245 insertions(+), 9 deletions(-)

diffs (355 lines):

diff -r 4fab4e61a60a -r fae3942e5a44 ChangeLog
--- a/ChangeLog	Mon May 28 11:20:35 2012 +0200
+++ b/ChangeLog	Fri Jun 01 16:22:21 2012 +0200
@@ -1,3 +1,8 @@
+2012-06-01  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/PrintTestLines.java:
+	Added six new tests to this test suite.
+
 2012-05-28  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/PrintTestCircles.java:
diff -r 4fab4e61a60a -r fae3942e5a44 src/org/gfxtest/testsuites/PrintTestLines.java
--- a/src/org/gfxtest/testsuites/PrintTestLines.java	Mon May 28 11:20:35 2012 +0200
+++ b/src/org/gfxtest/testsuites/PrintTestLines.java	Fri Jun 01 16:22:21 2012 +0200
@@ -360,7 +360,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_BUTT.
-     * Join style is set bevel style.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -398,7 +398,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_ROUND.
-     * Join style is set bevel style.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -436,7 +436,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE.
-     * Join style is set bevel style.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -474,7 +474,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_BUTT.
-     * Join style is set miter style.
+     * Join style is set to miter style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -512,7 +512,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_ROUND.
-     * Join style is set miter style.
+     * Join style is set to miter style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -550,7 +550,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE.
-     * Join style is set miter style.
+     * Join style is set to miter style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -588,7 +588,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_BUTT.
-     * Join style is set round style.
+     * Join style is set to round style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -626,7 +626,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_ROUND.
-     * Join style is set round style.
+     * Join style is set to round style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -664,7 +664,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE.
-     * Join style is set round style.
+     * Join style is set to round style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -831,6 +831,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Vertical lines are rendered with various width and end caps set to CAP_BUTT.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -868,6 +869,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Vertical lines are rendered with various width and end caps set to CAP_ROUND.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -905,6 +907,7 @@
     /**
      * Test basic behavior of method Graphics.drawLine().
      * Vertical lines are rendered with various width and end caps set to CAP_SQUARE.
+     * Join style is set to bevel style.
      * Color of all rendered lines are set to black.
      *
      * @param image
@@ -940,6 +943,234 @@
     }
 
     /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_BUTT.
+     * Join style is set to miter style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapButtJoinMiter(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_ROUND.
+     * Join style is set to miter style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapRoundJoinMiter(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_SQUARE.
+     * Join style is set to miter style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapSquareJoinMiter(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_BUTT.
+     * Join style is set to round style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapButtJoinRound(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_ROUND.
+     * Join style is set to round style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapRoundJoinRound(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     * Vertical lines are rendered with various width and end caps set to CAP_SQUARE.
+     * Join style is set to round style.
+     * Color of all rendered lines are set to black.
+     *
+     * @param image
+     *            image to which lines are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawVerticalLinesChangeWidthCapSquareJoinRound(TestImage image, Graphics2D graphics)
+    {
+        drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks()
+        {
+            /**
+             * Stroke width.
+             */
+            float strokeWidth = 0.0f;
+
+            /**
+             * Callback function called before each line is rendered.
+             */
+            @Override
+            public void iterationCallBack(int x, 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;
+            }
+        });
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
      * Entry point to the test suite.
      *
      * @param args not used in this case



More information about the distro-pkg-dev mailing list