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: Kernel.constructor() test update


This patch (committed) relaxes the test for the constructor in the Kernel class to allow an IllegalArgumentException for a negative height or width. The required behaviour isn't specified, but matching the reference implementation's NegativeArraySizeException doesn't seem necessary - relaxing this test allows GNU Classpath to pass the test:

2006-07-23 David Gilbert <david.gilbert@object-refinery.com>

   * gnu/testlet/java/awt/image/Kernel/constructor.java
   (test): Allow IllegalArgumentException for null width or height.

Regards,

Dave
Index: gnu/testlet/java/awt/image/Kernel/constructor.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/image/Kernel/constructor.java,v
retrieving revision 1.1
diff -u -r1.1 constructor.java
--- gnu/testlet/java/awt/image/Kernel/constructor.java	21 Jul 2006 03:08:59 -0000	1.1
+++ gnu/testlet/java/awt/image/Kernel/constructor.java	23 Jul 2006 05:09:17 -0000
@@ -50,7 +50,10 @@
     float[] d2 = k1.getKernelData(null);
     harness.check(!Float.isNaN(d2[0]));
     
-    // try negative width
+    // try negative width - the required behaviour is not specified, the 
+    // reference implementation throws a NegativeArraySizeException, but that 
+    // seems like an implementation detail so this test is going to allow an
+    // IllegalArgumentException as well (which is what GNU Classpath does).
     boolean pass = false;
     try
     {
@@ -60,9 +63,16 @@
     {
       pass = true;   
     }
+    catch (IllegalArgumentException e)
+    {
+      pass = true;
+    }
     harness.check(pass);
     
-    // try negative height
+    // try negative height - the required behaviour is not specified, the 
+    // reference implementation throws a NegativeArraySizeException, but that 
+    // seems like an implementation detail so this test is going to allow an
+    // IllegalArgumentException as well (which is what GNU Classpath does).
     pass = false;
     try
     {
@@ -72,6 +82,10 @@
     {
       pass = true;   
     }
+    catch (IllegalArgumentException e)
+    {
+      pass = true;
+    }
     harness.check(pass);
     
     // try null array

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