You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Okomin (JIRA)" <ji...@apache.org> on 2006/12/27 09:42:23 UTC
[jira] Commented: (HARMONY-2884) [classlib][awt] Compatibility:
java.awt.image.Raster.createPackedRaster() throws RasterFormatException on
RI while it doesn't on Harmony
[ http://issues.apache.org/jira/browse/HARMONY-2884?page=comments#action_12460963 ]
Ilya Okomin commented on HARMONY-2884:
--------------------------------------
The same situation with Raster.createRaster(SampleModel sm, DataBuffer db, Point location).
Next test case fails on Harmony and passes on RI:
------------- test.java ------------
import java.awt.Point;
import java.awt.image.DataBufferUShort;
import java.awt.image.Raster;
import java.awt.image.RasterFormatException;
import java.awt.image.SinglePixelPackedSampleModel;
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() {
DataBufferUShort db = new DataBufferUShort(new short[5], 3);
System.out.println(db.getNumBanks());
SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(1,
10, 1, 0, new int[431]);
try {
Raster localRaster = Raster.createRaster(sm, db, new Point());
fail("RasterFormatException expected!");
} catch (RasterFormatException e) {
// expected
System.out.println("Exception : " + e.getMessage());
}
}
}
-------------------------------------
output on RI:
==========
.1
Exception : Data array too small (should be 9 )
Time: 0,118
OK (1 test)
> [classlib][awt] Compatibility: java.awt.image.Raster.createPackedRaster() throws RasterFormatException on RI while it doesn't on Harmony
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2884
> URL: http://issues.apache.org/jira/browse/HARMONY-2884
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Ilya Okomin
> Priority: Minor
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira