[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestDecimal.cs,
From: |
Jonathan Springer <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestDecimal.cs,NONE,1.1 SuiteSystem.cs,1.2,1.3 TestDouble.cs,1.2,1.3 |
Date: |
Sun, 02 Feb 2003 11:39:21 -0500 |
Update of /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System
In directory subversions:/tmp/cvs-serv6199/tests/runtime/System
Modified Files:
SuiteSystem.cs TestDouble.cs
Added Files:
TestDecimal.cs
Log Message:
Floating point and decimal parsing/formatting fixes.
--- NEW FILE ---
/*
* TestDecimal.cs - Test class for "System.Decimal"
*
* Copyright (C) 2002 Southern Storm Software, Pty Ltd.
* Copyright (C) 2002 FSF.
*
* Authors : Autogenerated using csdoc2test
*
* This program 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 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
using CSUnit;
using System;
public class TestDecimal : TestCase
{
// Constructor.
public TestDecimal(String name) : base(name)
{
// Nothing to do here.
}
// Set up for the tests.
protected override void Setup()
{
// Nothing to do here.
}
// Clean up after the tests.
protected override void Cleanup()
{
// Nothing to do here.
}
public void TestConstructor()
{
/*TODO*/
}
public void TestDecimalAdd()
{
/*TODO*/
}
public void TestDecimalCompare()
{
/*TODO*/
}
public void TestDecimalCompareTo()
{
/*TODO*/
}
public void TestDecimalDivide()
{
/*TODO*/
}
public void TestDecimalEquals()
{
/*TODO*/
}
public void TestDecimalFloor()
{
/*TODO*/
}
public void TestDecimalGetBits()
{
/*TODO*/
}
public void TestDecimalGetHashCode()
{
/*TODO*/
}
public void TestDecimalMultiply()
{
/*TODO*/
}
public void TestDecimalNegate()
{
/*TODO*/
}
public void TestDecimalParse()
{
AssertEquals("Decimal.Parse(\"1.0\")",
1.0m, Decimal.Parse("1.0"));
AssertEquals("Decimal.Parse(\"-1.0\")",
-1.0m, Decimal.Parse("-1.0"));
AssertEquals("Decimal.Parse(\"1.0E+2\")",
100m, Decimal.Parse("1.0E+2"));
AssertEquals("Decimal.Parse(\"0.0\")",
0.0m, Decimal.Parse("0.0"));
AssertEquals("Decimal.Parse(\"0.5\")",
0.5m, Decimal.Parse("0.5"));
AssertEquals("Decimal.Parse(\"0.500000000000000\")",
0.5m, Decimal.Parse("0.500000000000000"));
AssertEquals("Decimal.Parse(\"1.13\")",
1.13m, Decimal.Parse("1.13"));
AssertEquals("Decimal.Parse(\"1.130000000000000\")",
1.13m, Decimal.Parse("1.130000000000000"));
AssertEquals("Decimal.Parse(\"1e+2\")",
100m, Decimal.Parse("1e+2"));
AssertEquals("Decimal.Parse(\"1e-2\")",
0.01m, Decimal.Parse("1e-2"));
AssertEquals("Decimal.Parse(\"1e2\")",
100m, Decimal.Parse("1e2"));
}
public void TestDecimalRemainder()
{
/*TODO*/
}
public void TestDecimalRound()
{
/*TODO*/
}
public void TestDecimalSubtract()
{
/*TODO*/
}
public void TestDecimalToString()
{
decimal d;
d = 0.0m;
AssertEquals("0", "0", d.ToString());
d = 1.0m;
AssertEquals("1", "1", d.ToString());
d = 1.13m;
AssertEquals("1.13", "1.13", d.ToString());
d = -1.13m;
AssertEquals("-1.13", "-1.13", d.ToString());
}
public void TestDecimalTruncate()
{
/*TODO*/
}
public void TestDecimalop_Addition()
{
/*TODO*/
}
public void TestDecimalop_Decrement()
{
/*TODO*/
}
public void TestDecimalop_Division()
{
/*TODO*/
}
public void TestDecimalop_Equality()
{
/*TODO*/
}
public void TestDecimalop_Explicit()
{
/*TODO*/
}
public void TestDecimalop_GreaterThan()
{
/*TODO*/
}
public void TestDecimalop_GreaterThanOrEqual()
{
/*TODO*/
}
public void TestDecimalop_Implicit()
{
/*TODO*/
}
public void TestDecimalop_Increment()
{
/*TODO*/
}
public void TestDecimalop_Inequality()
{
/*TODO*/
}
public void TestDecimalop_LessThan()
{
/*TODO*/
}
public void TestDecimalop_LessThanOrEqual()
{
/*TODO*/
}
public void TestDecimalop_Modulus()
{
/*TODO*/
}
public void TestDecimalop_Multiply()
{
/*TODO*/
}
public void TestDecimalop_Subtraction()
{
/*TODO*/
}
public void TestDecimalop_UnaryNegation()
{
/*TODO*/
}
public void TestDecimalop_UnaryPlus()
{
/*TODO*/
}
}
Index: SuiteSystem.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/SuiteSystem.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SuiteSystem.cs 1 Jan 2003 18:12:58 -0000 1.2
--- SuiteSystem.cs 2 Feb 2003 16:39:18 -0000 1.3
***************
*** 29,32 ****
--- 29,33 ----
TestSuite suite = new TestSuite("Core Class
Tests");
suite.AddTests(typeof(TestBoolean));
+ suite.AddTests(typeof(TestDecimal));
suite.AddTests(typeof(TestDouble));
suite.AddTests(typeof(TestSByte));
Index: TestDouble.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/TestDouble.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TestDouble.cs 17 Jan 2003 01:08:46 -0000 1.2
--- TestDouble.cs 2 Feb 2003 16:39:18 -0000 1.3
***************
*** 101,113 ****
AssertEquals("Double.Parse(\"1e-2\")",
0.01d, Double.Parse("1e-2"), 0.00000001d);
! try
! {
! Double.Parse("1e2");
! Fail("Double.Parse(\"1e2\") did not throw exception");
! }
! catch (FormatException e)
! {
! // OK
! }
}
--- 101,106 ----
AssertEquals("Double.Parse(\"1e-2\")",
0.01d, Double.Parse("1e-2"), 0.00000001d);
! AssertEquals("Double.Parse(\"1e2\")",
! 100d, Double.Parse("1e2"), 0.00000001d);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestDecimal.cs,NONE,1.1 SuiteSystem.cs,1.2,1.3 TestDouble.cs,1.2,1.3,
Jonathan Springer <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private/NumberFormat Formatter.cs,1.2,1.3 GeneralFormatter.cs,1.4,1.5 HexadecimalFormatter.cs,1.2,1.3
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private NumberParser.cs,1.7,1.8
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private/NumberFormat Formatter.cs,1.2,1.3 GeneralFormatter.cs,1.4,1.5 HexadecimalFormatter.cs,1.2,1.3
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private NumberParser.cs,1.7,1.8
- Index(es):