public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: Kernel.constructor() test update
@ 2006-07-23  5:14 David Gilbert
  0 siblings, 0 replies; only message in thread
From: David Gilbert @ 2006-07-23  5:14 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

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

[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 1638 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-23  5:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-23  5:14 FYI: Kernel.constructor() test update David Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).