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: small fixes for GapContent tests


Hi,
the attached patch makes the GapContent tests more robust against unwanted
exceptions and adds a note about a specific behavior which can only be seen in
version >=1.5 of the RI.

ChangeLog:

2006-05-03  Robert Schuster  <robertschuster@fsfe.org>

        * gnu/testlet/javax/swing/text/GapContent/constructors.java:
        (testConstructor2): Put checks into try-catch block. added a second
        length check.
        * gnu/testlet/javax/swing/text/GapContent/insertString.java:
        (testGeneral): Added note.

cya
Robert
Index: gnu/testlet/javax/swing/text/GapContent/constructors.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/GapContent/constructors.java,v
retrieving revision 1.1
diff -u -r1.1 constructors.java
--- gnu/testlet/javax/swing/text/GapContent/constructors.java	24 Jan 2006 16:31:34 -0000	1.1
+++ gnu/testlet/javax/swing/text/GapContent/constructors.java	3 May 2006 00:13:10 -0000
@@ -81,12 +81,41 @@
     harness.check(gc.getArrayLength(), 10);
     
     // try unusual initial sizes
-    MyGapContent gc2 = new MyGapContent(0);
-    harness.check(gc2.length(), 1);
-    harness.check(gc2.getArrayLength(), 2);
-    gc2 = new MyGapContent(-1);
-    harness.check(gc2.getArrayLength(), 2);
+    int length = -1;
+    int arrayLength = -1;
+    MyGapContent gc2 = null;
+
+    try
+      {
+        gc2 = new MyGapContent(0);
+        length = gc2.length();
+        arrayLength = gc2.getArrayLength();
+      }
+    catch (Exception e)
+      {
+        // Can be ignored.
+      }
+    harness.check(length, 1);
+    harness.check(arrayLength, 2);
+
+    length = -1;
+    arrayLength = -1;
+    gc2 = null;
+    try
+      {
+        gc2 = new MyGapContent(0);
+        length = gc2.length();
+        arrayLength = gc2.getArrayLength();
+      }
+    catch (Exception e)
+      {
+        // Can be ignored. 
+      }
+    harness.check(length, 1);
+    harness.check(arrayLength, 2);
+
     
   }
 
-}
\ No newline at end of file
+}
+
Index: gnu/testlet/javax/swing/text/GapContent/insertString.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/GapContent/insertString.java,v
retrieving revision 1.5
diff -u -r1.5 insertString.java
--- gnu/testlet/javax/swing/text/GapContent/insertString.java	29 Mar 2006 15:25:45 -0000	1.5
+++ gnu/testlet/javax/swing/text/GapContent/insertString.java	3 May 2006 00:13:10 -0000
@@ -225,7 +225,7 @@
     harness.check(gc.length(), 7);
     
     // Insert at index of last character + 1. This appends the new string to
-    // the existing string.
+    // the existing string. (This works since 1.5 of the RI)
     try
     {
       gc.insertString(7, "XYZ");

Attachment: signature.asc
Description: OpenPGP digital signature


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