Mercurial > hg > gfx-test
changeset 515:c9406ec8b549 draft
Six new test added to the test suite CAGOperationsOnRoundRectangleAndRectangle.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Fri, 17 Jan 2014 13:10:50 +0100 |
parents | 23845c2f1cbc |
children | aa23d4954918 |
files | ChangeLog src/org/gfxtest/testsuites/CAGOperationsOnRoundRectangleAndRectangle.java |
diffstat | 2 files changed, 147 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Jan 16 10:03:33 2014 +0100 +++ b/ChangeLog Fri Jan 17 13:10:50 2014 +0100 @@ -1,3 +1,8 @@ +2014-01-17 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/gfxtest/testsuites/CAGOperationsOnRoundRectangleAndRectangle.java: + Six new test added to the test suite CAGOperationsOnRoundRectangleAndRectangle. + 2014-01-16 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/gfxtest/framework/CommonCAGOperations.java:
--- a/src/org/gfxtest/testsuites/CAGOperationsOnRoundRectangleAndRectangle.java Thu Jan 16 10:03:33 2014 +0100 +++ b/src/org/gfxtest/testsuites/CAGOperationsOnRoundRectangleAndRectangle.java Fri Jan 17 13:10:50 2014 +0100 @@ -102,6 +102,148 @@ } /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using subtract operator. The shape is + * rendered using stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testSubtractStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingSubtractOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using inverse subtract operator. The shape is + * rendered using stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testInverseSubtractStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingInverseSubtractOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using intersect operator. The shape is + * rendered using stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testIntersectStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingIntersectOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using exclusive or operator. The shape is + * rendered using stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testXorStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingXorOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using union operator. The shape is + * rendered using wide stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testUnionWideStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeThickWidth(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingUnionOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** + * Checks the process of creating and rendering new geometric shape + * constructed from two rectangles using subtract operator. The shape is + * rendered using wide stroke. + * + * @param image + * image to which area is to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testSubtractWideStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeThickWidth(graphics2d); + // create area using union operator + Area area = CommonCAGOperations.createAreaFromRoundRectangleAndRectangleUsingSubtractOperator(image); + // draw the area + graphics2d.draw(area); + // test result + return TestResult.PASSED; + } + + /** * Entry point to the test suite. * * @param args not used in this case