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]

Fixed Failing Tests


This patch fixes some tests that were failing.  They now pass on both
OpenJDK and IcedTea.



2007-06-19  Tania Bento  <tbento@redhat.com>

        * gnu/testlet/java/text/Collator/GetSet.java: Fixed failing
test.
        * gnu/testlet/java/text/DateFormatSymbols/Test.java: Likewise.
        *
gnu/testlet/java/text/DecimalFormat/MaximumAndMinimumDigits.java: 
        Likewise.
        * gnu/testlet/java/text/DecimalFormat/digits.java: Likewise.
        *
gnu/testlet/java/text/DecimalFormat/setDecimalFormatSymbols.java:
        Likewise.
        * gnu/testlet/java/text/DecimalFormat/toPattern.java: Likewise.
        * gnu/testlet/java/text/DecimalFormat/toPattern14.java:
Likewise.

Index: gnu/testlet/java/text/Collator/GetSet.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/Collator/GetSet.java,v
retrieving revision 1.2
diff -u -r1.2 GetSet.java
--- gnu/testlet/java/text/Collator/GetSet.java	3 Apr 1999 19:18:32 -0000	1.2
+++ gnu/testlet/java/text/Collator/GetSet.java	19 Jun 2007 18:11:21 -0000
@@ -36,7 +36,7 @@
   Collator col = Collator.getInstance(Locale.US);
 
   harness.check(col.getStrength(), Collator.TERTIARY, "default strength");
-  harness.check(col.getDecomposition(), Collator.CANONICAL_DECOMPOSITION, 
+  harness.check(col.getDecomposition(), Collator.NO_DECOMPOSITION, 
                 "default decomposition");
 
   col.setStrength(Collator.PRIMARY);
@@ -46,7 +46,7 @@
   harness.check(col.getDecomposition(), Collator.NO_DECOMPOSITION, 
                 "set/get decomposition");
 
-  try
+  try 
     {
       col.setStrength(999);
       harness.check(false, "invalid strength value");
Index: gnu/testlet/java/text/DateFormatSymbols/Test.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DateFormatSymbols/Test.java,v
retrieving revision 1.6
diff -u -r1.6 Test.java
--- gnu/testlet/java/text/DateFormatSymbols/Test.java	20 Jan 2005 20:10:44 -0000	1.6
+++ gnu/testlet/java/text/DateFormatSymbols/Test.java	19 Jun 2007 18:11:21 -0000
@@ -126,11 +126,18 @@
       dfs.setAmPmStrings(my_ampms);
       harness.check(arrayEquals(dfs.getAmPmStrings(), my_ampms), "am/pm");
 
-      dfs.setZoneStrings(my_zonestrings);
-      harness.check(arrayEquals(dfs.getZoneStrings(), my_zonestrings), "zones");
-
       dfs.setLocalPatternChars(my_patternchars);
       harness.check(dfs.getLocalPatternChars(), my_patternchars, "patterns");
+      
+      /* Invalid Argument */
+      boolean fail = false;
+      try {
+    	  dfs.setZoneStrings(my_zonestrings);
+      } catch (IllegalArgumentException e) {
+		fail = true;
+      }
+      harness.check(fail, true, "InvalidArgumentException is thrown.");
+      
     }
   catch(MissingResourceException e)
     {
Index: gnu/testlet/java/text/DecimalFormat/MaximumAndMinimumDigits.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/MaximumAndMinimumDigits.java,v
retrieving revision 1.1
diff -u -r1.1 MaximumAndMinimumDigits.java
--- gnu/testlet/java/text/DecimalFormat/MaximumAndMinimumDigits.java	22 Sep 2006 20:28:38 -0000	1.1
+++ gnu/testlet/java/text/DecimalFormat/MaximumAndMinimumDigits.java	19 Jun 2007 18:11:21 -0000
@@ -62,9 +62,8 @@
   
   private void doTest()
   {
-    // this value is invalid on the RI, as of 1.5.0_08,
-    // it should be 2147483647
-    int MAX = 309;
+    // this value is 2147483647
+    int MAX = Integer.MAX_VALUE;
     
     harness.checkPoint("default pattern");
     DecimalFormat format = new DecimalFormat();
Index: gnu/testlet/java/text/DecimalFormat/digits.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/digits.java,v
retrieving revision 1.1
diff -u -r1.1 digits.java
--- gnu/testlet/java/text/DecimalFormat/digits.java	7 Sep 2003 12:57:48 -0000	1.1
+++ gnu/testlet/java/text/DecimalFormat/digits.java	19 Jun 2007 18:11:21 -0000
@@ -37,12 +37,12 @@
       df.setMaximumFractionDigits(1);
       harness.check(df.getMaximumFractionDigits(), 1);
       df.setMaximumFractionDigits(350);
-      harness.check(df.getMaximumFractionDigits(), 340);
+      harness.check(df.getMaximumFractionDigits(), 350);
 
       df.setMinimumFractionDigits(1);
       harness.check(df.getMinimumFractionDigits(), 1);
       df.setMinimumFractionDigits(350);
-      harness.check(df.getMinimumFractionDigits(), 340);
+      harness.check(df.getMinimumFractionDigits(), 350);
 
       df.setMinimumFractionDigits(16);
       df.setMaximumFractionDigits(12);
@@ -55,12 +55,12 @@
       df.setMaximumIntegerDigits(1);
       harness.check(df.getMaximumIntegerDigits(), 1);
       df.setMaximumIntegerDigits(310);
-      harness.check(df.getMaximumIntegerDigits(), 309);
+      harness.check(df.getMaximumIntegerDigits(), 310);
 
       df.setMinimumIntegerDigits(1);
       harness.check(df.getMinimumIntegerDigits(), 1);
       df.setMinimumIntegerDigits(310);
-      harness.check(df.getMinimumIntegerDigits(), 309);
+      harness.check(df.getMinimumIntegerDigits(), 310);
 
       df.setMinimumIntegerDigits(16);
       df.setMaximumIntegerDigits(12);
Index: gnu/testlet/java/text/DecimalFormat/setDecimalFormatSymbols.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/setDecimalFormatSymbols.java,v
retrieving revision 1.1
diff -u -r1.1 setDecimalFormatSymbols.java
--- gnu/testlet/java/text/DecimalFormat/setDecimalFormatSymbols.java	13 Mar 2005 20:42:07 -0000	1.1
+++ gnu/testlet/java/text/DecimalFormat/setDecimalFormatSymbols.java	19 Jun 2007 18:11:21 -0000
@@ -52,18 +52,16 @@
     symbols.setDecimalSeparator('y');
     harness.check(f1.getDecimalFormatSymbols().getDecimalSeparator(), 'x');
     
-    // try null argument. Behaviour is not specified, but it would be 
-    // consistent with the rest of the API to throw a NullPointerException.
-    // In fact, in Sun's implementation, null is ignored (see bug parade 
-    // 4329360).
+    // try null argument. 
     boolean pass = false;
     try
     {
-      f1.setDecimalFormatSymbols(null);   
+      f1.setDecimalFormatSymbols(null);
+      pass = true;
     }
     catch (NullPointerException e) 
     {
-      pass = true;   
+    	// do nothing.
     }
     harness.check(pass);
   }
Index: gnu/testlet/java/text/DecimalFormat/toPattern.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/toPattern.java,v
retrieving revision 1.2
diff -u -r1.2 toPattern.java
--- gnu/testlet/java/text/DecimalFormat/toPattern.java	14 Sep 2005 20:14:44 -0000	1.2
+++ gnu/testlet/java/text/DecimalFormat/toPattern.java	19 Jun 2007 18:11:21 -0000
@@ -64,8 +64,8 @@
       // seem like any canonical output format is documented.
 
       DecimalFormat df = new DecimalFormat ("0.##");
-      harness.check (df.toPattern (), "0.##");
-      harness.check (df.toLocalizedPattern (), "0.##");
+      harness.check (df.toPattern (), "#0.##");
+      harness.check (df.toLocalizedPattern (), "#0.##");
       
       DecimalFormatSymbols dfs = df.getDecimalFormatSymbols ();
       dfs.setDecimalSeparator (',');
@@ -74,7 +74,7 @@
       dfs.setGroupingSeparator ('!');
       df.setDecimalFormatSymbols(dfs);   // dfs is only a copy of the internal 
                                          // symbols so pass symbols back to df
-      harness.check (df.toLocalizedPattern (), "1,XX");
+      harness.check (df.toLocalizedPattern (), "X1,XX");
 
       df.applyPattern ("Fr #,##0.##");
       String x1 = df.toPattern ();
Index: gnu/testlet/java/text/DecimalFormat/toPattern14.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/toPattern14.java,v
retrieving revision 1.1
diff -u -r1.1 toPattern14.java
--- gnu/testlet/java/text/DecimalFormat/toPattern14.java	22 Sep 2006 20:28:38 -0000	1.1
+++ gnu/testlet/java/text/DecimalFormat/toPattern14.java	19 Jun 2007 18:11:21 -0000
@@ -117,7 +117,7 @@
     DecimalFormat f2 =
       new DecimalFormat("'#'1'.' ''nessuno ci capisce niente qui #0.00;(#0.00)");
     harness.check(f2.toPattern(),
-                  "'#'1'.' ''nessuno ci capisce niente qui #0.00;(#0.00)");
+                  "'#1. '''nessuno ci capisce niente qui #0.00;(#0.00)");
   }
   
   public void test3(TestHarness harness)
@@ -132,7 +132,7 @@
     harness.check(f1.toPattern(), "#.00");
     
     DecimalFormat f2 = new DecimalFormat("#0.#E0");
-    harness.check(f2.toPattern(), "0.#E0");
+    harness.check(f2.toPattern(), "#0.#E0");
     
     DecimalFormat f3 = new DecimalFormat("0.#E0");
     harness.check(f3.toPattern(), "0.#E0");

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