From fab15dc312cf4d9a7973a7a34043b2ccc74d3a0a Mon Sep 17 00:00:00 2001 From: kumpera Date: Fri, 5 Mar 2010 23:43:55 +0000 Subject: [PATCH] 2010-03-05 Rodrigo Kumpera * BigIntegerTest.cs: Tests for Abs. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@153153 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs | 11 +++++++++++ class/System.Numerics/Test/System.Numerics/ChangeLog | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs b/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs index dd6b2b2a7b..7bf6c7fe8b 100644 --- a/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs +++ b/class/System.Numerics/Test/System.Numerics/BigIntegerTest.cs @@ -123,6 +123,17 @@ namespace MonoTests.System.Numerics } [Test] + public void TestAbs () { + long[] values = new long [] { -100000000000L, -1000, -1, 0, 1, 1000, 100000000000L }; + for (int i = 0; i < values.Length; ++i) { + var a = new BigInteger (values [i]); + var c = BigInteger.Abs (a); + + Assert.AreEqual (Math.Abs (values [i]), (long)c, "#_" + i); + } + } + + [Test] public void TestNegate () { long[] values = new long [] { -100000000000L, -1000, -1, 0, 1, 1000, 100000000000L }; for (int i = 0; i < values.Length; ++i) { diff --git a/class/System.Numerics/Test/System.Numerics/ChangeLog b/class/System.Numerics/Test/System.Numerics/ChangeLog index 9ec4577c53..556933d412 100644 --- a/class/System.Numerics/Test/System.Numerics/ChangeLog +++ b/class/System.Numerics/Test/System.Numerics/ChangeLog @@ -1,5 +1,9 @@ 2010-03-05 Rodrigo Kumpera + * BigIntegerTest.cs: Tests for Abs. + +2010-03-05 Rodrigo Kumpera + * BigIntegerTest.cs: Tests for Min, Max. 2010-03-05 Rodrigo Kumpera -- 2.11.4.GIT