You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrey Pavlenko (JIRA)" <ji...@apache.org> on 2007/03/02 15:56:51 UTC

[jira] Updated: (HARMONY-2884) [classlib][awt] Compatibility: java.awt.image.Raster.createPackedRaster() throws RasterFormatException on RI while it doesn't on Harmony

     [ https://issues.apache.org/jira/browse/HARMONY-2884?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Pavlenko updated HARMONY-2884:
-------------------------------------

    Attachment: RasterTest.patch

Alexey, the failing test is incorrect because the size of the DataBuffer could not be 0 in this case. This patch fixes the test.

> [classlib][awt] Compatibility: java.awt.image.Raster.createPackedRaster() throws RasterFormatException on RI while it doesn't on Harmony
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2884
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2884
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HARMONY-2884-Raster.patch, HARMONY-2884-RasterTest.patch, RasterTest.patch
>
>
> Harmony does not throws RasterFormatException for java.awt.image.Raster.createPackedRaster(DataBuffer dataBuffer,int w,int h, int scanlineStride,int[] bandMasks,Point location) while RI throws it.
> Next test case passes on RI and fails on Harmony:
> ------------- test.java ------------
> import java.awt.Point;
> import java.awt.image.DataBufferInt;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.WritableRaster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testRun() {
>         DataBufferInt localDataBufferInt = new DataBufferInt(1);
>         int[] array0 = new int[] { 0, 0, 0 };
>         Point localPoint = new Point(10292, 0);
>         try {
>             WritableRaster returnValue = Raster.createPackedRaster(
>                     localDataBufferInt, 7, 9, 214, array0, localPoint);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException e) {
>             // expected
>             System.out.println("Exception : " + e.getMessage());
>         }
>     }
> }
> --------------------------------------
> Output on RI:
> ==========
> .Exception : Data array too small (should be 1718 but is 1 )
> Time: 0,131
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.