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]

New DecimalFormat tests


There are a couple of new tests here.

Most notably there is a new test for this bug:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23996

This should be fixes (I hope) in my last patch (not yet submitted to
HEAD), but still needs testing.

Mario

2006-10-11  Mario Torre  <neugens@limasoftware.net>

	* gnu/testlet/java/text/DecimalFormat/format.java (PR23996):
	Test for PR23996.
	(test): Enable PR23996 test.
	(testGeneral): new test.
	* gnu/testlet/java/text/DecimalFormat/applyPattern.java (test):
	test added.
-- 
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
### Eclipse Workspace Patch 1.0
#P mauve
Index: gnu/testlet/java/text/DecimalFormat/format.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/format.java,v
retrieving revision 1.13
diff -u -r1.13 format.java
--- gnu/testlet/java/text/DecimalFormat/format.java	29 Aug 2006 17:35:41 -0000	1.13
+++ gnu/testlet/java/text/DecimalFormat/format.java	10 Oct 2006 22:05:54 -0000
@@ -43,6 +43,7 @@
     testNaN(harness);
     testInfinity(harness);
     testMaximumDigits(harness);
+    PR23996(harness);
   }
 
   public void apply(TestHarness harness, DecimalFormat df, String pattern)
@@ -151,6 +152,7 @@
     
     apply(harness, df, "'positive'#;'negative' -");
     harness.check(df.format(-1234.567), "negative -1235");
+    harness.check(df.format(1234.567), "positive1235");
     
     // grouping size of zero might cause a failure - see bug parade 4088503
     harness.checkPoint("regression tests for setGroupingSize");
@@ -358,4 +360,22 @@
     
     Locale.setDefault(orig);
   }
+  
+  // PR23996
+  private void PR23996(TestHarness harness)
+  {
+    harness.checkPoint("PR23996");
+    
+    DecimalFormat df = new DecimalFormat("S#.12345");
+    harness.check(df.format(Float.MAX_VALUE),
+                  "S340282346638528860000000000000000000000.12345");
+    
+    DecimalFormat df1 = new DecimalFormat("S#.00");
+    harness.check(df1.format(Float.MAX_VALUE),
+                  "S340282346638528860000000000000000000000.00");
+
+    DecimalFormat df2 = new DecimalFormat("0.7547895");
+    harness.check(df2.format(Float.MAX_VALUE),
+                  "340282346638528860000000000000000000000.7547895");
+  }
 }
Index: gnu/testlet/java/text/DecimalFormat/applyPattern.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DecimalFormat/applyPattern.java,v
retrieving revision 1.2
diff -u -r1.2 applyPattern.java
--- gnu/testlet/java/text/DecimalFormat/applyPattern.java	21 Aug 2006 18:42:32 -0000	1.2
+++ gnu/testlet/java/text/DecimalFormat/applyPattern.java	10 Oct 2006 22:05:54 -0000
@@ -78,6 +78,11 @@
     harness.check(f1.getGroupingSize(), 3);
     f1.applyPattern("#,#,##0.00");
     
+    harness.checkPoint("null pattern");
+    f1.applyPattern("");
+    harness.check(f1.format(123456789.123456789), "123.456.789,12345679");
+    
+    harness.checkPoint("invalid pattern");
     // try null argument
     boolean pass = false;
     try

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