This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: RescaleOp fixlet


Hi,

The attached patch, already committed, updates (and fixes) sample value
generation in the RescaleOp test.

Cheers,
Francis


2006-09-13  Francis Kung  <fkung@redhat.com>

	* gnu/testlet/java/awt/image/RescaleOp/filterRaster.java
	(simpleTests): Remove hard-coded max sample value.

Index: gnu/testlet/java/awt/image/RescaleOp/filterRaster.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/image/RescaleOp/filterRaster.java,v
retrieving revision 1.1
diff -u -r1.1 filterRaster.java
--- gnu/testlet/java/awt/image/RescaleOp/filterRaster.java	6 Sep 2006 16:00:32 -0000	1.1
+++ gnu/testlet/java/awt/image/RescaleOp/filterRaster.java	13 Sep 2006 15:26:49 -0000
@@ -28,7 +28,6 @@
 import gnu.testlet.Testlet;
 
 import java.awt.image.BufferedImage;
-import java.awt.image.DataBuffer;
 import java.awt.image.RescaleOp;
 import java.awt.image.WritableRaster;
 
@@ -92,7 +91,7 @@
     img.getRaster().setSample(1, 1, 0, 1500);
     op = new RescaleOp(100, 0, null);
     dstRast = op.filter(r, null);
-    double maxValue = Math.pow(2, DataBuffer.getDataTypeSize(r.getDataBuffer().getDataType())) - 1;
+    double maxValue = Math.pow(2, r.getSampleModel().getSampleSize(0)) - 1;
     harness.check(dstRast.getSample(1, 1, 0), maxValue);
     
     op = new RescaleOp(1, -2000, null);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]