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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Aug 16 02:58:59 PDT 2011


changeset d09593767afc in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=d09593767afc
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Aug 16 12:00:43 2011 +0200

	* src/org/gfxtest/testsuites/BlankImage.java: Added new test cases
	(rendering using transparency etc.), added JavaDoc.


diffstat:

 ChangeLog                                  |    5 +
 src/org/gfxtest/testsuites/BlankImage.java |  278 ++++++++++++++++++++++++++++-
 2 files changed, 276 insertions(+), 7 deletions(-)

diffs (334 lines):

diff -r fd3ba8985b59 -r d09593767afc ChangeLog
--- a/ChangeLog	Fri Aug 12 16:05:39 2011 +0200
+++ b/ChangeLog	Tue Aug 16 12:00:43 2011 +0200
@@ -1,3 +1,8 @@
+2011-08-16  Pavel Tisnovsky  <ptisnovs at redhat.com>
+	* src/org/gfxtest/testsuites/BlankImage.java:
+	Added new test cases (rendering using transparency etc.), added
+	JavaDoc.
+
 2011-08-12  Pavel Tisnovsky  <ptisnovs at redhat.com>
 	* src/org/gfxtest/testsuites/NormalQuadraticCurves.java:
 	* src/org/gfxtest/testsuites/NormalQuadraticCurvesAsPaths.java:
diff -r fd3ba8985b59 -r d09593767afc src/org/gfxtest/testsuites/BlankImage.java
--- a/src/org/gfxtest/testsuites/BlankImage.java	Fri Aug 12 16:05:39 2011 +0200
+++ b/src/org/gfxtest/testsuites/BlankImage.java	Tue Aug 16 12:00:43 2011 +0200
@@ -58,47 +58,311 @@
 public class BlankImage extends GfxTest
 {
 
-    public TestResult test0(TestImage image, Graphics2D graphics)
+    /**
+     * Basic test of graphics test framework - it just passes and does not erase
+     * nor fill the image.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBasicTest(TestImage image, Graphics2D graphics)
     {
         return TestResult.PASSED;
     }
 
-    public TestResult test1(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with pure black color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithBlackColor(TestImage image, Graphics2D graphics)
     {
         image.fillImage(Color.BLACK);
         return TestResult.PASSED;
     }
 
-    public TestResult test2(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with pure white color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithWhiteColor(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(Color.WHITE);
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with pure red color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithRedColor(TestImage image, Graphics2D graphics)
     {
         image.fillImage(Color.RED);
         return TestResult.PASSED;
     }
 
-    public TestResult test3(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with pure green color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithGreenColor(TestImage image, Graphics2D graphics)
     {
         image.fillImage(Color.GREEN);
         return TestResult.PASSED;
     }
 
-    public TestResult test4(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with pure blue color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithBlueColor(TestImage image, Graphics2D graphics)
     {
         image.fillImage(Color.BLUE);
         return TestResult.PASSED;
     }
 
-    public TestResult test5(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with mixed color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithMixedColor1(TestImage image, Graphics2D graphics)
     {
         image.fillImage(new Color(0x7f, 0x7f, 0x00));
         return TestResult.PASSED;
     }
 
-    public TestResult test6(TestImage image, Graphics2D graphics)
+    /**
+     * This test fill image with mixed color.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithMixedColor2(TestImage image, Graphics2D graphics)
     {
         image.fillImage(new Color(0.5f, 0.0f, 1.0f));
         return TestResult.PASSED;
     }
 
+    /**
+     * This test fill image with semitransparent red color with 0% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentRedColor1(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent red color with 33% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentRedColor2(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.33f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent red color with 66% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentRedColor3(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.66f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent red color with 100% opacity.
+     * 
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentRedColor4(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 1.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent blue color with 0% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentBlueColor1(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(0.0f, 0.0f, 1.0f, 0.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent blue color with 33% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentBlueColor2(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(0.0f, 0.0f, 1.0f, 0.33f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent blue color with 66% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentBlueColor3(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(0.0f, 0.0f, 1.0f, 0.66f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent blue color with 100% opacity.
+     * 
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentBlueColor4(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(0.0f, 0.0f, 1.0f, 1.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent green color with 0% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentGreenColor1(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent green color with 33% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentGreenColor2(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.33f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent green color with 66% opacity.
+     *
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentGreenColor3(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 0.66f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * This test fill image with semitransparent green color with 100% opacity.
+     * 
+     * @param image
+     *            image to which two dimensional shape is to be rendered
+     * @param graphics
+     *            graphics context for image
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testFillWithSemiTransparentGreenColor4(TestImage image, Graphics2D graphics)
+    {
+        image.fillImage(new Color(1.0f, 0.0f, 0.0f, 1.0f));
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Entry point to the test suite.
+     *
+     * @param args not used in this case
+     */
     public static void main(String[] args)
     {
         new BlankImage().runTestSuite(args);



More information about the distro-pkg-dev mailing list