From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3728 invoked by alias); 10 Oct 2006 22:35:39 -0000 Received: (qmail 3720 invoked by uid 22791); 10 Oct 2006 22:35:38 -0000 X-Spam-Check-By: sourceware.org Received: from vsmtp3alice.tin.it (HELO vsmtp3.tin.it) (212.216.176.143) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Oct 2006 22:35:33 +0000 Received: from [192.168.0.155] (87.19.136.253) by vsmtp3.tin.it (7.2.072.1) id 451BEC08006B9908 for mauve-patches@sources.redhat.com; Wed, 11 Oct 2006 00:35:27 +0200 Subject: FYI: New DecimalFormat tests From: Mario Torre To: mauve-patches In-Reply-To: <1160518813.2667.5.camel@vtigertest.nirvana.limasoftware.net> References: <1160518813.2667.5.camel@vtigertest.nirvana.limasoftware.net> Content-Type: multipart/mixed; boundary="=-wKmC/BgJgcAppJRQmiW2" Date: Tue, 10 Oct 2006 22:35:00 -0000 Message-Id: <1160520181.2667.21.camel@vtigertest.nirvana.limasoftware.net> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00692.txt.bz2 --=-wKmC/BgJgcAppJRQmiW2 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 807 Il giorno mer, 11/10/2006 alle 00.20 +0200, Mario Torre ha scritto: > There are a couple of new tests here. Ooops sorry, here follows the correct Changelog and patch (the PR23996 has a file of its own): 2006-10-11 Mario Torre * gnu/testlet/java/text/DecimalFormat/PR23996.java: Test for PR23996. * gnu/testlet/java/text/DecimalFormat/format.java (testGeneral): new test. * gnu/testlet/java/text/DecimalFormat/applyPattern.java (test): test added. Mario -- 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/ --=-wKmC/BgJgcAppJRQmiW2 Content-Disposition: attachment; filename=mauve-decimalformat-2006-10-11.patch Content-Type: text/x-patch; name=mauve-decimalformat-2006-10-11.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 3919 ### 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:33:43 -0000 @@ -151,6 +151,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"); 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:33:43 -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: gnu/testlet/java/text/DecimalFormat/PR23996.java =================================================================== RCS file: gnu/testlet/java/text/DecimalFormat/PR23996.java diff -N gnu/testlet/java/text/DecimalFormat/PR23996.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/text/DecimalFormat/PR23996.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,61 @@ +/* PR23996.java -- test for bug PR23996 + Copyright (C) 2006 Mario Torre +This file is part of Mauve. + +Mauve is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +Mauve is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Mauve; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +*/ + +// Tags: JDK1.4 + +package gnu.testlet.java.text.DecimalFormat; + +import java.text.DecimalFormat; +import java.util.Locale; + +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +/** + * This is based on PR23996: DecimalFormat.format() is giving + * different values in Java and DOTNet. + * + * @author Mario Torre + */ +public class PR23996 implements Testlet +{ + public void test(TestHarness harness) + { + Locale orig = Locale.getDefault(); + Locale.setDefault(Locale.US); + + 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"); + + Locale.setDefault(orig); + } +} --=-wKmC/BgJgcAppJRQmiW2--