Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/Test')
-rw-r--r--mcs/class/corlib/Test/.cvsignore2
-rw-r--r--mcs/class/corlib/Test/AllTests.cs39
-rw-r--r--mcs/class/corlib/Test/ChangeLog216
-rw-r--r--mcs/class/corlib/Test/System.Collections/AllTests.cs39
-rw-r--r--mcs/class/corlib/Test/System.Collections/ArrayListTest.cs1451
-rw-r--r--mcs/class/corlib/Test/System.Collections/BitArrayTest.cs300
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs50
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs57
-rw-r--r--mcs/class/corlib/Test/System.Collections/ChangeLog91
-rw-r--r--mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs236
-rw-r--r--mcs/class/corlib/Test/System.Collections/ComparerTest.cs60
-rw-r--r--mcs/class/corlib/Test/System.Collections/HashtableTest.cs761
-rw-r--r--mcs/class/corlib/Test/System.Collections/QueueTest.cs182
-rw-r--r--mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs49
-rwxr-xr-xmcs/class/corlib/Test/System.Collections/SortedListTest.cs624
-rw-r--r--mcs/class/corlib/Test/System.Collections/StackTest.cs270
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/AllTests.cs32
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/ChangeLog8
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs89
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs350
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs98
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs83
-rw-r--r--mcs/class/corlib/Test/System.Globalization/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Globalization/CalendarTest.cs602
-rw-r--r--mcs/class/corlib/Test/System.IO/AllTests.cs35
-rw-r--r--mcs/class/corlib/Test/System.IO/ChangeLog95
-rw-r--r--mcs/class/corlib/Test/System.IO/FileTest.cs441
-rw-r--r--mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs154
-rw-r--r--mcs/class/corlib/Test/System.IO/PathTest.cs144
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamReaderTest.cs558
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamWriterTest.cs353
-rw-r--r--mcs/class/corlib/Test/System.IO/StringReaderTest.cs133
-rw-r--r--mcs/class/corlib/Test/System.IO/StringWriterTest.cs56
-rw-r--r--mcs/class/corlib/Test/System.Resources/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Resources/ChangeLog26
-rw-r--r--mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs144
-rw-r--r--mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog5
-rwxr-xr-xmcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs91
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs31
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs54
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs75
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs55
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs65
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/ChangeLog18
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs297
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/ChangeLog15
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs248
-rw-r--r--mcs/class/corlib/Test/System.Security/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security/ChangeLog10
-rw-r--r--mcs/class/corlib/Test/System.Security/SecurityElementTest.cs228
-rwxr-xr-xmcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs192
-rw-r--r--mcs/class/corlib/Test/System.Text/AllTests.cs30
-rw-r--r--mcs/class/corlib/Test/System.Text/ChangeLog13
-rw-r--r--mcs/class/corlib/Test/System.Text/StringBuilderTest.cs238
-rw-r--r--mcs/class/corlib/Test/System/AllTests.cs61
-rw-r--r--mcs/class/corlib/Test/System/ArrayTest.cs1996
-rwxr-xr-xmcs/class/corlib/Test/System/AttributeTest.cs164
-rwxr-xr-xmcs/class/corlib/Test/System/BitConverterTest.cs545
-rw-r--r--mcs/class/corlib/Test/System/BooleanTest.cs113
-rw-r--r--mcs/class/corlib/Test/System/ByteTest.cs189
-rw-r--r--mcs/class/corlib/Test/System/ChangeLog468
-rwxr-xr-xmcs/class/corlib/Test/System/CharEnumeratorTest.cs123
-rw-r--r--mcs/class/corlib/Test/System/CharTest.cs500
-rw-r--r--mcs/class/corlib/Test/System/ConsoleTest.cs294
-rwxr-xr-xmcs/class/corlib/Test/System/ConvertTest.cs2734
-rwxr-xr-xmcs/class/corlib/Test/System/DateTimeTest.cs358
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest.cs873
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest2.cs3126
-rw-r--r--mcs/class/corlib/Test/System/DoubleTest.cs191
-rw-r--r--mcs/class/corlib/Test/System/EnumTest.cs728
-rw-r--r--mcs/class/corlib/Test/System/ExceptionTest.cs204
-rwxr-xr-xmcs/class/corlib/Test/System/GuidTest.cs247
-rw-r--r--mcs/class/corlib/Test/System/Int16Test.cs193
-rw-r--r--mcs/class/corlib/Test/System/Int32Test.cs238
-rw-r--r--mcs/class/corlib/Test/System/Int64Test.cs363
-rw-r--r--mcs/class/corlib/Test/System/IntegerFormatterTest.cs2016
-rwxr-xr-xmcs/class/corlib/Test/System/MathTest.cs614
-rw-r--r--mcs/class/corlib/Test/System/MulticastDelegate.cs123
-rw-r--r--mcs/class/corlib/Test/System/ObjectTest.cs121
-rw-r--r--mcs/class/corlib/Test/System/RandomTest.cs90
-rw-r--r--mcs/class/corlib/Test/System/ResolveEventArgsTest.cs30
-rw-r--r--mcs/class/corlib/Test/System/SByteTest.cs180
-rw-r--r--mcs/class/corlib/Test/System/StringTest.cs1083
-rwxr-xr-xmcs/class/corlib/Test/System/TimeSpanTest.cs266
-rw-r--r--mcs/class/corlib/Test/System/TimeZoneTest.cs74
-rw-r--r--mcs/class/corlib/Test/System/UInt16Test.cs194
-rw-r--r--mcs/class/corlib/Test/System/UInt32Test.cs236
-rw-r--r--mcs/class/corlib/Test/System/UInt64Test.cs204
-rw-r--r--mcs/class/corlib/Test/System/VersionTest.cs244
-rw-r--r--mcs/class/corlib/Test/corlib_test.build70
-rw-r--r--mcs/class/corlib/Test/resources/AFile.txt39
-rw-r--r--mcs/class/corlib/Test/resources/Empty.resources0
-rw-r--r--mcs/class/corlib/Test/resources/MyResources.resourcesbin412 -> 0 bytes
96 files changed, 0 insertions, 28950 deletions
diff --git a/mcs/class/corlib/Test/.cvsignore b/mcs/class/corlib/Test/.cvsignore
deleted file mode 100644
index 335c71fd7fa..00000000000
--- a/mcs/class/corlib/Test/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-*.pdb
diff --git a/mcs/class/corlib/Test/AllTests.cs b/mcs/class/corlib/Test/AllTests.cs
deleted file mode 100644
index e7a49c01fef..00000000000
--- a/mcs/class/corlib/Test/AllTests.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Mono.Tests.AllTests.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.AllTests.Suite);
- suite.AddTest(System.Collections.AllTests.Suite);
- suite.AddTest(System.Security.AllTests.Suite);
- suite.AddTest(System.Security.Cryptography.AllTests.Suite);
- suite.AddTest(System.IO.AllTests.Suite);
- suite.AddTest(System.Text.AllTests.Suite);
- suite.AddTest(System.Security.Permissions.AllTests.Suite);
- suite.AddTest(System.Resources.AllTests.Suite);
- suite.AddTest(System.Runtime.Serialization.AllTests.Suite);
-// suite.AddTest(System.Security.Policy.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/ChangeLog b/mcs/class/corlib/Test/ChangeLog
deleted file mode 100644
index 7938051d613..00000000000
--- a/mcs/class/corlib/Test/ChangeLog
+++ /dev/null
@@ -1,216 +0,0 @@
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: System.Runtime.Serialization.
-
-2002-06-01 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Change the order of the builds. Just makes it a
- bit faster for my testing since I need the linux dll.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * Added System.Security.Cryptography.FromBase64TransformTest.cs.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * TheTests.cs: Removed.
-
- * MartinTests.cs: Removed.
-
- * corlib_test.build: Don't create Runtest.corlib.exe anymore.
-
-2002/05/07 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Do not run the System.Net tests from here, they belong
- in the System assembly tests.
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * System.Security/: added directory
- * AllTests.cs: added Syste,Security suite.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Net/: added directory.
- * AllTests.cs: added System.Net suite.
-
-2002/04/04 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Again; disable running of NUnit tests against mono
- corlib. There are so many icalls now, that these tests need
- to be run inside mint and mono. Will change this soon to run
- the tests using both. It still runs the tests against the mscorlib
- to validate the tests themselves.
-
-2002-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * corlib_test.build: don't exclude IntegerFormatterTest.
-
- * System/AllTests.cs: added IntegerFormatterTest suite.
-
- * System/IntegerFormatterTest.cs: totally reworked to use NUnit. Right
- now it fails cause I haven't implemented Parse () methods yet. With
- corlib_reference.dll runs ok.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Re-exclude it in a couple of places where it was
- breaking the build. This test is not an NUnit test. So, it doesn't
- belong in these dll's until it's made a proper NUnit test.
-
-2002-03-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * corlib_test.build: remove two more lines that excluded
- IntegerFormatterTest.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Don't exclude IntegerFormatterTest any more.
-
-2002-03-20 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: On 'clean' remove all the dll's and pdb's
-
-2002/03/19 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Re-include tests into the build.
-
-2002-03-18 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: build RunTests.corlib.exe with only mono class
- libs. This tells what we are missing to run the tests.
-
-2002/03/18 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: disable running of NUnit tests against mono
- corlib. There are so many icalls now, that these tests need
- to be run inside mint and mono. Will change this soon to run
- the tests using both. It still runs the tests against the mscorlib
- to validate the tests themselves.
-
-2002/03/07 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: resolve chicken and egg problem. Only build and
- execute test assemblies when 'make test' is specified. Need to do a
- 'make' first now before 'make test'.
-
-2002-03-03 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Turn on debug flag for complier so that...well...
- debugging is easier.
-
-2002-03-01 Duncan Mak <duncan@ximian.com>
-
- * System.Runtime.Serialization/ObjectIDGeneratorTests.cs: Added
- test for System.Runtime.Serialization.ObjectIDGenerator.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * RunTests.cs: Removed. This is now in the nant directory.
-
- * corlib_test.build: Don't link TheTests.cs into the dlls, renamed
- RunTests.exe to RunTests.corlib.exe and link it against NUnitBase.dll.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * scan-tests.pl: Moved to ../../../tools/.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the tests which already
- work on Linux.
-
- * RunTests.cs: A small custom testrunner to run the tests on Linux.
-
- * scan-tests.pl: Call this perl script with either MartinTests.cs or
- AllTests.cs as argument and redirect the output the TheTests.cs - it'll
- create a file which calls all the tests.
-
- * TheTests.cs: This is automatically generated from scan-tests.pl but
- needs some manual editing, so it's in CVS.
-
- * corlib_test.build: In addition to the libraries, create an executable
- called RunTests.exe which contains all the tests and the custom test
- runner. You can run this executable on Windows to test things with
- mscorlib or on Linux using the mono runtime.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * */*.cs: added zero-args constructors for all the test classes.
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * System.Security.Cryptography.RNGCryptoServiceProviderTest.cs:
- Fixed typo
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * Addded System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
- * System.Security.Cryptography/AllTests.cs: Added
- RNGCryptoServiceProviderTest.
-
-2002-02-17 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/GuidTest.cs
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Remove duplicate excludes for
- * AllTests.cs: Add System.Security.Policy tests. However, commented
- this out because NUnit is throwing an exception. Need to figure
- that out first.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: compile with mscorlib to test the tests. This
- will be our "reference" check to make sure the tests work.
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Resources.AllTests.Suite
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Security.Permissions.AllTests.Suite
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore the debug files *.pdb
-
-2002-01-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/TimeSpanTest.cs
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added DebugTest to System.Diagnostics tests.
-2001-11-08 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Include test for Queue in the dll
-
-2001-10-15 Martin Weindel <martin.weindel@t-online.de>
-
- * added System/DecimalTest.cs and System/DecimalTest2.cs
-
-2001-10-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * System/StringTest.cs: Added.
-
-2001-10-10 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * added directory System.Security.Cryptography
- * added TestSuite for all Crypto classes
- * added tests for System.Security.Cryptography.AsymmetricAlgorithm
- and System.Security.Cryptography.SymmetricAlgorithm
-
-2001-10-02 Martin Weindel <martin.weindel@t-online.de>
-
- * added directory System
- * added tests for System.Int64
-
-2001-08-29 Alexander Klyubin <klyubin@aqris.com>
-
- * Added tests for System.Diagnostics.StackFrame and
- System.Diagnostics.StackTrace. The tests only run against
- Microsoft's implementation as StackTrace and StackFrame classes in
- Mono are not yet properly implemented.
-
- Note that StackFrameTest runs properly only if compiled with
- /debug switch.
diff --git a/mcs/class/corlib/Test/System.Collections/AllTests.cs b/mcs/class/corlib/Test/System.Collections/AllTests.cs
deleted file mode 100644
index 70f735c6b7d..00000000000
--- a/mcs/class/corlib/Test/System.Collections/AllTests.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(ArrayListTest.Suite);
- suite.AddTest(BitArrayTest.Suite);
- suite.AddTest(CaseInsensitiveComparerTest.Suite);
- suite.AddTest(CaseInsensitiveHashCodeProviderTest.Suite);
- suite.AddTest(CollectionBaseTest.Suite);
- suite.AddTest(ComparerTest.Suite);
- suite.AddTest(HashtableTest.Suite);
- suite.AddTest(QueueTest.Suite);
- suite.AddTest(ReadOnlyCollectionBaseTest.Suite);
- suite.AddTest(SortedListTest.Suite);
- suite.AddTest(StackTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs b/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
deleted file mode 100644
index 49be77b17a8..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
+++ /dev/null
@@ -1,1451 +0,0 @@
-// ArrayListTest.cs - NUnit Test Cases for the System.Collections.ArrayList class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>ArrayList test.</summary>
-public class ArrayListTest : TestCase {
- public ArrayListTest() : base ("MonoTests.System.ArrayListTest testsuite") {}
- public ArrayListTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayListTest));
- }
- }
-
- public void TestCtor() {
- {
- ArrayList al1 = new ArrayList();
- AssertNotNull("no basic ArrayList", al1);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null icollection error not thrown",
- errorThrown);
- }
- {
- // what can I say? I like chars. [--DB]
- char[] coll = {'a', 'b', 'c', 'd'};
- ArrayList al1 = new ArrayList(coll);
- AssertNotNull("no icollection ArrayList", al1);
- for (int i = 0; i < coll.Length; i++) {
- AssertEquals(i + " not ctor'ed properly.",
- coll[i], al1[i]);
- }
- }
- {
- try {
- Char[,] c1 = new Char[2,2];
- ArrayList al1 = new ArrayList(c1);
- Fail ("Should fail with multi-dimensional array in constructor.");
- } catch (RankException) {
- }
- }
-
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative capacity error not thrown",
- errorThrown);
- }
- }
-
- public void TestCapacity() {
- for (int i = 1; i < 100; i++) {
- ArrayList al1 = new ArrayList(i);
- AssertEquals("Bad capacity of " + i,
- i, al1.Capacity);
- }
- {
- ArrayList al1 = new ArrayList(0);
- // LAMESPEC:
- // AssertEquals("Bad capacity when set to 0",
- // 16, al1.Capacity);
- al1.Add ("?");
- AssertEquals("Bad capacity when set to 0",
- 16, al1.Capacity);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad default capacity",
- 16, al1.Capacity);
- }
- }
-
- public void TestCount() {
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad initial count",
- 0, al1.Count);
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("Bad count " + i,
- i, al1.Count);
- }
- }
- for (int i = 0; i < 100; i++) {
- char[] coll = new Char[i];
- ArrayList al1 = new ArrayList(coll);
- AssertEquals("Bad count for " + i,
- i, al1.Count);
- }
- }
-
- public void TestIsFixed() {
- ArrayList al1 = new ArrayList();
- Assert("should not be fixed by default", !al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- Assert("fixed-size wrapper not working", al2.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- ArrayList al1 = new ArrayList();
- Assert("should not be ReadOnly by default", !al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- Assert("read-only wrapper not working", al2.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- ArrayList al1 = new ArrayList();
- Assert("should not be synchronized by default",
- !al1.IsSynchronized);
- ArrayList al2 = ArrayList.Synchronized(al1);
- Assert("synchronized wrapper not working", al2.IsSynchronized);
- }
-
- public void TestItem() {
- ArrayList al1 = new ArrayList();
- {
- bool errorThrown = false;
- try {
- object o = al1[-1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative item error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- object o = al1[1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end item error not thrown",
- errorThrown);
- }
- for (int i = 0; i <= 100; i++) {
- al1.Add(i);
- }
- for (int i = 0; i <= 100; i++) {
- AssertEquals("item not fetched for " + i,
- i, al1[i]);
- }
- }
-
- public void TestAdapter() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Adapter(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null adapter error not thrown",
- errorThrown);
- }
- {
- char[] list = {'a', 'b', 'c', 'd'};
- ArrayList al1 = ArrayList.Adapter(list);
- AssertNotNull("Couldn't get an adapter", al1);
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- list[0] = 'z';
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- }
- // TODO - test other adapter types?
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("add failed " + i,
- i, al1.Count);
- AssertEquals("add failed " + i,
- i, al1[i-1]);
-
- }
- }
- {
- string [] strArray = new string [] {};
- ArrayList al1 = new ArrayList (strArray);
- al1.Add ("Hi!");
- al1.Add ("Hi!");
- AssertEquals ("add failed", 2, al1.Count);
- }
- }
-
- public void TestAddRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList();
- al1.AddRange(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
-
- {
- ArrayList a1 = new ArrayList();
- AssertEquals("ArrayList should start empty",
- 0, a1.Count);
- char[] coll = {'a', 'b', 'c'};
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 3, a1.Count);
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 6, a1.Count);
- }
- }
-
- public void TestBinarySearch() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList();
- String[] s1 = {"This", "is", "a", "test"};
- al1.AddRange(s1);
- al1.BinarySearch(42);
- } catch (InvalidOperationException) {
- // this is what .NET throws
- errorThrown = true;
- } catch (ArgumentException) {
- // this is what the docs say it should throw
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("search-for-wrong-type error not thrown",
- errorThrown);
- }
-
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- Assert("couldn't find elem #1",
- al1.BinarySearch('c') >= 3);
- Assert("couldn't find elem #2",
- al1.BinarySearch('c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find next-higher elem",
- -4, al1.BinarySearch('c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find end",
- -9, al1.BinarySearch('e'));
- }
-
- }
-
- // TODO - BinarySearch with IComparer
-
- public void TestClear() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- al1.Add('c');
- AssertEquals("should have one element",
- 1, al1.Count);
- al1.Clear();
- AssertEquals("should be empty",
- 0, al1.Count);
- }
- {
- int[] i1 = {1,2,3,4};
- ArrayList al1 = new ArrayList(i1);
- AssertEquals("should have elements",
- i1.Length, al1.Count);
- int capacity = al1.Capacity;
- al1.Clear();
- AssertEquals("should be empty again",
- 0, al1.Count);
- AssertEquals("capacity shouldn't have changed",
- capacity, al1.Capacity);
- }
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("ArrayList match", al1[0], al2[0]);
- AssertEquals("ArrayList match", al1[1], al2[1]);
- AssertEquals("ArrayList match", al1[2], al2[2]);
- }
- {
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- ArrayList al1 = new ArrayList(d1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("Array match", al1[0], al2[0]);
- AssertEquals("Array match", al1[1], al2[1]);
- AssertEquals("Array match", al1[2], al2[2]);
-
- ((char[])al1[0])[0] = 'z';
- AssertEquals("shallow copy", al1[0], al2[0]);
- }
- }
-
- public void TestContains() {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- Assert("never find a null", !al1.Contains(null));
- Assert("can't find value", al1.Contains('b'));
- Assert("shouldn't find value", !al1.Contains('?'));
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- al1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("error not thrown 1", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[,] c2 = new Char[2,2];
- al1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("error not thrown 2", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- // This appears to be a bug in the ArrayList Constructor.
- // It throws a RankException if a multidimensional Array
- // is passed. The docs imply that an IEnumerator is used
- // to retrieve the items from the collection, so this should
- // work. In anycase this test is for CopyTo, so use what
- // works on both platforms.
- //Char[,] c1 = new Char[2,2];
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("error not thrown 3", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("error not thrown 4", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("error not thrown 5", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("error not thrown 6", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = {"String", "array"};
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("error not thrown 7", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- ArrayList al = new ArrayList(orig);
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- al.CopyTo(copy, 3);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[0]);
- AssertEquals("Wrong CopyTo 1", (char)0, copy[1]);
- AssertEquals("Wrong CopyTo 2", (char)0, copy[2]);
- AssertEquals("Wrong CopyTo 3", orig[0], copy[3]);
- AssertEquals("Wrong CopyTo 4", orig[1], copy[4]);
- AssertEquals("Wrong CopyTo 5", orig[2], copy[5]);
- AssertEquals("Wrong CopyTo 6", orig[3], copy[6]);
- AssertEquals("Wrong CopyTo 7", (char)0, copy[7]);
- AssertEquals("Wrong CopyTo 8", (char)0, copy[8]);
- AssertEquals("Wrong CopyTo 9", (char)0, copy[9]);
- }
-
- public void TestFixedSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.FixedSize(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start un-fixed.",
- false, al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- AssertEquals("should be fixed.",
- true, al2.IsFixedSize);
- }
- }
-
- public void TestGetEnumerator() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i], en.Current);
- }
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator(1,2);
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < 2; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i+1], en.Current);
- }
- }
- }
-
- public void TestGetRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] chars = {'a', 'b', 'c', 'd', 'e', 'f'};
- ArrayList a = new ArrayList(chars);
- ArrayList b = a.GetRange(1, 3);
- AssertEquals("GetRange returned wrong size ArrayList", 3, b.Count);
- for (int i = 0; i < b.Count; i++) {
- AssertEquals("range didn't work",
- chars[i+1], b[i]);
- }
-
- a[2] = '?'; // should screw up ArrayList b.
- bool errorThrown = false;
- try {
- int i = b.Count;
- } catch (InvalidOperationException) {
- errorThrown = true;
- }
- AssertEquals("Munging 'a' should mess up 'b'",
- true, errorThrown);
- }
- }
-
- public void TestIndexOf() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(2);
- int i = a.IndexOf('a', 1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.IndexOf(null));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0, 5));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c'));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2, 2));
- AssertEquals("shouldn't find elem",
- -1, a.IndexOf('c', 3, 2));
- AssertEquals("shouldn't find", -1, a.IndexOf('?'));
- AssertEquals("shouldn't find", -1, a.IndexOf(3));
- }
- }
-
- public void TestInsert() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(-1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(4, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arraylist starts empty", 0, al1.Count);
- al1.Insert(0, 'a');
- al1.Insert(1, 'b');
- al1.Insert(0, 'c');
- AssertEquals("arraylist needs stuff", 3, al1.Count);
- AssertEquals("arraylist got stuff", 'c', al1[0]);
- AssertEquals("arraylist got stuff", 'a', al1[1]);
- AssertEquals("arraylist got stuff", 'b', al1[2]);
- }
- }
-
- public void TestInsertRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(-1, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(4, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out-of-range insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.InsertRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null insert error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList a = new ArrayList(c);
- a.InsertRange(1, c);
- AssertEquals("bad insert 1", 'a', a[0]);
- AssertEquals("bad insert 2", 'a', a[1]);
- AssertEquals("bad insert 3", 'b', a[2]);
- AssertEquals("bad insert 4", 'c', a[3]);
- AssertEquals("bad insert 5", 'b', a[4]);
- AssertEquals("bad insert 6", 'c', a[5]);
- }
- }
-
- public void TestLastIndexOf() {
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("first negative lastindexof error not thrown",
- //errorThrown);
- //}
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.LastIndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end lastindexof error not thrown",
- errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("second negative lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(2);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- int iTest = 0;
- try {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.LastIndexOf(null));
- iTest++;
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4));
- iTest++;
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4, 5));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c'));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 4));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 3, 2));
- iTest++;
- AssertEquals("shouldn't find elem",
- -1, a.LastIndexOf('c', 4, 2));
- iTest++;
- AssertEquals("shouldn't find", -1, a.LastIndexOf('?'));
- iTest++;
- AssertEquals("shouldn't find", -1, a.LastIndexOf(1));
- } catch (Exception e) {
- Fail ("Unexpected exception caught when iTest=" + iTest + ". e=" + e);
- }
- }
-
- public void TestReadOnly() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.ReadOnly(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start writeable.",
- false, al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- AssertEquals("should be readonly.",
- true, al2.IsReadOnly);
- }
- }
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove read only error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.Remove(1);
- a.Remove('?');
- AssertEquals("should be unchanged", c.Length, a.Count);
- a.Remove('a');
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveAt() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(4);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveAt(0);
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("removerange at bad range error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveRange(1,2);
- AssertEquals("should be changed", 1, a.Count);
- AssertEquals("should have shifted", 'a', a[0]);
- }
- }
-
- public void TestRepeat() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Repeat('c', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("repeat negative copies error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 0);
- AssertEquals("should be nothing in array",
- 0, al1.Count);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 3);
- AssertEquals("should be something in array",
- 3, al1.Count);
- AssertEquals("array elem doesn't check",
- "huh?", al1[0]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[1]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[2]);
- }
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Reverse();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("reverse on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(0, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(3, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(2,1);
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be no change yet",
- c[i], al1[i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be reversed",
- c[i], al1[4-i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be back to normal",
- c[i], al1[i]);
- }
- al1.Reverse(1,3);
- AssertEquals("Should be back to normal", c[0], al1[0]);
- AssertEquals("Should be back to normal", c[3], al1[1]);
- AssertEquals("Should be back to normal", c[2], al1[2]);
- AssertEquals("Should be back to normal", c[1], al1[3]);
- AssertEquals("Should be back to normal", c[4], al1[4]);
- }
- }
-
- public void TestSetRange() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.SetRange(0, c);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("setrange on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("setrange with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(-1, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("setrange with negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(2, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("setrange with too much error not thrown",
- errorThrown);
- }
-
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = ArrayList.Repeat('?', 3);
- Assert("no match yet", c[0] != (char)al1[0]);
- Assert("no match yet", c[1] != (char)al1[1]);
- Assert("no match yet", c[2] != (char)al1[2]);
- al1.SetRange(0, c);
- AssertEquals("should match", c[0], al1[0]);
- AssertEquals("should match", c[1], al1[1]);
- AssertEquals("should match", c[2], al1[2]);
- }
- }
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Sort();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("sort on read only error not thrown",
- errorThrown);
- }
- {
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- ArrayList al1 = new ArrayList(starter);
- al1.Sort();
- AssertEquals("Should be sorted", 'a', al1[0]);
- AssertEquals("Should be sorted", 'b', al1[1]);
- AssertEquals("Should be sorted", 'c', al1[2]);
- AssertEquals("Should be sorted", 'd', al1[3]);
- AssertEquals("Should be sorted", 'e', al1[4]);
- AssertEquals("Should be sorted", 'f', al1[5]);
- }
- }
-
- // TODO - Sort with IComparers
-
- // TODO - Synchronize
-
- public void TestToArray() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.ToArray(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("toarray with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- string s = "huh?";
- ArrayList al1 = new ArrayList(c);
- al1.ToArray(s.GetType());
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("toarray with bad type error not thrown",
- errorThrown);
- }
- {
- char[] c1 = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c1);
- object[] o2 = al1.ToArray();
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy", c1[i], o2[i]);
- }
- Array c2 = al1.ToArray(c1[0].GetType());
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy",
- c1[i], c2.GetValue(i));
- }
- }
- }
-
- public void TestTrimToSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.TrimToSize();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("trim read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- int capacity = al1.Capacity;
- int size = capacity / 2;
- for (int i = 1; i <=size; i++) {
- al1.Add('?');
- }
- al1.RemoveAt(0);
- al1.TrimToSize();
- AssertEquals("no capacity match",
- size - 1, al1.Capacity);
-
- al1.Clear();
- al1.TrimToSize();
- AssertEquals("no default capacity",
- capacity, al1.Capacity);
- }
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs b/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
deleted file mode 100644
index 7d29eb44911..00000000000
--- a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-//
-// BitArrayTest.cs - NUnit Test Cases for the System.Collections.BitArray class
-//
-// Author: David Menestrina (dmenest@yahoo.com)
-//
-
-using NUnit.Framework;
-using System.Collections;
-using System;
-
-namespace MonoTests.System.Collections
-{
-
-public class BitArrayTest : TestCase
-{
- private BitArray testBa;
- private bool [] testPattern;
- private BitArray op1;
- private BitArray op2;
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(BitArrayTest));
- }
- }
-
- private void verifyPattern(BitArray ba, bool[] pattern)
- {
- AssertEquals(ba.Length, pattern.Length);
- for (int i = 0; i < pattern.Length; i++)
- AssertEquals(ba[i], pattern[i]);
- }
-
- public BitArrayTest() : base ("MonoTests.System.Collections.BitArrayTest testcase") {}
- public BitArrayTest( string name ) : base(name) { }
-
- protected override void SetUp()
- {
- testPattern = new bool[70];
-
- int i;
- for(i = 0; i < testPattern.Length/2; i++)
- testPattern[i] = ((i % 2) == 0);
- for(; i < testPattern.Length; i++)
- testPattern[i] = ((i % 2) != 0);
-
- testBa = new BitArray(70);
- for(i = 0; i < testBa.Length/2; i++)
- testBa[i] = ((i % 2) == 0);
- for(; i < testBa.Length; i++)
- testBa[i] = ((i % 2) != 0);
-
- // for TestAnd, TestOr, TestNot, TestXor
- op1 = new BitArray(new int[] { 0x33333333, 0x33333333 });
- op2 = new BitArray(new int[] { 0x66666666, 0x66666666 });
- }
-
- public void TestBoolConstructor()
- {
- BitArray ba = new BitArray(testPattern);
- verifyPattern(ba, testPattern);
- }
-
- public void TestCopyConstructor()
- {
- BitArray ba = new BitArray(testBa);
-
- verifyPattern(ba, testPattern);
- }
-
- public void TestByteConstructor()
- {
- byte [] byteArr = new byte[] { 0xaa, 0x55, 0xaa, 0x55, 0x80 };
- BitArray ba = new BitArray(byteArr);
-
- AssertEquals("Lengths not equal", ba.Length, byteArr.Length * 8);
-
- // spot check
- Assert("7 not true", ba[7]);
- Assert("6 not false", !ba[6]);
- Assert("15 not false", !ba[15]);
- Assert("14 not true", ba[14]);
- Assert("39 not true", ba[39]);
- Assert("35 not false", !ba[35]);
-
- }
-
- public void TestIntConstructor()
- {
- int [] intArr = new int[] { ~0x55555555, 0x55555551 };
- BitArray ba = new BitArray(intArr);
-
- AssertEquals(ba.Length, intArr.Length * 32);
-
- // spot check
-
- Assert(ba[31]);
- Assert(!ba[30]);
- Assert(!ba[63]);
- Assert(ba[62]);
- Assert(ba[32]);
- Assert(!ba[35]);
- }
-
- public void TestValConstructor()
- {
- BitArray ba = new BitArray(64, false);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(!b);
-
- ba = new BitArray(64, true);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(b);
- }
-
- public void TestClone()
- {
- BitArray ba = (BitArray)testBa.Clone();
-
- verifyPattern(ba, testPattern);
-
- // ensure that changes in ba don't get propagated to testBa
- ba[0] = false;
- ba[1] = false;
- ba[2] = false;
-
- verifyPattern(testBa, testPattern);
- }
-
- public void TestSetLength()
- {
- int origLen = testBa.Length;
- testBa.Length += 33;
-
- AssertEquals(origLen + 33, testBa.Length);
- for (int i = origLen; i < testBa.Length; i++)
- testBa[i] = true;
-
- testBa.Length -= 33;
- verifyPattern(testBa, testPattern);
- }
-
- public void TestAnd()
- {
- BitArray result = op1.And(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestOr()
- {
- BitArray result = op1.Or(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestNot()
- {
- BitArray result = op1.Not();
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- }
- }
-
- public void TestXor()
- {
- BitArray result = op1.Xor(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestSetAll()
- {
- testBa.SetAll(false);
- foreach(bool b in testBa)
- Assert(!b);
- testBa.SetAll(true);
- foreach(bool b in testBa)
- Assert(b);
- }
-
- public void TestCopyToBool()
- {
- try {
- bool[] barray = new bool[testBa.Length + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 0; i < testBa.Length; i++)
- AssertEquals(testBa[i], barray[i+5]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToByte()
- {
- try {
- testBa.Length = 34;
- byte[] barray = new byte[5 + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 5; i < 9; i++)
- AssertEquals(0x55, barray[i] & 0xff);
-
- // FIXME: MS fails on the next line. This is because
- // we truncated testBa.Length, and MS's internal array still
- // has the old bits set. CopyTo() doesn't say specifically
- // whether the "junk" bits (bits past Length, but within Length
- // rounded up to 32) will be copied as 0, or if those bits are
- // undefined.
- //AssertEquals(0x01, barray[9] & 0xff);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToInt()
- {
- try {
- testBa.Length = 34;
- int[] iarray = new int[2 + 10];
-
- testBa.CopyTo(iarray, 5);
-
- AssertEquals(0x55555555, iarray[5]);
- // FIXME: Same thing here as in TestCopyToByte
- //AssertEquals(0x01, iarray[6]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestEnumerator()
- {
-
- try {
- IEnumerator e = testBa.GetEnumerator();
-
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- Assert(!e.MoveNext());
- // read, to make sure reading isn't considered a write.
- bool b = testBa[0];
-
- e.Reset();
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- try
- {
- e.Reset();
- testBa[0] = !testBa[0];
- e.MoveNext();
- Fail("IEnumerator.MoveNext() should throw when collection modified.");
- }
- catch (InvalidOperationException)
- {
- }
- }
- catch(Exception ex){
- Fail("Unexpected exception thrown: " + ex.ToString());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
deleted file mode 100644
index 9bd8ba35ec9..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// CaseInsensitiveComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveComparer test suite.</summary>
- public class CaseInsensitiveComparerTest : TestCase {
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CaseInsensitiveComparerTest));
- }
- }
-
- public CaseInsensitiveComparerTest() : base ("MonoTests.System.Collections.CaseInsensitiveComparerTest testcase") {}
-
- public CaseInsensitiveComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveComparer.
- Assert((CaseInsensitiveComparer.Default
- as CaseInsensitiveComparer) != null);
- }
-
- public void TestCompare () {
- CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
-
- Assert(cic.Compare ("WILD WEST", "Wild West") == 0);
- Assert(cic.Compare ("WILD WEST", "wild west") == 0);
- Assert(cic.Compare ("Zeus", "Mars") > 0);
- Assert(cic.Compare ("Earth", "Venus") < 0);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
deleted file mode 100644
index 86419a02ce4..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// CaseInsensitiveHashCodeProviderTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveHashCodeProvider test suite.</summary>
- public class CaseInsensitiveHashCodeProviderTest : TestCase {
- public CaseInsensitiveHashCodeProviderTest() : base ("MonoTests.System.Collections.CaseInsensitiveHashCodeProviderTest testcase") {}
-
- public CaseInsensitiveHashCodeProviderTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(CaseInsensitiveHashCodeProviderTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveHashCodeProvider.
- Assert((CaseInsensitiveHashCodeProvider.Default
- as CaseInsensitiveHashCodeProvider) != null);
- }
-
- public void TestHashCode () {
- CaseInsensitiveHashCodeProvider cih = new CaseInsensitiveHashCodeProvider ();
- int h1 = cih.GetHashCode ("Test String");
- int h2 = cih.GetHashCode ("test string");
- int h3 = cih.GetHashCode ("TEST STRING");
-
- Assert("Mixed Case != lower case", h1 == h2);
- Assert("Mixed Case != UPPER CASE", h1 == h3);
-
- h1 = cih.GetHashCode ("one");
- h2 = cih.GetHashCode ("another");
- // Actually this is quite possible.
- Assert(h1 != h2);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ChangeLog b/mcs/class/corlib/Test/System.Collections/ChangeLog
deleted file mode 100644
index 68d2d9d502e..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ChangeLog
+++ /dev/null
@@ -1,91 +0,0 @@
-2002-06-25 Nick Drochak <ndrochak@gol.com>
-
- * QueueTest.cs: Trap some unexpected exceptions and add a bit of
- verbosity to some assert messages.
-
-2002-06-20 Nick Drochak <ndrochak@gol.com>
-
- * SortedListTest.cs: Make tests pass against ms.net.
- * QueueTest.cs: Make tests pass against ms.net.
-
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Sort names and include missing tests.
- * SortedListTest.cs: Change Console.WriteLine() into Fail().
-
-2002-05-27 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestLastIndexOf): Add try-catch block to report
- where we are throwing.
-
-2002-05-21 Lawrence Pit <loz@cable.a2000.nl>
-
- * ArrayListTest.cs: Added several tests to test for 0 capacity
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Test for RankException when constructing from a
- multi-dimensional array. Confirmed behavior from MS.NET
-
-2002-05-01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestBinarySearch) : accomodate possible bug in
- .NET runtime.
-
-2002/05/01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestCopyTo) : Make assert messages unique and
- avoid possible MS.NET bug when test is run on .NET.
-
-2002/04/30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestInsertRange) : Make assert messages unique.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestTrimToSize): Change test so that it doesn't
- rely on the specific timing of a capacity change. Our corlib doubles
- capacity sooner than the reference system does.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Catch unexpected exception typs and report as
- failures.
-
-2002-04-29 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestBinarySearch): Catch the correct exception here.
-
-2002-04-29 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (): Remove test on unsorted array. Behavior is
- undefined according to docs. Re-added test that was commented out.
-
-2002-03-24 Duncan Mak <duncan@ximian.com>
-
- * SortedListTest.cs: Committed to CVS for Jaak Simm <jaaksimm@firm.ee>.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * HashtableTest.cs: make the second test class public. The was showing
- as an error whe run against the mscorlib. Might be because of the
- new NUnit that was just checked in.
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Add a small assert for a bug that I found and fixed
- in ArrayList. Make sure it doesn't come up again.
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * QueueTest.cs: Put in correct namespace.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StackTest.cs: Removed test for IsReadonly. Doesn't exist in .NET 1.0
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * BitArrayTest.cs: wrapped try-catch blocks around several of the tests.
- NUnit doesn't properly catch exception here anymore. Must be something
- to do with upgrading to .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
deleted file mode 100644
index 12ca737e391..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// System.Collections.CollectionBase
-// Test suite for System.Collections.CollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
-
-public class CollectionBaseTest : TestCase
-{
- public CollectionBaseTest () : base ("System.Collection.CollectionBase testsuite") {}
- public CollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteCollection : CollectionBase
- {
- // These fields are used as markers to test the On* hooks.
- public bool onClearFired;
- public bool onClearCompleteFired;
-
- public bool onInsertFired;
- public int onInsertIndex;
- public bool onInsertCompleteFired;
- public int onInsertCompleteIndex;
-
- public bool onRemoveFired;
- public int onRemoveIndex;
- public bool onRemoveCompleteFired;
- public int onRemoveCompleteIndex;
-
- public bool onSetFired;
- public int onSetOldValue;
- public int onSetNewValue;
- public bool onSetCompleteFired;
- public int onSetCompleteOldValue;
- public int onSetCompleteNewValue;
-
- // This constructor is used to test OnValid()
- public ConcreteCollection()
- {
- IList listObj;
- listObj = this;
- listObj.Add(null);
- }
-
- // This constructor puts consecutive integers into the list
- public ConcreteCollection(int i) {
- IList listObj;
- listObj = this;
-
- int j;
- for (j = 0; j< i; j++) {
- listObj.Add(j);
- }
- }
-
- // A helper method to look at a value in the list at a specific index
- public int PeekAt(int index)
- {
- IList listObj;
- listObj = this;
- return (int) listObj[index];
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClear() {
- this.onClearFired = true;
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClearComplete()
- {
- this.onClearCompleteFired = true;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsert(int index, object value)
- {
- this.onInsertFired = true;
- this.onInsertIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsertComplete(int index, object value)
- {
- this.onInsertCompleteFired = true;
- this.onInsertCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemove(int index, object value)
- {
- this.onRemoveFired = true;
- this.onRemoveIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemoveComplete(int index, object value)
- {
- this.onRemoveCompleteFired = true;
- this.onRemoveCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSet(int index, object oldValue, object newValue)
- {
- this.onSetFired = true;
- this.onSetOldValue = (int) oldValue;
- this.onSetNewValue = (int) newValue;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSetComplete(int index, object oldValue, object newValue)
- {
- this.onSetCompleteFired = true;
- this.onSetCompleteOldValue = (int) oldValue;
- this.onSetCompleteNewValue = (int) newValue;
- }
- } // public class ConcreteCollection
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof(CollectionBaseTest));
- }
- }
-
- // Check the count property
- public void TestCount() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(4 == myCollection.Count);
- }
-
- // Make sure GetEnumerator returns an object
- public void TestGetEnumerator() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(null != myCollection.GetEnumerator());
- }
-
- // OnValid disallows nulls
- public void TestOnValid() {
- ConcreteCollection myCollection;
- try {
- myCollection = new ConcreteCollection();
- }
- catch (ArgumentNullException) {
- }
- }
-
- // Test various Insert paths
- public void TestInsert() {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // The constructor inserts
- myCollection = new ConcreteCollection(numberOfItems);
- Assert(myCollection.onInsertFired);
- Assert(myCollection.onInsertCompleteFired);
-
- // Using the IList interface, check inserts in the middle
- IList listObj = myCollection;
- listObj.Insert(1, 9);
- Assert(myCollection.onInsertIndex == 1);
- Assert(myCollection.onInsertCompleteIndex == 1);
- Assert(myCollection.PeekAt(1) == 9);
- }
-
- // Test Clear and it's hooks
- public void TestClear()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 1;
- myCollection = new ConcreteCollection(numberOfItems);
- myCollection.Clear();
- Assert(myCollection.Count == 0);
- Assert(myCollection.onClearFired);
- Assert(myCollection.onClearCompleteFired);
- }
-
- // Test RemoveAt, other removes and the hooks
- public void TestRemove()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // Set up a test collection
- myCollection = new ConcreteCollection(numberOfItems);
-
- // The list is 0-based. So if we remove the second one
- myCollection.RemoveAt(1);
-
- // We should see the original third one in it's place
- Assert(myCollection.PeekAt(1) == 2);
- Assert(myCollection.onRemoveFired);
- Assert(myCollection.onRemoveIndex == 1);
- Assert(myCollection.onRemoveCompleteFired);
- Assert(myCollection.onRemoveCompleteIndex == 1);
- IList listObj = myCollection;
- listObj.Remove(0);
- // Confirm parameters are being passed to the hooks
- Assert(myCollection.onRemoveIndex == 0);
- Assert(myCollection.onRemoveCompleteIndex == 0);
- }
-
- // Test the random access feature
- public void TestSet()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- myCollection = new ConcreteCollection(numberOfItems);
- IList listObj = myCollection;
- listObj[0] = 99;
- Assert((int) listObj[0] == 99);
- Assert(myCollection.onSetFired);
- Assert(myCollection.onSetCompleteFired);
- Assert(myCollection.onSetOldValue == 0);
- Assert(myCollection.onSetCompleteOldValue == 0);
- Assert(myCollection.onSetNewValue == 99);
- Assert(myCollection.onSetCompleteNewValue == 99);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs b/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
deleted file mode 100644
index 38b78de39e7..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// ComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>Comparer test suite.</summary>
- public class ComparerTest : TestCase {
- public ComparerTest() : base ("MonoTests.System.Collections.ComparerTest testcase") {}
- public ComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(ComparerTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a Comparer.
- Assert((Comparer.Default as Comparer) != null);
- }
-
- public void TestCompare ()
- {
- Comparer c = Comparer.Default;
-
- bool thrown = false;
-
- try {
- c.Compare (new Object (), new Object ());
- } catch (ArgumentException) {
- thrown = true;
- }
-
- Assert("ArgumentException expected", thrown);
-
- Assert(c.Compare (1, 2) < 0);
- Assert(c.Compare (2, 2) == 0);
- Assert(c.Compare (3, 2) > 0);
-
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
deleted file mode 100644
index b37b16ffd1b..00000000000
--- a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
+++ /dev/null
@@ -1,761 +0,0 @@
-// HashtableTest.cs - NUnit Test Cases for the System.Collections.Hashtable class
-//
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>Hashtable test.</summary>
-public class HashtableTest : TestCase {
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
-
- suite.AddTest(new TestSuite(typeof(HashtableTest)));
- suite.AddTest(new TestSuite(typeof(HashtableTest2)));
- return suite;
- }
- }
-
- public void TestCtor1() {
- Hashtable h = new Hashtable();
- AssertNotNull("No hash table", h);
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values[i];
- }
- Hashtable h2 = new Hashtable(h1);
- for (int i = 0; i < keys.Length; i++) {
- AssertEquals("No match for key " + keys[i],
- values[i], h2[keys[i]]);
- }
- }
- }
- // TODO - Ctors for capacity and load (how to test? any access?)
- // TODO - Ctors with IComparer, IHashCodeProvider, Serialization
-
- public void TestCount() {
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("Count wrong for " + i,
- i, h.Count);
- }
- for (int i = 1; i <= max; i++) {
- h[i] = i * 2;
- AssertEquals("Count shouldn't change at " + i,
- max, h.Count);
- }
- }
-
- public void TestIsFixedSize() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not fixed by default",
- false, h.IsFixedSize);
- // TODO - any way to get a fixed-size hashtable?
- }
-
- public void TestIsReadOnly() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not read-only by default",
- false, h.IsReadOnly);
- // TODO - any way to get a read-only hashtable?
- }
-
- public void TestIsSynchronized() {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default", !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced", h2.IsSynchronized);
- }
-
- public void TestItem() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object o = h[null];
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- // TODO - if read-only and/or fixed-size is possible,
- // test 'NotSupportedException' here
-
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestKeys() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("keys wrong size",
- keys.Length, h1.Keys.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("keys wrong size 2",
- keys.Length, h1.Keys.Count);
- }
-
- // TODO - SyncRoot
-
- public void TestValues() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("values wrong size",
- keys.Length, h1.Values.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("values wrong size 2",
- keys.Length, h1.Values.Count);
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add('a', 1);
- h.Add('a', 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("re-add error not thrown",
- errorThrown);
- }
- // TODO - hit NotSupportedException
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h.Add(i, i);
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestClear() {
- // TODO - hit NotSupportedException
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- }
- Assert("table don't gots stuff", h.Count > 0);
- h.Clear();
- AssertEquals("Table should be cleared",
- 0, h.Count);
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = {'d', 'e', 'f'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
- }
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c20 = {'1', '2'};
- char[] c21 = {'3', '4'};
- char[] c22 = {'5', '6'};
- char[][] c2 = {c20, c21, c22};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
-
- ((char[])h1[c1[0]])[0] = 'z';
- AssertEquals("shallow copy", h1[c1[0]], h2[c1[0]]);
- }
- }
-
- public void TestContains() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.Contains(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.Contains('a'));
- Assert("'b'? no way!", !h.Contains('b'));
- }
- }
-
- public void TestContainsKey() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.ContainsKey(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.ContainsKey('a'));
- Assert("'b'? no way!", !h.ContainsKey('b'));
- }
- }
-
- public void TestContainsValue() {
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("blue? it's in there!",
- h.ContainsValue("blue"));
- Assert("green? no way!",
- !h.ContainsValue("green"));
- }
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.CopyTo(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[] o = new Object[1];
- h.CopyTo(o, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[,] o = new Object[1,1];
- h.CopyTo(o, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("multi-dim array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1; // no error if table is empty
- Object[] o = new Object[5];
- h.CopyTo(o, 5);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("no room in array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- h['c'] = 2;
- Object[] o = new Object[2];
- h.CopyTo(o, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("table too big error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h["blue"] = 1;
- h["green"] = 2;
- h["red"] = 3;
- Char[] o = new Char[3];
- h.CopyTo(o, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("invalid cast error not thrown",
- errorThrown);
- }
-
- {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- DictionaryEntry[] o = new DictionaryEntry[2];
- h.CopyTo(o,0);
- AssertEquals("first copy fine.", 'a', o[0].Key);
- AssertEquals("first copy fine.", 1, o[0].Value);
- AssertEquals("second copy fine.", 'b', o[1].Key);
- AssertEquals("second copy fine.", 2, o[1].Value);
- }
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- Char[] c1 = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < s1.Length; i++) {
- h1[s1[i]] = c1[i];
- }
- IDictionaryEnumerator en = h1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- Assert("Not enumerating for " + en.Key,
- Array.IndexOf(s1, en.Key) >= 0);
- Assert("Not enumerating for " + en.Value,
- Array.IndexOf(c1, en.Value) >= 0);
- }
- }
-
- // TODO - GetObjectData
- // TODO - OnDeserialization
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Remove(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h[keys[i]] = values[i];
- }
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("huh?");
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- }
- }
-
- public void TestSynchronized() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = Hashtable.Synchronized(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default",
- !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced",
- h2.IsSynchronized);
- }
- }
-
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest() : base ("MonoTests.System.Collections.HashtableTest testcase") {}
- public HashtableTest(String name) : base(name) {}
-
- protected override void SetUp() {
- ht=new Hashtable();
- rnd=new Random();
- }
-
- private void SetDefaultData() {
- ht.Clear();
- ht.Add("k1","another");
- ht.Add("k2","yet");
- ht.Add("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear() {
- ht.Clear();
- Assert(ht.Count==0);
-
- SetDefaultData();
- Assert(ht.Count==3);
-
- bool thrown=false;
- try {
- ht.Add("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count==3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo2() {
- SetDefaultData();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo(entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad() {
- ht.Clear();
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
-
- public class HashtableTest2 : TestCase {
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest2 (String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- ht=new Hashtable ();
- rnd=new Random ();
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(HashtableTest2));
- }
- }
-
- private void SetDefaultData ()
- {
- ht.Clear ();
- ht.Add ("k1","another");
- ht.Add ("k2","yet");
- ht.Add ("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear ()
- {
- ht.Clear ();
- Assert (ht.Count == 0);
-
- SetDefaultData ();
- Assert (ht.Count == 3);
-
- bool thrown=false;
- try {
- ht.Add ("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count == 3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo ()
- {
- SetDefaultData ();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo (entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad ()
- {
- ht.Clear ();
-
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
- /// <summary>
- /// Test hashtable with CaseInsensitiveHashCodeProvider
- /// and CaseInsensitive comparer.
- /// </summary>
- public void TestCaseInsensitive ()
- {
- // Not very meaningfull test, just to make
- // sure that hcp is set properly set.
- Hashtable ciHashtable = new Hashtable(11,1.0f,CaseInsensitiveHashCodeProvider.Default,CaseInsensitiveComparer.Default);
- ciHashtable ["key1"] = "value";
- ciHashtable ["key2"] = "VALUE";
- Assert(ciHashtable ["key1"].Equals ("value"));
- Assert(ciHashtable ["key2"].Equals ("VALUE"));
-
- ciHashtable ["KEY1"] = "new_value";
- Assert(ciHashtable ["key1"].Equals ("new_value"));
-
- }
-
-
- public void TestCopyConstructor ()
- {
- SetDefaultData ();
-
- Hashtable htCopy = new Hashtable (ht);
-
- Assert(ht.Count == htCopy.Count);
- }
-
-
- public void TestEnumerator ()
- {
- SetDefaultData ();
-
- IEnumerator e = ht.GetEnumerator ();
-
- while (e.MoveNext ()) {}
-
- Assert (!e.MoveNext ());
-
- }
-
-
- }
-
-
-}
-}
diff --git a/mcs/class/corlib/Test/System.Collections/QueueTest.cs b/mcs/class/corlib/Test/System.Collections/QueueTest.cs
deleted file mode 100644
index 003c5384c79..00000000000
--- a/mcs/class/corlib/Test/System.Collections/QueueTest.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// System.Collections.QueueTest
-// Test suite for System.Collections.Queue
-//
-// Author:
-// Ricardo Fernández Pascual
-//
-// (C) 2001 Ricardo Fernández Pascual
-//
-
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
-
- public class QueueTest : TestCase {
-
- public QueueTest ()
- : base ("System.Collection.Queue testsuite") {}
- public QueueTest (String name) : base (name) {}
-
- protected Queue q1;
- protected Queue q2;
- protected Queue emptyQueue;
-
- protected override void SetUp () {
- q1 = new Queue (10);
- for (int i = 0; i < 100; i++)
- q1.Enqueue (i);
-
- q2 = new Queue (50, 1.5f);
- for (int i = 50; i < 100; i++)
- q2.Enqueue (i);
-
- emptyQueue = new Queue ();
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (QueueTest));
- }
- }
-
- public void TestConstructors () {
- Assert (q1.Count == 100);
- Assert (q2.Count == 50);
- Assert (emptyQueue.Count == 0);
- // TODO: Test Queue (ICollection)
- }
-
- // TODO: should test all methods from ICollection,
- // but it should be done in ICollectionTest.cs... ??
-
- public void TestCopyTo () {
- int[] a1 = new int[100];
- int[] a2 = new int[60];
-
- string progress_marker = "";
- try {
- progress_marker = "before first CopyTo";
- q1.CopyTo (a1, 0);
- for (int i = 0; i < 100; i++)
- AssertEquals (i, a1[i]);
-
- // Remove some items from q2 and add other
- // items, to avoid having an "easy" just created
- // Queue
- for (int i = 50; i < 60; i++)
- Assert (i == (int) q2.Dequeue ());
- for (int i = 100; i < 110; i++)
- q2.Enqueue (i);
-
- progress_marker = "before second CopyTo";
- q2.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
-
- // Copying an empty Queue should not modify the array
- progress_marker = "before third CopyTo";
- emptyQueue.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
- } catch (Exception e) {
- Fail ("Unexpected exception at marker <" + progress_marker + ">: e = " + e);
- }
-
- }
-
- public void TestEnumerator () {
- int i;
- IEnumerator e;
- e = q1.GetEnumerator ();
- i = 0;
- while (e.MoveNext ()) {
- AssertEquals ("q1 at i=" + i, i, ((int) e.Current));
- i++;
- }
- e = q2.GetEnumerator ();
- i = 50;
- while (e.MoveNext ()) {
- AssertEquals (i, ((int) e.Current));
- i++;
- }
- e = emptyQueue.GetEnumerator ();
- if (e.MoveNext ())
- Fail ("Empty Queue enumerator returning elements!");
-
- e = q1.GetEnumerator ();
- try {
- e.MoveNext ();
- q1.Enqueue (0);
- e.MoveNext ();
- Fail ("#1 Should have thrown InvalidOperationException");
- } catch (InvalidOperationException) { }
- e = q1.GetEnumerator ();
- }
-
- public void TestClone () {
- Queue q3 = (Queue) q2.Clone ();
- Assert (q3.Count == q2.Count);
- for (int i = 0; i < 50; i++)
- Assert (q2.Dequeue ().Equals (q3.Dequeue ()));
- Assert (q3.Count == 0);
- Assert (q2.Count == 0);
- }
-
- public void ClearTest () {
- q1.Clear ();
- Assert (q1.Count == 0);
- q2.Clear ();
- Assert (q2.Count == 0);
- emptyQueue.Clear ();
- Assert (emptyQueue.Count == 0);
- }
-
- public void ContainsTest () {
- for (int i = 0; i < 100; i++) {
- Assert (q1.Contains (i));
- Assert (!emptyQueue.Contains (i));
- if (i < 50)
- Assert (!q2.Contains (i));
- else
- Assert (q2.Contains (i));
- }
- }
-
- public void EnqueueDequeuePeekTest () {
- int q1size = q1.Count;
- int q2size = q2.Count;
- q2.Enqueue (null);
- Assert (q2.Count == ++q2size);
- for (int i = 0; i < 50; i++) {
- int k = (int) q1.Peek ();
- Assert (q1.Count == q1size);
- int j = (int) q1.Dequeue ();
- Assert (q1.Count == --q1size);
- Assert (i == j);
- Assert (j == k);
- q2.Enqueue (j);
- Assert (q2.Count == ++q2size);
- }
- for (int i = 50; i < 100; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- Assert (q2.Peek () == null);
- Assert (q2.Dequeue () == null);
- Assert (q2.Count == --q2size);
- for (int i = 0; i < 50; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- }
-
- // TODO: test Syncronized operation
-
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
deleted file mode 100644
index 1ec201d2db2..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Collections.ReadOnlyCollectionBase
-// Test suite for System.Collections.ReadOnlyCollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- public class ReadOnlyCollectionBaseTest : TestCase {
- public ReadOnlyCollectionBaseTest () : base ("System.Collection.ReadOnlyCollectionBase testsuite") {}
- public ReadOnlyCollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteReadOnlyCollection : ReadOnlyCollectionBase
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(ReadOnlyCollectionBaseTest));
- }
- }
-
- // Make sure that the Count is 0 for a new object
- public void TestZeroCountOnNew()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(0 == myCollection.Count);
- }
-
- // Make sure we get an object from GetEnumerator()
- public void TestGetEnumerator()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(null != myCollection.GetEnumerator());
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
deleted file mode 100755
index 71668a28873..00000000000
--- a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
+++ /dev/null
@@ -1,624 +0,0 @@
-// SortedListTest.cs - NUnit Test Cases for the System.Collections.SortedList class
-//
-// Jaak Simm
-//
-// Thanks go to David Brandt (bucky@keystreams.com),
-// because this file is based on his ArrayListTest.cs
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// main TODO: additional tests for functions affected by
-// fixedsize and read-only properties
-
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>SortedList test.</summary>
-public class SortedListTest : TestCase {
- public SortedListTest() : base ("MonoTests.System.SortedListTest testsuite") {}
- public SortedListTest(string name) : base(name) {}
-
- protected SortedList sl1;
- protected SortedList sl2;
- protected SortedList emptysl;
- protected const int icap=16;
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SortedListTest));
- }
- }
-
- public void TestConstructor1() {
- SortedList temp1 = new SortedList();
- AssertNotNull("sl.constructor-1: returns null", temp1);
- AssertEquals("sl.constructor-1: incorrect initial capacity", temp1.Capacity, icap);
- }
-
- public void TestConstructor2() {
- Comparer c = Comparer.Default;
- SortedList temp1 = new SortedList(c);
- AssertNotNull("sl.constructor-2: returns null", temp1);
- AssertEquals("sl.constructor-2: incorrect initial capacity", temp1.Capacity, icap);
- }
-
- public void TestConstructor3() {
- Hashtable d = new Hashtable();
- d.Add("one", "Mircosoft");
- d.Add("two", "will");
- d.Add("three", "rule");
- d.Add("four", "the world");
-
- SortedList temp1 = new SortedList(d);
- AssertNotNull("sl.constructor-3: returns null", temp1);
- AssertEquals("sl.constructor-3: incorrect initial capacity", temp1.Capacity, 4);
- AssertEquals("sl.constructor-3: incorrect count", temp1.Count, 4);
-
- try {
- d=null;
- temp1 = new SortedList(d);
- Fail ("sl.constructor-3: does not throw ArgumentNullException");
- } catch (ArgumentNullException) {}
- try {
- d = new Hashtable();
- d.Add("one", "Mircosoft");
- d.Add("two", "will");
- d.Add("three", "rule");
- d.Add("four", "the world");
- d.Add(7987,"lkj");
- temp1 = new SortedList(d);
- Fail ("sl.constructor-3: does not throw InvalidCastException");
- } catch (InvalidOperationException) {
- } catch (Exception e) {
- Fail ("Unexpected Exception throw: e=" + e);
- }
- }
-
- public void TestConstructor4() {
- SortedList temp1 = new SortedList(17);
- AssertNotNull("sl.constructor-4: returns null", temp1);
- AssertEquals("sl.constructor-4: incorrect initial capacity", temp1.Capacity, 17);
- try {
- temp1 = new SortedList(-6);
- Fail ("sl.constructor-4: does not throw ArgumentOutOfRangeException, with negative values");
- } catch (ArgumentOutOfRangeException) {}
- try {
- temp1 = new SortedList(0);
- } catch (ArgumentOutOfRangeException) {
- Fail ("sl.constructor-4: throws ArgumentOutOfRangeException with 0");
- }
- }
-
- public void TestConstructor5() {
- Comparer c = Comparer.Default;
- SortedList temp1 = new SortedList(c,27);
- AssertNotNull("sl.constructor-5: returns null", temp1);
- AssertEquals("sl.constructor-5: incorrect initial capacity", temp1.Capacity, 27);
- try {
- temp1 = new SortedList(-12);
- Fail ("sl.constructor-5: does not throw ArgumentOutOfRangeException, with negative values");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestIsSynchronized() {
- SortedList sl1 = new SortedList();
- Assert("sl: should not be synchronized by default",
- !sl1.IsSynchronized);
- SortedList sl2 = SortedList.Synchronized(sl1);
- Assert("sl: synchronized wrapper not working", sl2.IsSynchronized);
- }
-
- public void TestCapacity() {
- for (int i = 0; i < 100; i++) {
- SortedList sl1 = new SortedList(i);
- AssertEquals("Bad capacity of " + i,
- i, sl1.Capacity);
- }
- }
-
- public void TestCount() {
- {
- SortedList sl1 = new SortedList();
- AssertEquals("Bad initial count",
- 0, sl1.Count);
- for (int i = 1; i <= 100; i++) {
- sl1.Add(""+i,""+i);
- AssertEquals("Bad count " + i,
- i, sl1.Count);
- }
- }
- }
-
- public void TestIsFixed() {
- SortedList sl1 = new SortedList();
- Assert("should not be fixed by default", !sl1.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- SortedList sl1 = new SortedList();
- Assert("should not be ReadOnly by default", !sl1.IsReadOnly);
- }
-
-
- public void TestItem() {
- SortedList sl1 = new SortedList();
- string key = null;
- {
- try {
- object o = sl1[-1];
- } catch (ArgumentNullException) {
- Fail ("sl.Item: throws ArgumentNullException with negative values");
- }
- try {
- object o = sl1[key];
- Fail ("sl.Item: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
- }
-
- for (int i = 0; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- }
- for (int i = 0; i <= 100; i++) {
- AssertEquals("sl.Item: item not fetched for " + i,
- i, sl1["kala "+i]);
- }
- }
-
- public void TestSyncRoot()
- {
- SortedList sl1 = new SortedList();
- AssertEquals("sl.SyncRoot: does not function",false, sl1.SyncRoot == null);
- /*
- lock( sl1.SyncRoot ) {
- foreach ( Object item in sl1 ) {
- item="asdf";
- Assert ("sl.SyncRoot: item not read-only",item.IsReadOnly);
- }
- }
- */
- }
-
- public void TestValues()
- {
- SortedList sl1 = new SortedList();
- ICollection ic1 = sl1.Values;
- for (int i = 0; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- AssertEquals("sl.Values: .Values has different count",ic1.Count,sl1.Count);
- }
- }
-
-
- // TODO: Add with IComparer
- public void TestAdd() {
- // seems SortedList cannot be set fixedsize or readonly
- SortedList sl1 = new SortedList();
- string key = null;
- {
- try {
- sl1.Add(key,"kala");
- Fail ("sl.Add: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
- }
-
- {
- for (int i = 1; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- AssertEquals("sl.Add: incorrect count",i,sl1.Count);
- AssertEquals("sl.Add: incorrect value",i,sl1["kala "+i]);
- }
- }
- {
- try {
- sl1.Add("kala",10);
- sl1.Add("kala",11);
- Fail ("sl.Add: does not throw ArgumentException when adding existing key");
- } catch (ArgumentException) {}
- }
- }
-
-
- public void TestClear() {
- {
- SortedList sl1 = new SortedList(10);
- sl1.Add("kala",'c');
- sl1.Add("kala2",'d');
- AssertEquals("sl.Clear: capacity is incorrect",10, sl1.Capacity);
- AssertEquals("sl.Clear: should have one element", 2, sl1.Count);
- sl1.Clear();
- AssertEquals("sl.Clear: is not cleared",0, sl1.Count);
- AssertEquals("sl.Clear: capacity is altered",16, sl1.Capacity);
- }
- }
-
- public void TestClone() {
- {
- SortedList sl1 = new SortedList(10);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
- SortedList sl2 = (SortedList)sl1.Clone();
- for (int i = 0; i <= 50; i++) {
- AssertEquals("sl.Clone: copying failed @"+i, sl1["kala "+i], sl2["kala "+i]);
- }
- }
- {
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- //char[][] d1 = {d10, d11, d12};
- SortedList sl1 = new SortedList();
- sl1.Add("d1",d10);
- sl1.Add("d2",d11);
- sl1.Add("d3",d12);
- SortedList sl2 = (SortedList)sl1.Clone();
- AssertEquals("sl.Clone: Array not matching", sl1["d1"], sl2["d1"]);
- AssertEquals("sl.Clone: Array not matching", sl1["d2"], sl2["d2"]);
- AssertEquals("sl.Clone: Array not matching", sl1["d3"], sl2["d3"]);
-
- ((char[])sl1["d1"])[0] = 'z';
- AssertEquals("s1.Clone: shallow copy", sl1["d1"], sl2["d1"]);
- }
- }
-
- public void TestContains() {
- SortedList sl1 = new SortedList(55);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
-
- try {
- if (sl1.Contains(null)){}
- Fail ("sl.Contains: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
-
- Assert("sl.Contains: can't find existing key", sl1.Contains("kala 17"));
- Assert("sl.Contains: finds non-existing key", !sl1.Contains("ohoo"));
- }
-
- public void TestContainsKey() {
- SortedList sl1 = new SortedList(55);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
-
- try {
- if (sl1.ContainsKey(null)){}
- Fail ("sl.ContainsKey: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
-
- Assert("sl.ContainsKey: can't find existing key", sl1.ContainsKey("kala 17"));
- Assert("sl.ContainsKey: finds non-existing key", !sl1.ContainsKey("ohoo"));
- }
-
- public void TestContainsValue() {
- SortedList sl1 = new SortedList(55);
- sl1.Add(0, "zero");
- sl1.Add(1, "one");
- sl1.Add(2, "two");
- sl1.Add(3, "three");
- sl1.Add(4, "four");
- Assert("sl.ContainsValue: can't find existing value", sl1.ContainsValue("zero"));
- Assert("sl.ContainsValue: finds non-existing value", !sl1.ContainsValue("ohoo"));
- Assert("sl.ContainsValue: finds non-existing value", !sl1.ContainsValue(null));
- }
-
- public void TestCopyTo() {
- SortedList sl1 = new SortedList();
- for (int i = 0; i <= 10; i++) {sl1.Add("kala "+i,i);}
- {
- try {
- sl1.CopyTo(null, 2);
- Fail("sl.CopyTo: does not throw ArgumentNullException when target null");
- } catch (ArgumentNullException) {}
- }
- {
- try {
- Char[,] c2 = new Char[2,2];
- sl1.CopyTo(c2, 2);
- Fail("sl.CopyTo: does not throw ArgumentException when target is multiarray");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, -2);
- Fail("sl.CopyTo: does not throw ArgumentOutOfRangeException when index is negative");
- } catch (ArgumentOutOfRangeException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, 3);
- Fail("sl.CopyTo: does not throw ArgumentException when index is too large");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, 1);
- Fail("sl.CopyTo: does not throw ArgumentException when SortedList too big for the array");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c2 = new Char[15];
- sl1.CopyTo(c2, 0);
- Fail("sl.CopyTo: does not throw InvalidCastException when incompatible data types");
- } catch (InvalidCastException) {}
- }
-
- // CopyTo function does not work well with SortedList
- // even example at MSDN gave InvalidCastException
- // thus, it is NOT testet here
- /*
- sl1.Clear();
- for (int i = 0; i <= 5; i++) {sl1.Add(i,""+i);}
- Char[] copy = new Char[15];
- Array.Clear(copy,0,copy.Length);
- copy.SetValue( "The", 0 );
- copy.SetValue( "quick", 1 );
- copy.SetValue( "brown", 2 );
- copy.SetValue( "fox", 3 );
- copy.SetValue( "jumped", 4 );
- copy.SetValue( "over", 5 );
- copy.SetValue( "the", 6 );
- copy.SetValue( "lazy", 7 );
- copy.SetValue( "dog", 8 );
- sl1.CopyTo(copy,1);
- AssertEquals("sl.CopyTo: incorrect copy(1).","The", copy.GetValue(0));
- AssertEquals("sl.CopyTo: incorrect copy(1).","quick", copy.GetValue(1));
- for (int i=2; i<8; i++) AssertEquals("sl.CopyTo: incorrect copy(2).",sl1["kala "+(i-2)], copy.GetValue(i));
- AssertEquals("sl.CopyTo: incorrect copy(3).","dog", copy.GetValue(8));
- */
- }
-
- public SortedList DefaultSL() {
- SortedList sl1 = new SortedList();
- sl1.Add( 1.0, "The" );
- sl1.Add( 1.1, "quick" );
- sl1.Add( 34.0, "brown" );
- sl1.Add( -100.75, "fox" );
- sl1.Add( 1.4, "jumped" );
- sl1.Add( 1.5, "over" );
- sl1.Add( 1.6, "the" );
- sl1.Add( 1.7, "lazy" );
- sl1.Add( 1.8, "dog" );
- return sl1;
- }
-
- public IList DefaultValues() {
- IList il = new ArrayList();
- il.Add( "fox" );
- il.Add( "The" );
- il.Add( "quick" );
- il.Add( "jumped" );
- il.Add( "over" );
- il.Add( "the" );
- il.Add( "lazy" );
- il.Add( "dog" );
- il.Add( "brown" );
- return il;
- }
-
- public void TestGetByIndex() {
- SortedList sl1 = DefaultSL();
- AssertEquals("cl.GetByIndex: failed(1)",sl1.GetByIndex(4),"over");
- AssertEquals("cl.GetByIndex: failed(2)",sl1.GetByIndex(8),"brown");
- try {
- sl1.GetByIndex(-1);
- Fail("sl.GetByIndex: does not throw ArgumentOutOfRangeException with negative index");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.GetByIndex(100);
- Fail("sl.GetByIndex: does not throw ArgumentOutOfRangeException with too large index");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestGetEnumerator() {
- SortedList sl1 = DefaultSL();
- IDictionaryEnumerator e = sl1.GetEnumerator();
- AssertNotNull("sl.GetEnumerator: does not return enumerator", e);
- AssertEquals("sl.GetEnumerator: enumerator not working(1)",e.MoveNext(),true);
- AssertNotNull("sl.GetEnumerator: enumerator not working(2)",e.Current);
- }
-
- public void TestGetKey() {
- SortedList sl1 = DefaultSL();
- AssertEquals("sl.GetKey: failed(1)",sl1.GetKey(4),1.5);
- AssertEquals("sl.GetKey: failed(2)",sl1.GetKey(8),34.0);
- try {
- sl1.GetKey(-1);
- Fail("sl.GetKey: does not throw ArgumentOutOfRangeException with negative index");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.GetKey(100);
- Fail("sl.GetKey: does not throw ArgumentOutOfRangeException with too large index");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestGetKeyList() {
- SortedList sl1 = DefaultSL();
- IList keys = sl1.GetKeyList();
- AssertNotNull("sl.GetKeyList: does not return keylist", keys);
- Assert("sl.GetKeyList: keylist is not readonly", keys.IsReadOnly);
- AssertEquals("sl.GetKeyList: incorrect keylist size",keys.Count,9);
- AssertEquals("sl.GetKeyList: incorrect key(1)",keys[3],1.4);
- sl1.Add(33.9,"ehhe");
- AssertEquals("sl.GetKeyList: incorrect keylist size",keys.Count,10);
- AssertEquals("sl.GetKeyList: incorrect key(2)",keys[8],33.9);
- }
-
- public void TestGetValueList() {
- SortedList sl1 = DefaultSL();
- IList originalvals = DefaultValues();
- IList vals = sl1.GetValueList();
- AssertNotNull("sl.GetValueList: does not return valuelist", vals);
- Assert("sl.GetValueList: valuelist is not readonly", vals.IsReadOnly);
- AssertEquals("sl.GetValueList: incorrect valuelist size",vals.Count,sl1.Count);
- for (int i=0; i<sl1.Count; i++) {
- AssertEquals("sl.GetValueList: incorrect key(1)",vals[i],originalvals[i]);
- }
-
- sl1.Add(0.01,"ehhe");
- AssertEquals("sl.GetValueList: incorrect valuelist size",vals.Count,10);
- AssertEquals("sl.GetValueList: incorrect value(2)",vals[8],"dog");
- }
-
- // TODO: IEnumerable.GetEnumerator [Explicit Interface Implementation]
- /*
- public void TestIEnumerable_GetEnumerator() {
- SortedList sl1 = DefaultSL();
- IEnumerator e = sl1.IEnumerable.GetEnumerator();
- AssertNotNull("sl.GetEnumerator: does not return enumerator", e);
- AssertEquals("sl.GetEnumerator: enumerator not working(1)",e.MoveNext(),true);
- AssertNotNull("sl.GetEnumerator: enumerator not working(2)",e.Current);
- }
- */
-
- public void TestIndexOfKey() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- int t;
- for (int i = 0; i <= 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,i);
- }
- AssertEquals("sl.IndexOfKey: does not return -1 for non-existing key",sl1.IndexOfKey("kala "),-1);
- s=null;
- try {
- t=sl1.IndexOfKey(s);
- Fail("sl.IndexOfKey: ArgumentNullException not caught, when key is null");
- }
- catch (ArgumentNullException) {}
- try {
- t=sl1.IndexOfKey(10);
- Fail("sl.IndexOfKey: InvalidOperationException not caught, when key invalid");
- }
- catch (InvalidOperationException) {}
- for (int i=0; i<=50; i++) {
- s=string.Format("{0:D2}", i);
- AssertEquals("sl.IndexOfKey: incorrect index key",sl1.IndexOfKey("kala "+s),i);
- }
- }
-
- public void TestIndexOfValue() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,100+i*i);
- }
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i+50);
- sl1.Add("kala "+s,100+i*i);
- }
- AssertEquals("sl.IndexOfValue: does not return -1 for non-existing value(1)",sl1.IndexOfValue(102),-1);
- AssertEquals("sl.IndexOfValue: does not return -1 for non-existing value(2)",sl1.IndexOfValue(null),-1);
- for (int i=0; i<50; i++) {
- AssertEquals("sl.IndexOfValue: incorrect index key",sl1.IndexOfValue(100+i*i),i);
- }
- }
-
-
- public void TestRemove() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- int k;
- for (int i = 0; i < 50; i++) sl1.Add("kala "+i,i);
-
- try {
- sl1.Remove(s);
- Fail("sl.Remove: ArgumentNullException not caught, when key is null");
- } catch (ArgumentNullException) {}
- k=sl1.Count;
- sl1.Remove("kala ");
- AssertEquals("sl.Remove: removes an item, when non-existing key given",sl1.Count,k);
- try {
- sl1.Remove(15);
- Fail("sl.Remove: IComparer exception is not thrown");
- } catch (Exception) {}
-
- for (int i=15; i<20; i++) sl1.Remove("kala "+i);
- for (int i=45; i<55; i++) sl1.Remove("kala "+i);
-
- AssertEquals("sl.Remove: removing failed",sl1.Count,40);
- for (int i=45; i<55; i++)
- AssertEquals("sl.Remove: removing failed(2)",sl1["kala "+i],null);
- }
-
- public void TestRemoveAt() {
- SortedList sl1 = new SortedList(24);
- int k;
- string s=null;
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,i);
- }
-
- try {
- sl1.RemoveAt(-1);
- Fail("sl.RemoveAt: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.RemoveAt(100);
- Fail("sl.RemoveAt: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- k=sl1.Count;
-
- for (int i=0; i<20; i++) sl1.RemoveAt(9);
-
- AssertEquals("sl.RemoveAt: removing failed",sl1.Count,30);
- for (int i=0; i<9; i++)
- AssertEquals("sl.RemoveAt: removing failed(2)",sl1["kala "+string.Format("{0:D2}", i)],i);
- for (int i=9; i<29; i++)
- AssertEquals("sl.RemoveAt: removing failed(3)",sl1["kala "+string.Format("{0:D2}", i)],null);
- for (int i=29; i<50; i++)
- AssertEquals("sl.RemoveAt: removing failed(4)",sl1["kala "+string.Format("{0:D2}", i)],i);
- }
-
- public void TestSetByIndex() {
- SortedList sl1 = new SortedList(24);
- for (int i = 49; i>=0; i--) sl1.Add(100+i,i);
-
- try {
- sl1.SetByIndex(-1,77);
- Fail("sl.SetByIndex: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.SetByIndex(100,88);
- Fail("sl.SetByIndex: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
-
- for(int i=5; i<25; i++) sl1.SetByIndex(i,-1);
- for(int i=0; i<5; i++)
- AssertEquals("sl.SetByIndex: set failed(1)",sl1[100+i],i);
- for(int i=5; i<25; i++)
- AssertEquals("sl.SetByIndex: set failed(2)",sl1[100+i],-1);
- for(int i=25; i<50; i++)
- AssertEquals("sl.SetByIndex: set failed(3)",sl1[100+i],i);
-
- }
-
- public void TestTrimToSize() {
- SortedList sl1 = new SortedList(24);
-
- sl1.TrimToSize();
- AssertEquals("sl.TrimToSize: incorrect capacity after trimming empty list",icap,sl1.Capacity);
-
- for (int i = 72; i>=0; i--) sl1.Add(100+i,i);
- sl1.TrimToSize();
- AssertEquals("sl.TrimToSize: incorrect capacity after trimming a list",73,sl1.Capacity);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/StackTest.cs b/mcs/class/corlib/Test/System.Collections/StackTest.cs
deleted file mode 100644
index fdcc3b07cce..00000000000
--- a/mcs/class/corlib/Test/System.Collections/StackTest.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// StackTest.cs
-//
-// Author:
-// Chris Hynes <chrish@assistedsolutions.com>
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-
-using System.Collections;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
- public class StackTest: TestCase
- {
- private Stack stack1;
- private Stack stack2;
- private Stack stackInt;
-
- public void TestConstructor()
- {
- AssertEquals(false, stack1 == null);
- }
-
- public void TestICollectionConstructor()
- {
- Stack stackTest = new Stack(new int[] {0, 1, 2, 3, 4});
-
- for (int i = 4; i >= 0; i--)
- AssertEquals(i, stackTest.Pop());
-
- AssertEquals(0, stackTest.Count);
- }
-
- public void TestIntConstructor()
- {
- Stack stackTest = new Stack(50);
-
- AssertEquals(false, stackTest == null);
- }
-
- public void TestCount()
- {
- Stack stackTest = new Stack();
-
- stackTest.Push(50);
- stackTest.Push(5);
- stackTest.Push(0);
- stackTest.Push(50);
-
- AssertEquals(4, stackTest.Count);
- }
-
- public void TestIsSyncronized()
- {
- AssertEquals(false, stack1.IsSynchronized);
- AssertEquals(true, Stack.Synchronized(stack1).IsSynchronized);
- }
-
- public void TestSyncRoot()
- {
- AssertEquals(false, stack1.SyncRoot == null);
- }
-
- public void TestGetEnumerator()
- {
- stackInt.Pop();
-
- int j = 3;
-
- foreach (int i in stackInt)
- {
- AssertEquals(j--, i);
- }
-
- stackInt.Clear();
-
- IEnumerator e = stackInt.GetEnumerator();
-
- AssertEquals(false, e.MoveNext());
- }
-
- public void TestClear()
- {
- stackInt.Clear();
-
- AssertEquals(0, stackInt.Count);
- }
-
- public void TestClone()
- {
- Stack clone = (Stack)stackInt.Clone();
-
- while (stackInt.Count > 0)
- {
- AssertEquals(stackInt.Pop(), clone.Pop());
- }
- }
-
- public void TestContains()
- {
- string toLocate = "test";
-
- stackInt.Push(toLocate);
-
- stackInt.Push("chaff");
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(!stackInt.Contains(toLocate));
- }
-
- public void TestCopyTo()
- {
- int[] arr = new int[stackInt.Count - 1];
- int[,] arrMulti;
-
- try
- {
- stackInt.CopyTo(null, 0);
- Fail("Should throw an ArgumentNullException");
- }
- catch (ArgumentNullException) {}
-
- try
- {
- stackInt.CopyTo(arr, -1);
- Fail("Should throw an ArgumentOutOfRangeException");
- }
- catch (ArgumentOutOfRangeException) {}
-
- try
- {
- stackInt.CopyTo(arrMulti = new int[1, 1], 1);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[3], 2);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- arr = new int[stackInt.Count];
-
- stackInt.CopyTo(arr, 0);
-
- int j = 4;
-
- for (int i = 0; i < 4; i++)
- {
- AssertEquals(j--, arr[i]);
- }
- }
-
- public void TestSyncronized()
- {
- Stack syncStack = Stack.Synchronized(stackInt);
-
- syncStack.Push(5);
-
- for (int i = 5; i >= 0; i--)
- AssertEquals(i, syncStack.Pop());
- }
-
- public void TestPushPeekPop()
- {
- stackInt.Pop();
-
- int topVal = (int)stackInt.Peek();
-
- AssertEquals(3, topVal);
-
- AssertEquals(4, stackInt.Count);
-
- AssertEquals(topVal, stackInt.Pop());
-
- AssertEquals(2, stackInt.Pop());
-
- Stack test = new Stack();
- test.Push(null);
-
- AssertEquals(null, test.Pop());
- }
-
- public void TestToArray()
- {
- object[] arr = stackInt.ToArray();
-
- AssertEquals(stackInt.Count, arr.Length);
-
- for (int i = 0; i < 5; i++)
- AssertEquals(arr[i], stackInt.Pop());
- }
-
- static void Main(string[] args)
- {
- //
- // TODO: Add code to start application here
- //
- }
-
- protected override void SetUp()
- {
- stack1 = new Stack();
- stack2 = new Stack();
-
- stackInt = new Stack();
-
- for (int i = 0; i < 5; i++)
- stackInt.Push(i);
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite stackSuite = new TestSuite();
-
- stackSuite.AddTest(new StackTest("TestConstructor"));
- stackSuite.AddTest(new StackTest("TestICollectionConstructor"));
- stackSuite.AddTest(new StackTest("TestIntConstructor"));
-
- stackSuite.AddTest(new StackTest("TestCount"));
- stackSuite.AddTest(new StackTest("TestIsSyncronized"));
- stackSuite.AddTest(new StackTest("TestSyncRoot"));
-
- stackSuite.AddTest(new StackTest("TestGetEnumerator"));
- stackSuite.AddTest(new StackTest("TestClear"));
- stackSuite.AddTest(new StackTest("TestClone"));
- stackSuite.AddTest(new StackTest("TestContains"));
- stackSuite.AddTest(new StackTest("TestPushPeekPop"));
- stackSuite.AddTest(new StackTest("TestCopyTo"));
- stackSuite.AddTest(new StackTest("TestSyncronized"));
- stackSuite.AddTest(new StackTest("TestToArray"));
-
- return stackSuite;
- }
- }
-
- public StackTest() : base ("MonoTests.System.Collections.StackTest testcase") {}
- public StackTest(string name): base(name) {}
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs b/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
deleted file mode 100644
index d6eab84474c..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(DebugTest.Suite);
- suite.AddTest(StackTraceTest.Suite);
- suite.AddTest(StackFrameTest.Suite);
- suite.AddTest(TextWriterTraceListenerTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog b/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
deleted file mode 100644
index cd80e678c90..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: DebugTest
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * DebugTest.cs: Put in correct namespace.
- * TextWriterTraceListenerTest.cs: Put in correct namespace. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs b/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
deleted file mode 100644
index 5d620ea5813..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// MonoTests.System.Diagnostics.DebugTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2002
-using System;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
- public class DebugTest
- {
- private DebugTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(DebugTest1.Suite);
- return suite;
- }
- }
-
- private class DebugTest1 : TestCase
- {
- public DebugTest1(string name) : base(name)
- {
-
- }
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(DebugTest1));
- }
- }
-
- protected override void SetUp()
- {
- Debug.Listeners.Add(new TextWriterTraceListener(Console.Error));
- }
-
- protected override void TearDown()
- {
-
- }
-
- public void TestAssert()
- {
- Debug.Assert(false, "Testing Assertions");
- }
-
- public void TestFail()
- {
- Debug.Fail("Testing Fail method");
- }
-
- public void TestWrite()
- {
- Debug.Write("Testing Write", "Testing the output of the Write method");
- }
-
- public void TestWriteIf()
- {
- Debug.WriteIf(true, "Testing WriteIf");
- Debug.WriteIf(false, "Testing WriteIf", "Passed false");
- }
-
- public void TestWriteLine()
- {
- Debug.WriteLine("Testing WriteLine method");
- }
-
- public void TestWriteLineIf()
- {
- Debug.WriteLineIf(true, "Testing WriteLineIf");
- Debug.WriteLineIf(false, "Testing WriteLineIf", "Passed false");
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
deleted file mode 100644
index ce35039c1a4..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-//
-// MonoTests.System.Diagnostics.StackFrameTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackFrameTest {
- private StackFrameTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackFrameTest1.Suite);
- suite.AddTest(StackFrameTest2.Suite);
- suite.AddTest(StackFrameTest3.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for specified file name and
- /// location inside it.
- /// </summary>
- private class StackFrameTest1 : TestCase {
- public StackFrameTest1(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest1));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame("dir/someFile", 13, 45);
- frame2 = new StackFrame("SomeFile2.cs", 24);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertEquals("File name (1)",
- "dir/someFile",
- frame1.GetFileName());
-
- AssertEquals("File name (2)",
- "SomeFile2.cs",
- frame2.GetFileName());
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 13,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 24,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 45,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 0,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest2 : TestCase {
- public StackFrameTest2(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
- private StackFrame frame3;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest2));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame();
- frame2 = new StackFrame(true);
- frame3 = new StackFrame(0);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- frame3 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 154,
- frame2.GetFileLineNumber());
-
- AssertEquals("Line number (3)",
- 0,
- frame3.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 25,
- frame2.GetFileColumnNumber());
-
- AssertEquals("Column number (3)",
- 0,
- frame3.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)",
- (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)",
- (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
-
- Assert("Method not null (3)",
- (frame3.GetMethod() != null));
-
- AssertEquals("Class declaring the method (3)",
- this.GetType(),
- frame3.GetMethod().DeclaringType);
- AssertEquals("Method name (3)",
- "SetUp",
- frame3.GetMethod().Name);
- }
- }
-
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method but
- /// skipping some frames.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest3 : TestCase {
- public StackFrameTest3(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest3));
- }
- }
-
- protected override void SetUp() {
- // In order to get better test cases with stack traces
- NestedSetUp();
- }
-
- private void NestedSetUp() {
- frame1 = new StackFrame(2);
- frame2 = new StackFrame(1, true);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 277,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 17,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- typeof(NUnit.Framework.TestCase),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "RunBare",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
deleted file mode 100644
index 84a7b4876a6..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// MonoTests.System.Diagnostics.StackTraceTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackTraceTest {
- private StackTraceTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackTraceTest1.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackTrace is created for specified
- /// stack frame.
- /// </summary>
- private class StackTraceTest1 : TestCase {
- public StackTraceTest1(string name) : base(name) {}
-
- private StackTrace trace;
- private StackFrame frame;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackTraceTest1));
- }
- }
-
- protected override void SetUp() {
- frame = new StackFrame("dir/someFile",
- 13,
- 45);
- trace = new StackTrace(frame);
- }
-
- protected override void TearDown() {
- trace = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting number of frames works.
- /// </summary>
- public void TestFrameCount() {
- AssertEquals("Frame count",
- 1,
- trace.FrameCount);
- }
-
- /// <summary>
- /// Tests whether getting frames by index which is out of
- /// range works.
- /// </summary>
- public void TestGetFrameOutOfRange() {
- Assert("Frame with index -1 == null",
- (trace.GetFrame(-1) == null));
-
- Assert("Frame with index -129 = null",
- (trace.GetFrame(-129) == null));
-
- Assert("Frame with index 1 = null",
- (trace.GetFrame(1) == null));
-
- Assert("Frame with index 145 = null",
- (trace.GetFrame(145) == null));
-
- }
-
-
- /// <summary>
- /// Tests whether getting frames by index works.
- /// </summary>
- public void TestGetFrame() {
- AssertEquals("Frame with index 0",
- frame,
- trace.GetFrame(0));
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs b/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
deleted file mode 100644
index c7cc8e35b90..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// MonoTests.System.Diagnostics.TextWriterTraceListenerTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-
-using System;
-using System.IO;
-using System.Text;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
-
- public class TextWriterTraceListenerTest
- {
- private TextWriterTraceListenerTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(TextWriterTraceListenerTest1.Suite);
- return suite;
- }
- }
-
- private class TextWriterTraceListenerTest1 : TestCase
- {
- public TextWriterTraceListenerTest1(string name) : base(name)
- {
- }
-
- private TextWriterTraceListener listener;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(TextWriterTraceListenerTest1));
- }
- }
-
- protected override void SetUp()
- {
- listener = new TextWriterTraceListener();
- listener.Writer = Console.Out;
- }
-
- protected override void TearDown()
- {
- listener = null;
- }
-
- public void TestWrite()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.Write("Test Message\n");
-
- }
-
- public void TestWriteLine()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.WriteLine("Test WriteLine Message");
- }
-
- public void TestFlush()
- {
- listener.Flush();
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Globalization/AllTests.cs b/mcs/class/corlib/Test/System.Globalization/AllTests.cs
deleted file mode 100644
index 7d80e617556..00000000000
--- a/mcs/class/corlib/Test/System.Globalization/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// System.Globalization/AllTests.cs
-//
-// (C) 2002 Ulrich Kunitz
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Globalization {
-
-/// <summary>
-/// Combines all available unit tests into one test suite.
-/// </summary>
-public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(CalendarTest.Suite);
- return suite;
- }
- }
-} // class AllTests
-
-} // namespace MonoTests.System.Globalization
diff --git a/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs b/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
deleted file mode 100644
index 83d6b68ea91..00000000000
--- a/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
+++ /dev/null
@@ -1,602 +0,0 @@
-// CalendarTest.cs
-//
-// (C) 2002 Ulrich Kunitz
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.IO;
-
-namespace MonoTests.System.Globalization
-{
-
-sealed class Date {
- private int _day, _month, _year, _era;
-
- public int Day {
- get {
- return _day;
- }
- set {
- if (value < 1 || value > 31)
- throw new ArgumentOutOfRangeException(
- "Day",
- "Day must be between 1 and 31.");
- _day = value;
- }
- }
-
- public int Month {
- get {
- return _month;
- }
- set {
- if (value < 1 || value > 13)
- throw new ArgumentOutOfRangeException(
- "Month",
- "Month must be between 1 and 13.");
- _month = value;
- }
- }
-
- public int Year {
- get {
- return _year;
- }
- set {
- _year = value;
- }
- }
-
- public int Era {
- get {
- return _era;
- }
- set {
- if (value < 1 || value > 10)
- throw new ArgumentOutOfRangeException(
- "Era",
- "Era must be between 1 and 10.");
- _era = value;
- }
- }
-
- public Date(int day, int month, int year, int era) {
- Day = day;
- Month = month;
- Year = year;
- Era = era;
- }
- public Date(int day, int month, int year) : this(day,month,year,1) {}
- public Date() : this(1,1,1,1) {}
-
- public DateTime ToDateTime(Calendar cal) {
- return cal.ToDateTime(Year,Month,Day,0,0,0,0,Era);
- }
-
- public void FromDateTime(Calendar cal, DateTime time) {
- Date dmy = new Date();
- dmy.Day = cal.GetDayOfMonth(time);
- dmy.Month = cal.GetMonth(time);
- dmy.Year = cal.GetYear(time);
- dmy.Era = cal.GetEra(time);
- Day = dmy.Day;
- Month = dmy.Month;
- Year = dmy.Year;
- Era = dmy.Era;
- }
-
- public override string ToString() {
- StringWriter sw = new StringWriter();
- sw.Write("{0}.{1}.{2}", Day, Month, Year);
- if (Era != 1) {
- sw.Write(" era {0}", Era);
- }
- return sw.ToString();
- }
-
- public override bool Equals(Object b) {
- if (b == null || GetType() != b.GetType())
- return false;
- return Equals(this, (Date)b);
- }
-
- public static bool Equals(Date a, Date b) {
- if (a == b)
- return true;
- if (a.Year != b.Year)
- return false;
- if (a.Month != b.Month)
- return false;
- if (a.Day != b.Day)
- return false;
- if (a.Era != b.Era)
- return false;
- return true;
- }
-
- public override int GetHashCode() {
- return ToString().GetHashCode();
- }
-} // class Date
-
-public class CalendarTest : TestCase {
- public CalendarTest() : base("System.Globalization.CalendarTest") {}
- public CalendarTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CalendarTest));
- }
- }
-
- private Calendar[] acal;
- private GregorianCalendar gcal;
- private JulianCalendar jucal;
- private HijriCalendar hical;
- private HebrewCalendar hecal;
- private JapaneseCalendar jacal;
- private TaiwanCalendar tacal;
- private KoreanCalendar kcal;
- private ThaiBuddhistCalendar tbcal;
-
- protected override void SetUp() {
- gcal = new GregorianCalendar();
- jucal = new JulianCalendar();
- hical = new HijriCalendar();
- hecal = new HebrewCalendar();
- jacal = new JapaneseCalendar();
- tacal = new TaiwanCalendar();
- kcal = new KoreanCalendar();
- tbcal = new ThaiBuddhistCalendar();
- acal = new Calendar[] {
- gcal, jucal, hical, hecal, jacal,
- tacal, kcal, tbcal};
- }
-
- private void RowCheck(params Date[] adate) {
- if (adate.Length != acal.Length)
- throw new ArgumentException(
- "Number of Date arguments doesn't match " +
- "length of calendar array.");
-
- DateTime timeG = adate[0].ToDateTime(gcal);
- for (int i = 0; i < acal.Length; i++) {
- Date date = adate[i];
- if (date == null)
- continue;
- Calendar cal = acal[i];
-
- DateTime time = date.ToDateTime(cal);
- StringWriter sw = new StringWriter();
- sw.Write("Calendar {0} computes wrong DateTime.",
- cal);
- AssertEquals(sw.ToString(), timeG, time);
-
- sw = new StringWriter();
- Date ndate = new Date();
- ndate.FromDateTime(cal, time);
- sw.Write("Calendar {0} computes wrong date", cal);
- AssertEquals(sw.ToString(), date, ndate);
- }
- }
-
- // We are testing the implementation against the reference dates in
- // Calendrical Calcualation. Please note that the CLR uses another
- // epoch for the HijriCalendar, which might be the perfect thing
- // to do.
- public void TestCCTable() {
- // Gr Ju Hi He Ja Ta Ko TB
- RowCheck(new Date(24,9,70,1),
- new Date(26,9,70,1),
- null,
- null,
- null,
- null,
- new Date(24,9,2403,1),
- new Date(24,9,613,1));
- RowCheck(new Date(2,10,135,1),
- new Date(3,10,135,1),
- null,
- null,
- null,
- null,
- new Date(2,10,2468,1),
- new Date(2,10,678,1));
- RowCheck(new Date(8,1,470,1),
- new Date(7,1,470,1),
- null,
- null,
- null,
- null,
- new Date(8,1,2803,1),
- new Date(8,1,1013,1));
- RowCheck(new Date(20,5,576,1),
- new Date(18,5,576,1),
- null,
- null,
- null,
- null,
- new Date(20,5,2909,1),
- new Date(20,5,1119,1));
- RowCheck(new Date(10,11,694,1),
- new Date(7,11,694,1),
- new Date(14,7,75,1),
- null,
- null,
- null,
- new Date(10,11,3027,1),
- new Date(10,11,1237,1));
- RowCheck(new Date(25,4,1013,1),
- new Date(19,4,1013,1),
- new Date(6,10,403,1),
- null,
- null,
- null,
- new Date(25,4,3346,1),
- new Date(25,4,1556,1));
- RowCheck(new Date(24,5,1096,1),
- new Date(18,5,1096,1),
- new Date(23,5,489,1),
- null,
- null,
- null,
- new Date(24,5,3429,1),
- new Date(24,5,1639,1));
- RowCheck(new Date(23,3,1190,1),
- new Date(16,3,1190,1),
- new Date(8,2,586,1),
- null,
- null,
- null,
- new Date(23,3,3523,1),
- new Date(23,3,1733,1));
- RowCheck(new Date(10,3,1240,1),
- new Date(3,3,1240,1),
- new Date(8,8,637,1),
- null,
- null,
- null,
- new Date(10,3,3573,1),
- new Date(10,3,1783,1));
- RowCheck(new Date(2,4,1288,1),
- new Date(26,3,1288,1),
- new Date(21,2,687,1),
- null,
- null,
- null,
- new Date(2,4,3621,1),
- new Date(2,4,1831,1));
- RowCheck(new Date(27,4,1298,1),
- new Date(20,4,1298,1),
- new Date(8,7,697,1),
- null,
- null,
- null,
- new Date(27,4,3631,1),
- new Date(27,4,1841,1));
- RowCheck(new Date(12,6,1391,1),
- new Date(4,6,1391,1),
- new Date(2,7,793,1),
- null,
- null,
- null,
- new Date(12,6,3724,1),
- new Date(12,6,1934,1));
- RowCheck(new Date(3,2,1436,1),
- new Date(25,1,1436,1),
- new Date(7,7,839,1),
- null,
- null,
- null,
- new Date(3,2,3769,1),
- new Date(3,2,1979,1));
- RowCheck(new Date(9,4,1492,1),
- new Date(31,3,1492,1),
- new Date(2,6,897,1),
- null,
- null,
- null,
- new Date(9,4,3825,1),
- new Date(9,4,2035,1));
- RowCheck(new Date(19,9,1553,1),
- new Date(9,9,1553,1),
- new Date(1,10,960,1),
- null,
- null,
- null,
- new Date(19,9,3886,1),
- new Date(19,9,2096,1));
- RowCheck(new Date(5,3,1560,1),
- new Date(24,2,1560,1),
- new Date(28,5,967,1),
- null,
- null,
- null,
- new Date(5,3,3893,1),
- new Date(5,3,2103,1));
- RowCheck(new Date(10,6,1648,1),
- new Date(31,5,1648,1),
- new Date(19,5,1058,1),
- new Date(20,9,5408,1),
- null,
- null,
- new Date(10,6,3981,1),
- new Date(10,6,2191,1));
- RowCheck(new Date(30,6,1680,1),
- new Date(20,6,1680,1),
- new Date(3,6,1091,1),
- new Date(3,11,5440,1),
- null,
- null,
- new Date(30,6,4013,1),
- new Date(30,6,2223,1));
- RowCheck(new Date(24,7,1716,1),
- new Date(13,7,1716,1),
- new Date(5,8,1128,1),
- new Date(5,11,5476,1),
- null,
- null,
- new Date(24,7,4049,1),
- new Date(24,7,2259,1));
- RowCheck(new Date(19,6,1768,1),
- new Date(8,6,1768,1),
- new Date(4,2,1182,1),
- new Date(4,10,5528,1),
- null,
- null,
- new Date(19,6,4101,1),
- new Date(19,6,2311,1));
- RowCheck(new Date(2,8,1819,1),
- new Date(21,7,1819,1),
- new Date(11,10,1234,1),
- new Date(11,11,5579,1),
- null,
- null,
- new Date(2,8,4152,1),
- new Date(2,8,2362,1));
- RowCheck(new Date(27,3,1839,1),
- new Date(15,3,1839,1),
- new Date(12,1,1255,1),
- new Date(12,7,5599,1),
- null,
- null,
- new Date(27,3,4172,1),
- new Date(27,3,2382,1));
- RowCheck(new Date(19,4,1903,1),
- new Date(6,4,1903,1),
- new Date(22,1,1321,1),
- new Date(22,7,5663,1),
- new Date(19,4,36,1),
- null,
- new Date(19,4,4236,1),
- new Date(19,4,2446,1));
- RowCheck(new Date(25,8,1929,1),
- new Date(12,8,1929,1),
- new Date(20,3,1348,1),
- new Date(19,12,5689,1),
- new Date(25,8,4,3),
- new Date(25,8,18,1),
- new Date(25,8,4262,1),
- new Date(25,8,2472,1));
- RowCheck(new Date(29,9,1941,1),
- new Date(16,9,1941,1),
- new Date(9,9,1360,1),
- new Date(8,1,5702,1),
- new Date(29,9,16,3),
- new Date(29,9,30,1),
- new Date(29,9,4274,1),
- new Date(29,9,2484,1));
- RowCheck(new Date(19,4,1943,1),
- new Date(6,4,1943,1),
- new Date(14,4,1362,1),
- new Date(14,8,5703,1),
- new Date(19,4,18,3),
- new Date(19,4,32,1),
- new Date(19,4,4276,1),
- new Date(19,4,2486,1));
- RowCheck(new Date(7,10,1943,1),
- new Date(24,9,1943,1),
- new Date(8,10,1362,1),
- new Date(8,1,5704,1),
- new Date(7,10,18,3),
- new Date(7,10,32,1),
- new Date(7,10,4276,1),
- new Date(7,10,2486,1));
- RowCheck(new Date(17,3,1992,1),
- new Date(4,3,1992,1),
- new Date(14,9,1412,1),
- new Date(12,7,5752,1),
- new Date(17,3,4,4),
- new Date(17,3,81,1),
- new Date(17,3,4325,1),
- new Date(17,3,2535,1));
- RowCheck(new Date(25,5,1996,1),
- new Date(12,5,1996,1),
- new Date(8,1,1417,1),
- new Date(7,9,5756,1),
- new Date(25,5,8,4),
- new Date(25,5,85,1),
- new Date(25,5,4329,1),
- new Date(25,5,2539,1));
- RowCheck(new Date(10,11,2038,1),
- new Date(28,10,2038,1),
- new Date(13,10,1460,1),
- new Date(12,2,5799,1),
- new Date(10,11,50,4),
- new Date(10,11,127,1),
- new Date(10,11,4371,1),
- new Date(10,11,2581,1));
- RowCheck(new Date(18,7,2094,1),
- new Date(5,7,2094,1),
- new Date(6,3,1518,1),
- new Date(5,11,5854,1),
- new Date(18,7,106,4),
- new Date(18,7,183,1),
- new Date(18,7,4427,1),
- new Date(18,7,2637,1));
- }
-
- public void TestCalendarType() {
- GregorianCalendar gc = new GregorianCalendar(
- GregorianCalendarTypes.Arabic);
- AssertEquals("A01 Gregorian ctor " +
- "with GregorianCalendarTypes parameter",
- GregorianCalendarTypes.Arabic,
- gc.CalendarType);
- gc.CalendarType = GregorianCalendarTypes.MiddleEastFrench;
- AssertEquals("A02 GregorianCalendar.CalendarType",
- GregorianCalendarTypes.MiddleEastFrench,
- gc.CalendarType);
- }
-
- public void TestStandardEras() {
- AssertEquals("B01 ADEra", 1, GregorianCalendar.ADEra);
- AssertEquals("B02 HebrewEra", 1, HebrewCalendar.HebrewEra);
- AssertEquals("B03 HjriEra", 1, HijriCalendar.HijriEra);
- AssertEquals("B04 JulianEra", 1, JulianCalendar.JulianEra);
- AssertEquals("B05 KoreanEra", 1, KoreanCalendar.KoreanEra);
- AssertEquals("B06 ThaiBuddhistEra", 1,
- ThaiBuddhistCalendar.ThaiBuddhistEra);
- }
-
- public void TestCurrentEra() {
- AssertEquals("C01 GregorianCalendar.CurrentEra",
- 0, GregorianCalendar.CurrentEra);
- AssertEquals("C02 HebrewCalendar.CurrentEra",
- 0, HebrewCalendar.CurrentEra);
- AssertEquals("C03 HijriCalendar.CurrentEra",
- 0, HijriCalendar.CurrentEra);
- AssertEquals("C04 JapaneseCalendar.CurrentEra",
- 0, JapaneseCalendar.CurrentEra);
- AssertEquals("C05 JulianCalendar.CurrentEra",
- 0, JulianCalendar.CurrentEra);
- AssertEquals("C06 KoreanCalendar.CurrentEra",
- 0, KoreanCalendar.CurrentEra);
- AssertEquals("C07 TaiwanCalendar.CurrentEra",
- 0, TaiwanCalendar.CurrentEra);
- AssertEquals("C08 ThaiBuddhistCalendar.CurrentEra",
- 0,
- ThaiBuddhistCalendar.CurrentEra);
- }
-
- public void TestErasProperty() {
- foreach (Calendar cal in acal) {
- int check = 1;
- if (cal is JapaneseCalendar)
- check = 4;
- AssertEquals(String.Format("D01 {0}.Eras.Length", cal),
- check, cal.Eras.Length);
- cal.Eras[0] = 29;
- Assert(String.Format("D02 {0}.Eras readonly", cal),
- cal.Eras[0] != 29);
- }
- }
-
- public void TestTwoDigitYearMax() {
- AssertEquals("E01 TwoDigitYearMax GregorianCalendar",
- 2029, gcal.TwoDigitYearMax);
- AssertEquals("E02 TwoDigitYearMax HebrewCalendar",
- 5790, hecal.TwoDigitYearMax);
- AssertEquals("E03 TwoDigitYearMax HijriCalendar",
- 1451, hical.TwoDigitYearMax);
- AssertEquals("E04 TwoDigitYearMax JapaneseCalendar",
- 99, jacal.TwoDigitYearMax);
- AssertEquals("E05 TwoDigitYearMax JulianCalendar",
- 2029, jucal.TwoDigitYearMax);
- AssertEquals("E06 TwoDigitYearMax KoreanCalendar",
- 4362, kcal.TwoDigitYearMax);
- AssertEquals("E07 TwoDigitYearMax TaiwanCalendar",
- 99, tacal.TwoDigitYearMax);
- AssertEquals("E08 TwoDigitYearMax ThaiBuddhistCalendar",
- 2572, tbcal.TwoDigitYearMax);
- foreach (Calendar cal in acal) {
- bool exception = false;
- try {
- cal.TwoDigitYearMax = 99;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format("E09 {0}.TwoDigitYearMax 99 " +
- " out of range exception", cal),
- exception);
-
- exception = false;
- int m = 10000;
- try {
- m = cal.GetYear(DateTime.MaxValue)+1;
- cal.TwoDigitYearMax = m;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert(String.Format("E10 {0}.TwoDigitYearMax out " +
- " of range exception value {1}",
- cal, m),
- exception);
- }
- }
-
- /* UK TODO: breaks with current DateTime implementation.
- * I've a newer one that works, but that requires to much changes.
- * for now.
- public void TestToFourDigitYear() {
- foreach (Calendar cal in acal) {
- bool working = true;
- int mod = 2000;
- if (cal is HebrewCalendar)
- mod = 5500;
- if (cal is KoreanCalendar)
- mod = 3000;
- if (cal is JapaneseCalendar)
- working = false;
- if (cal is TaiwanCalendar)
- working = false;
- cal.TwoDigitYearMax = mod + 229;
- AssertEquals(
- String.Format("F01 {0}.TwoDigitYearMax", cal),
- mod+229 , cal.TwoDigitYearMax);
- AssertEquals(
- String.Format("F02 {0}.ToFourDigitYear(29)",
- cal),
- working ? mod+229 : 29,
- cal.ToFourDigitYear(29));
- AssertEquals(
- String.Format("F03 {0}.ToFourDigitYear(30)",
- cal),
- working ? mod+130 : 30,
- cal.ToFourDigitYear(30));
- AssertEquals(
- String.Format("F04 {0}.ToFourDigitYear({1})",
- cal, mod),
- mod, cal.ToFourDigitYear(mod));
- bool exception = false;
- try {
- cal.ToFourDigitYear(-1);
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format(
- "F05 {0}.ToFourDigitYear(-1) exception",
- cal), exception);
- exception = false;
- try {
- cal.ToFourDigitYear(15000);
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format(
- "F05 {0}.ToFourDigitYear(15000) exception",
- cal), exception);
- }
- }
- */
-
- // TODO: more tests :-)
-} // class CalendarTest
-
-} // namespace MonoTests.System.Globalization
diff --git a/mcs/class/corlib/Test/System.IO/AllTests.cs b/mcs/class/corlib/Test/System.IO/AllTests.cs
deleted file mode 100644
index 16858d83b05..00000000000
--- a/mcs/class/corlib/Test/System.IO/AllTests.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.IO {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(MemoryStreamTest.Suite);
- suite.AddTest(StreamReaderTest.Suite);
- suite.AddTest(StreamWriterTest.Suite);
- suite.AddTest(PathTest.Suite);
- suite.AddTest(StringReaderTest.Suite);
- suite.AddTest(StringWriterTest.Suite);
- suite.AddTest(FileTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.IO/ChangeLog b/mcs/class/corlib/Test/System.IO/ChangeLog
deleted file mode 100644
index ecf65195013..00000000000
--- a/mcs/class/corlib/Test/System.IO/ChangeLog
+++ /dev/null
@@ -1,95 +0,0 @@
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * StringReaderTest.cs: Regression test for a bug that we had were
- ReadLine() was not returning null when the string ended with newline.
-
-2002-05-15 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs:
- * StreamWriterTest.cs:
- Make sure invalid file name has invalid characters in it. These are
- platform dependant.
-
-2002-05-14 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Delete temporary files after each test method; Catch
- unexpected exceptions and report them; Make some Assert messages
- unique; Make sure temp files exist before trying Move and Delete, etc.
-
-2002-05-13 Mike Gray <mike@mikegray.org>
-
- * FileTest.cs: Adding better tests for File.Delete, File.Move
-
-2002-05-12 Mike Gray <mike@mikegray.org>
-
- * FileTest.cs: Adding better tests for File.Exists, File.Create,
- and File.Copy
-
-2002-05-12 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Add a couple more tests.
- * PathTest.cs: Make tests work a bit better on W32 and Linux.
-
-2002/05/10 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriterTest.cs: Use "resources" directory and use OS friendly
- directory separator characters. This makes the tests run correctly
- against MS.NET, but not yet in mono on Linux.
-
-2002/05/08 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Use "resources" directory and use OS friendly
- directory separator characters. This makes the tests run correctly
- against MS.NET, but not yet in mono on Linux.
-
-2002-05-08 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriter.cs: Wrap a try-catch around block of code to find out
- what exception is being thrown when it shouldn't.
-
-2002-05-07 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Added TestOpen() from Mike Gray.
- * AllTests.cs: Added missing FileTest.Suite as pointed out by Mike
- as well.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs: Change location of sample file. In some places,
- use memory stream instead of file stream to eliminate reliance on file
- io for now. That area is still a bit immature. Added a bunch of
- markers to tell where errors were occuring.
-
- * resources: New directory to hold files open/read, etc. by unit
- tests.
-
-2002-05-01 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs:
- * StreamWriterTest.cs: Catch and display exception info where it wasn't
- being caught before.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * StringReader.cs: Added test for peeking and reading at the end of
- a string.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * MemoryStreamTest.cs
- * StreamWriterTest.cs
- * StringReaderTest.cs: Fix test bugs found by running against mscorlib.
- AssertEquals() requires the expected and atual values to be the same
- type if they are to be considered equal.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * FileTest.cs: Added to CVS. However, this portion of the code
- can't be tested right now.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: removed duplicate MemoryStream test
- * MemoryStreamTest.cs: wrapped try-catch blocks around read/write/seek
- tests. These were throwing exceptions that NUnit wasn't catching. I
- don't think it used to behave this way before .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.IO/FileTest.cs b/mcs/class/corlib/Test/System.IO/FileTest.cs
deleted file mode 100644
index 210e7f6eb85..00000000000
--- a/mcs/class/corlib/Test/System.IO/FileTest.cs
+++ /dev/null
@@ -1,441 +0,0 @@
-//
-// FileTest.cs: Test cases for System.IO.File
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-namespace MonoTests.System.IO
-{
- public class FileTest : TestCase
- {
- public FileTest ()
- : base ("System.IO.File testsuite")
- {
- }
-
- public FileTest (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- protected override void TearDown ()
- {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "baz");
- File.Delete ("resources" + Path.DirectorySeparatorChar + "bar");
- File.Delete ("resources" + Path.DirectorySeparatorChar + "foo");
- }
-
- public static ITest Suite
- {
- get { return new TestSuite (typeof (FileTest)); }
- }
-
- public void TestExists ()
- {
- int i = 0;
- try {
- Assert ("null filename should not exist", !File.Exists (null));
- i++;
- Assert ("empty filename should not exist", !File.Exists (""));
- i++;
- Assert ("whitespace filename should not exist", !File.Exists (" \t\t \t \n\t\n \n"));
- i++;
- Assert ("File resources" + Path.DirectorySeparatorChar + "AFile.txt should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- i++;
- Assert ("File resources" + Path.DirectorySeparatorChar + "doesnotexist should not exist", !File.Exists ("resources" + Path.DirectorySeparatorChar + "doesnotexist"));
- } catch (Exception e) {
- Fail ("Unexpected exception at i = " + i + ". e=" + e);
- }
- }
-
- public void TestCreate ()
- {
- FileStream stream;
-
- /* exception test: File.Create(null) */
- try {
- stream = File.Create (null);
- Fail ("File.Create(null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(null) unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create("") */
- try {
- stream = File.Create ("");
- Fail ("File.Create('') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create('') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create(" ") */
- try {
- stream = File.Create (" ");
- Fail ("File.Create(' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(' ') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create(directory_not_found) */
- try {
- stream = File.Create ("directory_does_not_exist" + Path.DirectorySeparatorChar + "foo");
- Fail ("File.Create(directory_does_not_exist) should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(directory_does_not_exist) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* positive test: create resources/foo */
- try {
- stream = File.Create ("resources" + Path.DirectorySeparatorChar + "foo");
- Assert ("File should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- stream.Close ();
- } catch (Exception e) {
- Fail ("File.Create(resources/foo) unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: repeat test above again to test for overwriting file */
- try {
- stream = File.Create ("resources" + Path.DirectorySeparatorChar + "foo");
- Assert ("File should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- stream.Close ();
- } catch (Exception e) {
- Fail ("File.Create(resources/foo) unexpected exception caught: e=" + e.ToString());
- }
- }
-
- public void TestCopy ()
- {
- /* exception test: File.Copy(null, b) */
- try {
- File.Copy (null, "b");
- Fail ("File.Copy(null, 'b') should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy(null, 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, null) */
- try {
- File.Copy ("a", null);
- Fail ("File.Copy('a', null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', null) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy("", b) */
- try {
- File.Copy ("", "b");
- Fail ("File.Copy('', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, "") */
- try {
- File.Copy ("a", "");
- Fail ("File.Copy('a', '') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', '') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy(" ", b) */
- try {
- File.Copy (" ", "b");
- Fail ("File.Copy(' ', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy(' ', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, " ") */
- try {
- File.Copy ("a", " ");
- Fail ("File.Copy('a', ' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', ' ') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy(doesnotexist, b) */
- try {
- File.Copy ("doesnotexist", "b");
- Fail ("File.Copy('doesnotexist', 'b') should throw FileNotFoundException");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('doesnotexist', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: copy resources/AFile.txt to resources/bar */
- try {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "bar");
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar");
- Assert ("File AFile.txt should still exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- Assert ("File bar should exist after File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- } catch (Exception e) {
- Fail ("#1 File.Copy('resources/AFile.txt', 'resources/bar') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(resources/AFile.txt, resources/bar) (default is overwrite == false) */
- try {
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar");
- Fail ("File.Copy('resources/AFile.txt', 'resources/bar') should throw IOException");
- } catch (IOException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("#2 File.Copy('resources/AFile.txt', 'resources/bar') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* positive test: copy resources/AFile.txt to resources/bar, overwrite */
- try {
- Assert ("File bar should exist before File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar", true);
- Assert ("File AFile.txt should still exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- Assert ("File bar should exist after File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- } catch (Exception e) {
- Fail ("File.Copy('resources/AFile.txt', 'resources/bar', true) unexpected exception caught: e=" + e.ToString());
- }
-
-
- }
-
- public void TestDelete ()
- {
-
- /* exception test: File.Delete(null) */
- try {
- File.Delete (null);
- Fail ("File.Delete(null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(null) unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete("") */
- try {
- File.Delete ("");
- Fail ("File.Delete('') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete('') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete(" ") */
- try {
- File.Delete (" ");
- Fail ("File.Delete(' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(' ') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete(directory_not_found) */
- try {
- File.Delete ("directory_does_not_exist" + Path.DirectorySeparatorChar + "foo");
- Fail ("File.Delete(directory_does_not_exist) should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(directory_does_not_exist) unexpected exception caught: e=" + e.ToString());
- }
-
- if (!File.Exists ("resources" + Path.DirectorySeparatorChar + "foo")) {
- FileStream f = File.Create("resources" + Path.DirectorySeparatorChar + "foo");
- f.Close();
- }
-
- Assert ("File resources" + Path.DirectorySeparatorChar + "foo should exist for TestDelete to succeed", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- try {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "foo");
- } catch (Exception e) {
- Fail ("Unable to delete resources" + Path.DirectorySeparatorChar + "foo: e=" + e.ToString());
- }
- Assert ("File resources" + Path.DirectorySeparatorChar + "foo should not exist after File.Delete", !File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- }
-
-
- public void TestMove ()
- {
- /* exception test: File.Move(null, b) */
- try {
- File.Move (null, "b");
- Fail ("File.Move(null, 'b') should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move(null, 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, null) */
- try {
- File.Move ("a", null);
- Fail ("File.Move('a', null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', null) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move("", b) */
- try {
- File.Move ("", "b");
- Fail ("File.Move('', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, "") */
- try {
- File.Move ("a", "");
- Fail ("File.Move('a', '') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', '') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move(" ", b) */
- try {
- File.Move (" ", "b");
- Fail ("File.Move(' ', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move(' ', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, " ") */
- try {
- File.Move ("a", " ");
- Fail ("File.Move('a', ' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', ' ') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move(doesnotexist, b) */
- try {
- File.Move ("doesnotexist", "b");
- Fail ("File.Move('doesnotexist', 'b') should throw FileNotFoundException");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(resources/foo, doesnotexist/b) */
- File.Copy("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "foo", true);
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "doesnotexist" + Path.DirectorySeparatorChar + "b");
- Fail ("File.Move('resources/foo', 'b') should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (FileNotFoundException) {
- // LAMESPEC
- // do nothing, this is (kind of) what we expect
- } catch (Exception e) {
- Fail ("File.Move('resources/foo', 'doesnotexist/b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(doesnotexist/foo, b) */
- try {
- File.Move ("doesnotexist" + Path.DirectorySeparatorChar + "foo", "b");
- Fail ("File.Move('doesnotexist/foo', 'b') should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (FileNotFoundException) {
- // LAMESPEC
- // do nothing, this is (kind of) what we expect
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist/foo', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(resources/foo, resources) */
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "resources");
- Fail ("File.Move('resources/foo', 'resources') should throw IOException");
- } catch (IOException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('resources/foo', 'resources') unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: File.Move(a, a) shouldn't throw exception */
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "resources" + Path.DirectorySeparatorChar + "foo");
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist/foo', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- if (!File.Exists ("resources" + Path.DirectorySeparatorChar + "bar")) {
- FileStream f = File.Create("resources" + Path.DirectorySeparatorChar + "bar");
- f.Close();
- }
-
- Assert ("File resources" + Path.DirectorySeparatorChar + "bar should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- File.Move ("resources" + Path.DirectorySeparatorChar + "bar", "resources" + Path.DirectorySeparatorChar + "baz");
- Assert ("File resources" + Path.DirectorySeparatorChar + "bar should not exist", !File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- Assert ("File resources" + Path.DirectorySeparatorChar + "baz should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "baz"));
- }
-
- public void TestOpen ()
- {
- try {
- FileStream stream = File.Open ("resources" + Path.DirectorySeparatorChar + "AFile.txt", FileMode.Open);
- } catch (Exception e) {
- Fail ("Unable to open resources" + Path.DirectorySeparatorChar + "AFile.txt: e=" + e.ToString());
- }
-
- /* Exception tests */
- try {
- FileStream stream = File.Open ("filedoesnotexist", FileMode.Open);
- Fail ("File 'filedoesnotexist' should not exist");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("Unexpect exception caught: e=" + e.ToString());
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs b/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
deleted file mode 100644
index c9ff831877d..00000000000
--- a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Add some testing for the CanXXX properties, exceptions,
-// various different constructors.
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class MemoryStreamTest : TestCase {
-
- private MemoryStream testStream;
- private byte[] testStreamData;
-
- public MemoryStreamTest() : base ("MonoTests.System.IO.MemoryStream testcase") { }
- public MemoryStreamTest( string name ): base(name) { }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MemoryStreamTest));
- }
- }
-
- protected override void SetUp() {
- testStreamData = new byte[100];
-
- for( int i = 0; i < 100; i++ ) {
- testStreamData[i] = (byte)(100 - i);
- }
-
- testStream = new MemoryStream( testStreamData );
- }
-
- //
- // Verify that the first count bytes in testBytes are the same as
- // the count bytes from index start in testStreamData
- //
- private void VerifyTestData( byte[] testBytes, int start, int count) {
- if( testBytes == null ) {
- throw new ArgumentNullException();
- } else if( ( start < 0 || count < 0 ) || start + count > testStreamData.Length || start > testStreamData.Length ) {
- throw new ArgumentOutOfRangeException();
- }
-
- for( int test = 0; test < count; test++ ) {
- if( testBytes[ test ] != testStreamData[ start + test ] ) {
- string failStr = String.Format( "testByte {0} (testStream {1}) was <{2}>, expecting <{3}>", test, start+test,
- testBytes[ test ], testStreamData[ start+test] );
- Fail( failStr );
- }
- }
- }
-
- public void TestConstructors() {
- MemoryStream ms = new MemoryStream();
-
- AssertEquals("A1", 0L, ms.Length );
- AssertEquals("A2", 0, ms.Capacity );
- AssertEquals("A3", true, ms.CanWrite );
-
- ms = new MemoryStream( 10 );
-
- AssertEquals("A4", 0L, ms.Length );
- AssertEquals("A5", 10, ms.Capacity );
- }
-
- public void TestRead() {
- byte[] readBytes = new byte[20];
-
- try {
- /* Test simple read */
- testStream.Read( readBytes, 0, 10 );
- VerifyTestData( readBytes, 0, 10 );
-
- /* Seek back to beginning */
-
- testStream.Seek( 0, SeekOrigin.Begin );
-
- /* Read again, bit more this time */
- testStream.Read( readBytes, 0, 20 );
- VerifyTestData( readBytes, 0, 20 );
-
- /* Seek to 20 bytes from End */
- testStream.Seek( -20, SeekOrigin.End );
- testStream.Read( readBytes, 0, 20);
- VerifyTestData( readBytes, 80, 20);
-
- int readByte = testStream.ReadByte();
- AssertEquals( -1, readByte );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBytes() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- for( int i = 0; i < 100; i++ ) {
- ms.WriteByte( testStreamData[i] );
- }
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBlock() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- ms.Write( testStreamData, 0, 100 );
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
-
- byte[] arrayBytes = testStream.ToArray();
-
- VerifyTestData( arrayBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/PathTest.cs b/mcs/class/corlib/Test/System.IO/PathTest.cs
deleted file mode 100644
index 2fd2c6da186..00000000000
--- a/mcs/class/corlib/Test/System.IO/PathTest.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// System.IO.Path Test Cases
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add a more thorough workout for some
-// of the "trickier" functions.
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class PathTest : TestCase {
-
- string path1;
- string path2;
- string path3;
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(PathTest));
- }
- }
-
- public PathTest() : base ("MonoTests.System.IO.PathTest testcase") { }
- public PathTest( string name ): base(name) { }
-
- protected override void SetUp() {
- if ('/' == Path.VolumeSeparatorChar){
- path1 = "/foo/test.txt";
- path2 = "/etc";
- path3 = "init.d";
- } else {
- path1 = "c:\\foo\\test.txt";
- path2 = "c:\\winnt";
- path3 = "system32";
- }
-
- // For Mac. Figure this out when we need it
- //path1 = "foo:test.txt";
- //path2 = "foo";
- //path3 = "bar";
- }
-
-
- public void TestChangeExtension() {
- string testPath = Path.ChangeExtension( path1, "doc" );
-
- #if WINDOWS
- AssertEquals( "c:\\foo\\test.doc", testPath );
- #elif UNIX
- AssertEquals( "/foo/test.doc", testPath );
- #elif MAC
- AssertEquals( "foo:test.doc", testPath );
- #endif
- }
-
- public void TestCombine() {
- string testPath = Path.Combine( path2, path3 );
-
- #if WINDOWS
- AssertEquals( "c:\\winnt\\system32", testPath );
- #elif UNIX
- AssertEquals( "/etc/init.d", testPath );
- #elif MAC
- AssertEquals( "foo:bar", testPath );
- #endif
- }
-
- public void TestDirectoryName() {
- string testDirName = Path.GetDirectoryName( path1 );
-
- #if WINDOWS
- AssertEquals( "c:\\foo", testDirName );
- #elif UNIX
- AssertEquals( "/etc", testDirName );
- #elif MAC
- AssertEquals( "foo", testDirName );
- #endif
- }
-
- public void TestGetExtension() {
- string testExtn = Path.GetExtension( path1 );
-
- AssertEquals( ".txt", testExtn );
-
- testExtn = Path.GetExtension( path2 );
-
- AssertEquals ( "", testExtn );
- }
-
- public void TestGetFileName() {
- string testFileName = Path.GetFileName( path1 );
-
- AssertEquals( "test.txt", testFileName );
- }
-
- public void TestGetFileNameWithoutExtension() {
- string testFileName = Path.GetFileNameWithoutExtension( path1 );
-
- AssertEquals( "test", testFileName );
- }
-
- public void TestGetFullPath() {
- string testFullPath = Path.GetFullPath( "foo.txt" );
- // AssertEquals( "foo.txt", testFullPath );
- }
-
- public void TestGetTempPath() {
- string getTempPath = Path.GetTempPath();
- Assert ("Temp Path should not be empty", getTempPath != String.Empty);
- }
-
- public void TestGetTempFileName() {
- string getTempFileName = "";
- try {
- getTempFileName = Path.GetTempFileName();
- Assert ("Temp file name should not be empty", getTempFileName != String.Empty);
- Assert ("File should exist", File.Exists(getTempFileName));
- } finally {
- if (getTempFileName != null && getTempFileName != String.Empty){
- File.Delete(getTempFileName);
- }
- }
- }
-
- public void TestHasExtension() {
- AssertEquals( true, Path.HasExtension( "foo.txt" ) );
- AssertEquals( false, Path.HasExtension( "foo" ) );
- AssertEquals( true, Path.HasExtension( path1 ) );
- AssertEquals( false, Path.HasExtension( path2 ) );
- }
-
- public void TestRooted() {
- Assert ("Path should be rooted", Path.IsPathRooted(path2));
- Assert ("Path should NOT be rooted", !Path.IsPathRooted(path3));
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs b/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
deleted file mode 100644
index 5a07d426ccc..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
+++ /dev/null
@@ -1,558 +0,0 @@
-// StreamReaderTest.cs - NUnit Test Cases for the SystemIO.StreamReader class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamReaderTest : TestCase
-{
- public StreamReaderTest() :
- base ("MonoTests.System.StreamReaderTest testsuite") {}
- public StreamReaderTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamReaderTest));
- }
- }
-
- private string _codeFileName = "resources" + Path.DirectorySeparatorChar + "AFile.txt";
-
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("");
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile");
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null stream error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, false);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, true);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor4() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", false);
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", true);
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 8: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 9: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 10: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
-
- // TODO - Ctor with Encoding
-
- public void TestBaseStream() {
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("wrong base stream ", m, r.BaseStream);
- r.Close();
- m.Close();
- } catch (Exception e) {
- Fail ("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCurrentEncoding() {
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("wrong encoding",
- Encoding.UTF8, r.CurrentEncoding);
- } catch (Exception e) {
- Fail ("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- // TODO - Close - annoying spec - won't commit to any exceptions. How to test?
- // TODO - DiscardBufferedData - I have no clue how to test this function.
-
- public void TestPeek() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Peek();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- }
- Assert("nothing-to-peek-at error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("peek incorrect", i, r.Peek());
- r.Read();
- }
- AssertEquals("should be none left", -1, r.Peek());
- }
- }
-
- public void TestRead() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Read();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("nothing-to-read error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("read incorrect", i, r.Read());
- }
- AssertEquals("Should be none left", -1, r.Read());
- }
-
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- r.Read(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null buffer error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("too-long range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, -1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- int ii = 1;
- try {
- Byte[] b = {(byte)'a', (byte)'b', (byte)'c',
- (byte)'d', (byte)'e', (byte)'f',
- (byte)'g'};
- MemoryStream m = new MemoryStream(b);
- ii++;
- StreamReader r = new StreamReader(m);
- ii++;
-
- char[] buffer = new Char[7];
- ii++;
- char[] target = {'g','d','e','f','b','c','a'};
- ii++;
- r.Read(buffer, 6, 1);
- ii++;
- r.Read(buffer, 4, 2);
- ii++;
- r.Read(buffer, 1, 3);
- ii++;
- r.Read(buffer, 0, 1);
- ii++;
- for (int i = 0; i < target.Length; i++) {
- AssertEquals("read no work",
- target[i], buffer[i]);
- i++;
- }
-
- } catch (Exception e) {
- Fail ("Caught when ii=" + ii + ". e:" + e.ToString());
- }
- }
- }
-
- public void TestReadLine() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a", r.ReadLine());
- AssertEquals("line doesn't match", "b", r.ReadLine());
- AssertEquals("line doesn't match", "c", r.ReadLine());
- AssertEquals("line doesn't match", "d", r.ReadLine());
- AssertEquals("line doesn't match", null, r.ReadLine());
- }
-
- public void TestReadToEnd() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a\nb\nc\nd\n", r.ReadToEnd());
- AssertEquals("line doesn't match", "", r.ReadToEnd());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs b/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
deleted file mode 100644
index 232f1cfbc33..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
+++ /dev/null
@@ -1,353 +0,0 @@
-// StreamWriterTest.cs - NUnit Test Cases for the SystemIO.StreamWriter class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamWriterTest : TestCase
-{
- public StreamWriterTest() :
- base ("MonoTests.System.StreamWriterTest testsuite") {}
- public StreamWriterTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamWriterTest));
- }
- }
-
- private string _codeFileName = "StreamWriterTest.temp";
- private string _thisCodeFileName = "resources" + Path.DirectorySeparatorChar + "AFile.txt";
-
- // TODO - ctors
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_thisCodeFileName,
- FileMode.Open,
- FileAccess.Read);
- try {
- StreamWriter r = new StreamWriter(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertNotNull("no stream writer", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("");
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("1 invalid filename error not thrown", errorThrown);
- }
- // TODO - Security/Auth exceptions
- {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("2 invalid filename error not thrown", errorThrown);
- }
- {
- StreamWriter r = new StreamWriter(_codeFileName, false);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 8: " + e.ToString());
- }
- Assert("3 invalid filename error not thrown", errorThrown);
- }
- {
- try {
- StreamWriter r = new StreamWriter(_codeFileName, true);
- AssertNotNull("no stream writer", r);
- r.Close();
- } catch (Exception e) {
- Fail ("Unxpected exception e=" + e.ToString());
- }
- }
- }
-
- // TODO - ctors with Encoding
-
- // TODO - AutoFlush
- public void TestAutoFlush() {
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = false;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = true;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be something before flush",
- 4L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- }
-
- public void TestBaseStream() {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertEquals("wrong base stream ", f, r.BaseStream);
- r.Close();
- f.Close();
- }
-
- public void TestEncoding() {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertEquals("wrong encoding",
- Encoding.UTF8.GetType(), r.Encoding.GetType());
- r.Close();
- }
-
- // TODO - Close - not entirely sure how to test Close
- //public void TestClose() {
- //{
- //MemoryStream m = new MemoryStream();
- //StreamWriter w = new StreamWriter(m);
- //StreamReader r = new StreamReader(m);
- //w.Write(1);
- //w.Write(2);
- //w.Write(3);
- //w.Write(4);
- //AssertEquals("Should be nothing before close",
- //0, m.Length);
- //AssertEquals("Should be nothing in reader",
- //-1, r.Peek());
- //w.Close();
- //AssertEquals("Should be something after close",
- //1, r.Peek());
- //}
- //}
-
- // TODO - Flush
- public void TestFlush() {
- {
- bool errorThrown = false;
- try {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- r.Close();
- r.Flush();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("can't flush closed error not thrown", errorThrown);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- }
-
- // TODO - Write - test errors, functionality tested in TestFlush.
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs b/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
deleted file mode 100644
index 3391379baf7..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Some of the tests could be a bit more thorough
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-
-namespace MonoTests.System.IO {
-
-public class StringReaderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringReaderTest));
- }
- }
-
- public StringReaderTest() : base ("MonoTests.System.IO.StringReaderTest testcase") { }
- public StringReaderTest( string name ): base(name) { }
-
- public void TestReadLine() {
- string testme = "a\nb\nc\n";
- StringReader sr = new StringReader (testme);
- string inputLine;
- int lines = 0;
- while ((inputLine = sr.ReadLine ()) != null)
- lines++;
-
- AssertEquals ("Incorrect number of lines", 3, lines);
- }
-
- public void TestPeekRead() {
- StringReader reader = new StringReader( "Test String" );
-
- char c = (char)reader.Peek();
- AssertEquals("A1", 'T', c );
-
- char read = (char)reader.Read();
-
- AssertEquals("A2", 'T', read );
-
- c = (char)reader.Peek();
-
- AssertEquals("A3", 'e', c );
- }
-
- public void TestPeekAndReadAtEndOfString() {
- StringReader reader = new StringReader("x");
-
- char c = (char)reader.Peek();
- AssertEquals("A1", 'x', c );
-
- c = (char)reader.Read();
- AssertEquals("A2", 'x', c);
-
- int i = reader.Peek();
- AssertEquals("A3", -1, i);
-
- i = reader.Read();
- AssertEquals("A4", -1, i);
-
- i = reader.Peek();
- AssertEquals("A5", -1, i);
- }
-
- public void TestPeekAndReadEmptyString() {
- StringReader reader = new StringReader("");
-
- int i = reader.Peek();
- AssertEquals("A1", -1, i);
-
- i = reader.Read();
- AssertEquals("A2", -1, i);
- }
-
- public void TestRead() {
- StringReader reader = new StringReader( "Test String" );
-
- /* Read from start of string */
- char[] test = new char[5];
-
- int charsRead = reader.Read( test, 0, 5 );
-
- AssertEquals( 5, charsRead );
- AssertEquals( "Test ", new String(test) );
-
- /* Read to end of string */
- //reader = new StringReader( "Test String" );
-
- test = new char[6];
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 6, charsRead);
- AssertEquals( "String", new String( test ) );
-
- /* Read past end of string */
-
- test = new char[6];
- reader = new StringReader( "Foo" );
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 3, charsRead );
- AssertEquals( "Foo\0\0\0", new String( test ) );
-
- }
-
- public void TestReadEOL() {
- StringReader reader = new StringReader( "Line1\rLine2\r\nLine3\nLine4" );
-
- string test = reader.ReadLine();
-
- AssertEquals( "Line1", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line2", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line3", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line4", test );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs b/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
deleted file mode 100644
index bf254ace832..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO {
-
-public class StringWriterTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringWriterTest));
- }
- }
-
- public StringWriterTest() : base ("MonoTests.System.IO.StringWriterTest testcase") { }
- public StringWriterTest( string name ): base(name) { }
-
- public void TestConstructors() {
- StringBuilder sb = new StringBuilder("Test String");
-
- StringWriter writer = new StringWriter( sb );
- AssertEquals( sb, writer.GetStringBuilder() );
- }
-
- public void TestWrite() {
- StringWriter writer = new StringWriter();
-
- AssertEquals( String.Empty, writer.ToString() );
-
- writer.Write( 'A' );
- AssertEquals( "A", writer.ToString() );
-
- writer.Write( " foo" );
- AssertEquals( "A foo", writer.ToString() );
-
-
- char[] testBuffer = "Test String".ToCharArray();
-
- writer.Write( testBuffer, 0, 4 );
- AssertEquals( "A fooTest", writer.ToString() );
-
- writer.Write( testBuffer, 5, 6 );
- AssertEquals( "A fooTestString", writer.ToString() );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Resources/AllTests.cs b/mcs/class/corlib/Test/System.Resources/AllTests.cs
deleted file mode 100644
index 66bbb159c4a..00000000000
--- a/mcs/class/corlib/Test/System.Resources/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// MonoTests.System.Resources.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
-//FIXME: ResourceReader is not ready yet.
-// suite.AddTest(ResourceReaderTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Resources/ChangeLog b/mcs/class/corlib/Test/System.Resources/ChangeLog
deleted file mode 100644
index 538c52e81d3..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ChangeLog
+++ /dev/null
@@ -1,26 +0,0 @@
-2002/06/14 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Disable ResourceReaderTest for now. The class is not
- ready yet.
-
-2002-05-22 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Fix path name to resource files (again).
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Fix path name to resource files
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs:
- * Empty.resources:
- * MyResources.resources: Added files
- * ResourceReaderTest.cs: Test the enumerator
-
-2002-01-24 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Add new file. This test is not done yet.
- Wanted to save it in cvs for 'disaster recovery' purposes.
- Just in case.
-
diff --git a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs b/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
deleted file mode 100644
index 9fc95af4f1e..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// MonoTests.System.Resources.ResourceReaderTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-
-using System;
-using System.Resources;
-using System.IO;
-
-using System.Collections;
-using MonoTests.System.Resources;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
-
- public class ResourceReaderTest : TestCase {
- private static string m_ResourceFile = "resources" + Path.DirectorySeparatorChar + "MyResources.resources";
- private static string m_BadResourceFile = "resources" + Path.DirectorySeparatorChar + "Empty.resources";
-
- public ResourceReaderTest() : base ("MonoTests.System.Resources.ResourceReaderTest testcase") { }
- public ResourceReaderTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ResourceReaderTest));
- }
- }
-
- protected override void SetUp() {
- }
-
- public void TestConstructorStringExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((String)null);
- Fail("Should throw exception on null");
- } catch{}
- try {
- r = new ResourceReader("");
- Fail("Should throw exception on empty path");
- } catch{}
- try {
- // use a file name that is *very* unlikely to exsist
- r = new ResourceReader("j38f8axvnn9h38hfa9nxn93f8hav4zvag87vvah32o");
- Fail("Should throw exception on file not found");
- } catch{}
- try {
- r = new ResourceReader(m_BadResourceFile);
- Fail("Should throw exception on bad resource file");
- }
- catch {}
- }
-
- public void TestConstructorString() {
- if (!File.Exists(m_ResourceFile)) {
- Fail("Resource file is not where it should be:" + Directory.GetCurrentDirectory()+ "\\" + m_ResourceFile);
- }
- ResourceReader r = null;
- try {
- r = new ResourceReader(m_ResourceFile);
- }
- catch {
- Fail("Should have been able to open resource file.");
- }
- finally {
- if (null != r)
- r.Close();
- }
- Assert("String constructor should not be null", null != r);
- }
-
- public void TestConstructorStreamExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((Stream)null);
- Fail("Should throw exception on null");
- } catch{}
-
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- stream.Close();
- r = new ResourceReader(stream);
- Fail("Should throw exception on cannot read");
- } catch{}
- }
-
- public void TestStream(){
- ResourceReader r = null;
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- }
- catch{
- Fail("Should not throw exception constructing from stream");
- }
- finally {
- if (null != r) {
- r.Close();
- }
- }
- }
-
- public void TestClose() {
- ResourceReader r = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- r.Close();
- try {
- stream = new FileStream (m_ResourceFile, FileMode.Open);
- }
- catch{
- Fail("Should be able to open the stream again after close");
- }
- finally {
- if (null != stream) {
- stream.Close();
- }
- }
- }
-
- public void TestEnumerator(){
- ResourceReader reader = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- reader = new ResourceReader(stream);
- IDictionaryEnumerator en = reader.GetEnumerator();
- // Goes through the enumerator, printing out the key and value pairs.
- while (en.MoveNext()) {
- DictionaryEntry de = (DictionaryEntry)en.Current;
- Assert("Current.Key should not be empty",String.Empty != (string)de.Key);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Entry.Key should not be empty",String.Empty != (string)en.Key);
- Assert("Entry.Value should not be empty",String.Empty != (string)en.Value);
- }
- reader.Close();
- }
- } // class ResourceReaderTest
-} // namespace MonoTests.System.Resources \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs b/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs
deleted file mode 100644
index 8ec0e278803..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// MonoTests.System.Runtime.Serialization.AllTests
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization {
- public class AllTests : TestCase
- {
- public AllTests (string name) : base(name) {}
-
- public static ITest Suite
- {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest(ObjectIDGeneratorTests.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog b/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog
deleted file mode 100644
index 9e051847759..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * AllTests.cs: New file to make 'make test' work.
- * ChangeLog: New file.
-
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs b/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs
deleted file mode 100755
index fc53fe9234a..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// System.Runtime.Serialization.ObjectIDGeneratorTests.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization
-{
- public class ObjectIDGeneratorTests : TestCase
- {
- ObjectIDGenerator generator;
-
- string obj1 = "obj1";
- int obj2 = 42;
- long id;
-
- public static ITest Suite {
- get { return new TestSuite (typeof (ObjectIDGeneratorTests)); }
- }
-
- public ObjectIDGeneratorTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- generator = new ObjectIDGenerator ();
- }
-
- //
- // Tests adding an ID for a new object
- //
- public void TestGetId1 ()
- {
- bool testBool1;
- id = generator.GetId (obj1, out testBool1);
-
- AssertEquals ("A1", 1L, id); // should start at 1
- AssertEquals ("A2", true, testBool1); // firstTime should be true
- }
-
- //
- // Tests getting the ID for an existing object
- //
- public void TestGetId2 ()
- {
- bool testBool1;
- bool testBool2;
- id = generator.GetId (obj1, out testBool1);
- long testId1 = generator.GetId (obj1, out testBool2);
-
- AssertEquals ("B1", testId1, id); // same object, same ID
- AssertEquals ("B2", false, testBool2); // no longer firstTime
- }
-
- //
- // Tests getting the ID for an existing object
- //
- public void TestHasId1 ()
- {
- bool testBool1;
- bool testBool3;
- id = generator.GetId (obj1, out testBool1);
- long testId2 = generator.HasId (obj1, out testBool3);
-
- AssertEquals ("C1", false, testBool3); // this has been inserted before
- AssertEquals ("C2", id, testId2); // we should get the same ID
- }
-
- //
- // Tests getting the ID for a non-existent object
- //
- public void TestHasId2 ()
- {
- bool testBool4;
- long testId3 = generator.HasId (obj2, out testBool4);
-
- AssertEquals ("D1", 0L, testId3);
- AssertEquals ("D2", true, testBool4);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
deleted file mode 100644
index 90edff9d031..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AllCryptoTests.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
- /// <summary>
- /// Combines all available crypto unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(SymmetricAlgorithmTest.Suite);
- suite.AddTest(AsymmetricAlgorithmTest.Suite);
- suite.AddTest(RNGCryptoServiceProviderTest.Suite);
- suite.AddTest(FromBase64TransformTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
deleted file mode 100755
index 37da7bf16fe..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AsymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class AsymmetricAlgorithmTest : TestCase {
- private AsymmetricAlgorithm _algo;
-
- public AsymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.AsymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public AsymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(AsymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = AsymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (2)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs b/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs
deleted file mode 100755
index 34a7612e80f..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.FromBase64Transform.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Cryptography;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class FromBase64TransformTest : TestCase {
- private FromBase64Transform _algo;
-
- public FromBase64TransformTest() : base ("MonoTests.System.Security.Cryptography.FromBase64Transform testcase") {
- _algo = null;
- }
- public FromBase64TransformTest(String name) : base(name)
- {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(FromBase64TransformTest));
- }
- }
-
- protected override void SetUp() {
- _algo = new FromBase64Transform ();
- }
-
- protected void TransformFinalBlock (string name, byte[] input, byte[] expected,
- int inputOffset, int inputCount)
- {
- byte[] output = _algo.TransformFinalBlock (input, inputOffset, inputCount);
-
- AssertEquals (name, expected.Length, output.Length);
- for (int i = 0; i < expected.Length; i++)
- AssertEquals (name + "(" + i + ")", expected [i], output [i]);
- }
-
- protected void TransformFinalBlock (string name, byte[] input, byte[] expected)
- {
- TransformFinalBlock (name, input, expected, 0, input.Length);
- }
-
- public void TestFinalBlock ()
- {
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 110, 69 };
- byte[] expected = { 174, 90, 123, 66, 201, 196 };
-
- TransformFinalBlock ("#A1", input, expected);
- }
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 61, 61 };
- byte[] expected = { 174, 90, 123, 66 };
-
- TransformFinalBlock ("#A2", input, expected);
- }
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 61, 61 };
- byte[] expected = { 150, 158, 208 };
-
- TransformFinalBlock ("#A3", input, expected, 1, 5);
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
deleted file mode 100644
index f9d16d58df1..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
-//
-// Author:
-// Mark Crichton (crichton@gimp.org)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class RNGCryptoServiceProviderTest : TestCase {
- private RNGCryptoServiceProvider _algo;
-
- public RNGCryptoServiceProviderTest() : base ("MonoTests.System.Security.Cryptography.RNGCryptoServiceProviderTest testcase") {
- _algo = null;
- }
- public RNGCryptoServiceProviderTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RNGCryptoServiceProviderTest));
- }
- }
-
- protected override void SetUp() {
- _algo = new RNGCryptoServiceProvider();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- byte[] random = new Byte[25];
-
- // The C code doesn't throw an exception yet.
- _algo.GetBytes(random);
-
- // This one we can check...
- _algo.GetNonZeroBytes(random);
-
- foreach (Byte rnd_byte in random) {
- Assert("Properties (2)", rnd_byte != 0);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
deleted file mode 100755
index 0c4c8786925..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.SymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class SymmetricAlgorithmTest : TestCase {
- private SymmetricAlgorithm _algo;
-
- public SymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.SymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public SymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = SymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try
- {
- // try setting an illegal blocksize -> must throw an exception
- _algo.BlockSize = 12;
- } catch (CryptographicException) {thrown = true;}
- Assert("Properties (2)", thrown);
-
- byte[] key = _algo.Key;
- Assert("Properties (3)", key != null);
-
- thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (4)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs b/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
deleted file mode 100644
index 95782000656..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(FileIOPermissionTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog b/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
deleted file mode 100644
index 16d10adaf53..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2002-06-18 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: Use Unix paths if it looks like we are not
- running the tests on Windows. Need to expand this when we run the
- tests on Mac OS's (and others I suppose). Also consolidated some
- redundant code.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: Remove intersect test where it was trying
- to intersect a permission with itself. This throws an exception
- with mscorlib.
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: New File.
- * AllTests.cs: New File.
-
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
deleted file mode 100644
index e4df95d0fd6..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
+++ /dev/null
@@ -1,297 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.FileIOPermissionTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak II
-//
-// Note: Only Unix and Windows file paths are tested. To run the tests on Mac OS's
-// search for the "FIXME" notes below and adjust accordingly.
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-using System.IO;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
-
- public class FileIOPermissionTest : TestCase {
-
- public FileIOPermissionTest() : base ("MonoTests.System.Security.Permissions.FileIOPermissionTest testcase") { }
- public FileIOPermissionTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(FileIOPermissionTest));
- }
- }
-
- string[] pathArrayGood;
- string[] pathArrayBad;
- FileIOPermission p;
- FileIOPermission p2;
- string[] pathsInPermission;
- string[] pathArrayGood2;
- FileIOPermission unrestricted;
-
- protected override void SetUp() {
- p = null;
- pathsInPermission = null;
- pathArrayGood = new string[2];
- pathArrayBad = new string[2];
- pathArrayGood2 = new string[3];
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':') {
- pathArrayGood[0] = "c:\\temp1";
- pathArrayGood[1] = "d:\\temp2";
- pathArrayBad[0] = "c:\\temp1";
- pathArrayBad[1] = "d:\\temp*";
- pathArrayGood2[0] = "c:\\temp1";
- pathArrayGood2[1] = "d:\\temp2";
- pathArrayGood2[2] = "z:\\something";
- }
- else {
- pathArrayGood[0] = "/temp1";
- pathArrayGood[1] = "/usr/temp2";
- pathArrayBad[0] = "/temp1";
- pathArrayBad[1] = "/usr/temp*";
- pathArrayGood2[0] = "/temp1";
- pathArrayGood2[1] = "/usr/temp2";
- pathArrayGood2[2] = "/usr/bin/something";
- }
- }
-
- private void SetDefaultData() {
- }
-
- public void TestConstructorPermissionState() {
- p = new FileIOPermission(PermissionState.None);
- AssertEquals("Should be Restricted", false, p.IsUnrestricted());
- p = new FileIOPermission(PermissionState.Unrestricted);
- AssertEquals("Should be Unrestricted", true, p.IsUnrestricted());
- try{
- p = new FileIOPermission((PermissionState)77);
- Fail("Should have thrown an exception on invalid PermissionState");
- }
- catch{
- // we should be here if things are working. nothing to do
- }
- }
-
- public void TestConstructorString() {
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "this path is not rooted");
- Fail("Should have thrown an exception on path not rooted");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "<this is not a valid path>");
- Fail("Should have thrown an exception on invalid characters in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "\\\\mycomputer\\test*");
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, "c:\\temp");
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- string pathToAdd;
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':')
- pathToAdd = "c:\\temp";
- else
- pathToAdd = "/temp";
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathToAdd);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 1 but got: "+pathsInPermission.Length, pathsInPermission.Length == 1);
- Assert("Does not contain expected path from constructor: "+pathToAdd, pathsInPermission[0] == pathToAdd);
- }
-
- public void TestConstructorStringArray() {
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayBad);
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, pathArrayGood);
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- }
-
- public void TestAddPathListStringArray() {
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- p.AddPathList(FileIOPermissionAccess.Append, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should still contain correct number Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Append);
- Assert("Should contain correct number of Append paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- }
-
- public void TestIntersect() {
- FileIOPermission intersection;
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
-
- intersection = (FileIOPermission)p.Intersect(unrestricted);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- intersection = (FileIOPermission)unrestricted.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- intersection = (FileIOPermission)p.Intersect(p2);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- AssertNotNull ("Should have some paths", pathsInPermission);
- AssertEquals ("Should contain correct number of Read paths", 2, pathsInPermission.Length);
- AssertEquals ("Should have only Append bit in AllFiles.", FileIOPermissionAccess.Append, intersection.AllFiles);
- AssertEquals ("Should have only Write bit in AllLocalFiles.", FileIOPermissionAccess.Write, intersection.AllLocalFiles);
-
- intersection = (FileIOPermission)p2.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have only Append bit in AllFiles.", intersection.AllFiles == FileIOPermissionAccess.Append);
- Assert("Should have only Write bit in AllLocalFiles.", intersection.AllLocalFiles == FileIOPermissionAccess.Write);
- }
-
- public void TestIsSubsetOf() {
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- Assert("IsSubsetOf reflective test failed", unrestricted.IsSubsetOf(unrestricted));
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
- Assert("#1 IsSubsetOf reflective test failed", p.IsSubsetOf(p));
- Assert("#1 IsSubsetOf false test failed", !unrestricted.IsSubsetOf(p));
- Assert("#1 IsSubsetOf true test failed", p.IsSubsetOf(unrestricted));
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- Assert("#2 IsSubsetOf reflective test failed", p2.IsSubsetOf(p2));
- Assert("#2 IsSubsetOf true test failed", p.IsSubsetOf(p2));
- Assert("#2 IsSubsetOf false test failed", !p2.IsSubsetOf(p));
- }
-
- public void TestUnion() {
- FileIOPermission union;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- union = (FileIOPermission)unrestricted.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- union = (FileIOPermission)p.Union(unrestricted);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayGood2);
-
- union = (FileIOPermission)p.Union(p2);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
-
- union = (FileIOPermission)p2.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
- }
-
- public void TestFromXML() {
- p = new FileIOPermission(PermissionState.None);
- SecurityElement esd;
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- esd.AddAttribute("Unrestricted", "true");
- p.FromXml(esd);
- Assert("Should get an unrestricted permission", p.IsUnrestricted());
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':') {
- esd.AddAttribute("Read", "c:\\temp;d:\\temp2");
- esd.AddAttribute("Write", "c:\\temp;d:\\temp2;z:\\temp3");
- }
- else {
- esd.AddAttribute("Read", "/temp;/usr/temp2");
- esd.AddAttribute("Write", "/temp;/usr/temp2;/usr/bin/temp3");
- }
- p = new FileIOPermission(PermissionState.None);
- p.FromXml(esd);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Write);
- Assert("Path list should have 2 for Write", pathsInPermission.Length == 3);
- }
-
- public void TestToXML() {
- SecurityElement esd;
- string read;
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- esd = p.ToXml();
- Assert("Esd tag incorrect", esd.Tag == "IPermission");
- Assert("Esd version incorrect", (String)esd.Attributes["version"] == "1");
- read = (String)esd.Attributes["Read"];
- pathsInPermission = read.Split(';');
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs b/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
deleted file mode 100644
index a0632fdd70c..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Policy.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Policy {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(CodeGroupTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog b/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
deleted file mode 100644
index 51b9aae2eab..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
+++ /dev/null
@@ -1,15 +0,0 @@
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add new file.
-
-2002-02-07 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Tests everything except the (To|From)Xml methods.
-
-2002-02-01 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Still not done, checking in now just in case
-
-2002-01-30 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: New File. Not done, but checking in now just in case \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs b/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
deleted file mode 100644
index 73415017c3d..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// MonoTests.System.Security.Policy.CodeGroupTest
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using NUnit.Framework;
-using System;
-using System.Security;
-using System.Security.Policy;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Security.Policy
-{
-
- public class CodeGroupTest : TestCase
- {
-
- public CodeGroupTest( string name ): base(name)
- {
- }
-
- public CodeGroupTest() : base("CodeGroupTest")
- {
- }
-
- public static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(CodeGroupTest));
- }
- }
-
- protected override void SetUp()
- {
- }
-
- public class MyCodeGroup : CodeGroup
- {
- public MyCodeGroup(IMembershipCondition membershipCondition,
- PolicyStatement policy) :base(membershipCondition, policy)
- {
- }
-
- public override CodeGroup Copy()
- {
- return this;
- }
-
- public override string MergeLogic
- {
- get
- {
- return "";
- }
- }
-
- public override PolicyStatement Resolve( Evidence evidence)
- {
- return (PolicyStatement)null;
- }
-
- public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
- {
- return this;
- }
- }
-
- public void TestConstructorExceptions()
- {
- MyCodeGroup cg;
- try
- {
- cg = new MyCodeGroup(null, null);
- Fail("Constructor should throw exception on null paramters");
- }
- catch(Exception e)
- {
- Assert("Should have caught an ArgumentNull Exception", e is ArgumentNullException);
- }
- }
-
- public void TestConstructor()
- {
- MyCodeGroup cg = null;
- try
- {
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- Assert("PolicyStatement property not set correctly by constructor.", cg.PolicyStatement != null);
- Assert("MembershipCondition property not set correctly by constructor.", cg.MembershipCondition != null);
- }
- catch(Exception e)
- {
- Fail("Constructor failed. Exception caught was: " + e.ToString());
- }
- }
-
- public void TestDescriptionProperty()
- {
- MyCodeGroup cg = null;
- const string description = "Test Description";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Description = description;
- Assert("Description not the expected value", cg.Description == description);
- }
-
- public void TestNameProperty()
- {
- MyCodeGroup cg = null;
- const string name = "Test Name";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Name = name;
- Assert("Description not the expected value", cg.Name == name);
- }
-
- public void TestChildren()
- {
- MyCodeGroup cg = null;
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.AddChild(new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.Unrestricted))));
- Assert("Unexpected number of children", cg.Children.Count == 1);
- }
-
- public void TestAttributeStringProperty()
- {
- MyCodeGroup cg = null;
- PolicyStatementAttribute psa = PolicyStatementAttribute.LevelFinal;
- PolicyStatement ps = new PolicyStatement(new PermissionSet(PermissionState.None));
- ps.Attributes = psa;
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", psa.ToString(), cg.AttributeString);
- }
-
- public void TestPermissionSetNameProperty()
- {
- MyCodeGroup cg = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", ps_Name, cg.PermissionSetName);
- }
-
- public void TestEquals()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
- bool isEquals;
- isEquals = cg.Equals(cg);
-
- isEquals = cg.Equals("Not Equal to this");
- Assert("CodeGroup should not be equal to a non-CodeGroup type", !isEquals);
-
- cg2 = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg2.Name = "SomeOtherName";
- cg2.Description = "Some Other Description";
-
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Name or Description is different", !isEquals);
-
- cg2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Membership Condition is different", !isEquals);
- }
-
- public void TestEqualsWithChildren()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- MyCodeGroup cgChild = null;
- const string ps_Name = "TestName";
- bool isEquals;
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cg2 = new MyCodeGroup(cg.MembershipCondition, cg.PolicyStatement);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
-
- isEquals = cg.Equals(cg2);
- Assert("Should be equal when Children are ignored", isEquals);
-
- isEquals = cg.Equals(cg2, true);
- Assert("Should not be equal when Child count is different", !isEquals);
-
- cg2.AddChild(cgChild);
- isEquals = cg2.Equals(cg, true);
- Assert("Should be equal when children are equal", isEquals);
- }
-
-
- public void TestRemoveChild()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cgChild = null;
- MyCodeGroup cgChild2 = null;
- const string ps_Name = "TestName";
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cgChild2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild2.Name = "ChildName2";
- cgChild2.Description = "Child Descripiton 2";
-
- cg.AddChild(cgChild2);
-
- AssertEquals("Should be two children before the call to Remove()", 2, cg.Children.Count);
-
- cg.RemoveChild(cgChild);
-
- AssertEquals("Remaing child does not have correct name", "ChildName2", ((CodeGroup)cg.Children[0]).Name);
- try
- {
- cg.RemoveChild(cgChild);
- Fail("Should have throw error on trying to remove non-existant child");
- }
- catch{}
- }
- } // public class CodeGroupTest
-
-} // namespace MonoTests.System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security/AllTests.cs b/mcs/class/corlib/Test/System.Security/AllTests.cs
deleted file mode 100644
index 5f32c30411d..00000000000
--- a/mcs/class/corlib/Test/System.Security/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// TestSuite.System.Security.AllSecurityTests.cs
-//
-// Lawrence Pit <loz@cable.a2000.nl>
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (SecurityElementTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Security/ChangeLog b/mcs/class/corlib/Test/System.Security/ChangeLog
deleted file mode 100644
index 609aa291d8e..00000000000
--- a/mcs/class/corlib/Test/System.Security/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * SecurityElementTest.cs: Catch and report unexpected exceptions.
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * ChangeLog: added
- * AllTests.cs: added
- * SecurityElementTest.cs: added
-
diff --git a/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs b/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs
deleted file mode 100644
index d4f58882a01..00000000000
--- a/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// SecurityElementTest.cs - NUnit Test Cases for System.Security.SecurityElement
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Security;
-
-namespace MonoTests.System.Security
-{
-
-public class SecurityElementTest : TestCase
-{
- SecurityElement elem;
-
- public SecurityElementTest () :
- base ("[MonoTests.System.Security.SecurityElementTest]") {}
-
- public SecurityElementTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- elem = CreateElement ();
- }
-
- protected override void TearDown () {}
-
- private SecurityElement CreateElement ()
- {
- SecurityElement elem = new SecurityElement ("IPermission");
- elem.AddAttribute ("class", "System");
- elem.AddAttribute ("version", "1");
-
- SecurityElement child = new SecurityElement ("ConnectAccess");
- elem.AddChild (child);
-
- SecurityElement grandchild = new SecurityElement ("ENDPOINT", "some text");
- grandchild.AddAttribute ("transport", "All");
- grandchild.AddAttribute ("host", "localhost");
- grandchild.AddAttribute ("port", "8080");
- child.AddChild (grandchild);
-
- SecurityElement grandchild2 = new SecurityElement ("ENDPOINT");
- grandchild2.AddAttribute ("transport", "Tcp");
- grandchild2.AddAttribute ("host", "www.ximian.com");
- grandchild2.AddAttribute ("port", "All");
- child.AddChild (grandchild2);
-
- return elem;
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (SecurityElementTest));
- }
- }
-
- public void TestConstructors ()
- {
-
- }
-
- public void TestAddAttribute ()
- {
- try {
- elem.AddAttribute (null, "valid");
- Fail ("#1");
- } catch (ArgumentNullException) { }
- try {
- elem.AddAttribute ("valid", null);
- Fail ("#2");
- } catch (ArgumentNullException) { }
- try {
- elem.AddAttribute ("<invalid>", "valid");
- Fail ("#3");
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "invalid\"");
- Fail ("#4");
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "valid\'");
- } catch (ArgumentException) { Fail ("#5"); }
- try {
- elem.AddAttribute ("valid", "valid&");
- Fail ("#6");
- // in xml world this is actually not considered valid
- // but it is by MS.Net
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "<invalid>");
- Fail ("#7");
- } catch (ArgumentException) { }
- }
-
- public void TestAttributes ()
- {
- Hashtable h = elem.Attributes;
-
- /*
- // this will result in an InvalidCastException on MS.Net
- // I have no clue why
-
- h.Add ("<invalid>", "valid");
- try {
- elem.Attributes = h;
- Fail ("#1");
- } catch (ArgumentException) { }
- */
-
- h = elem.Attributes;
- h.Add ("valid", "\"invalid\"");
- try {
- elem.Attributes = h;
- Fail ("#2");
- } catch (ArgumentException) { }
-
- h = elem.Attributes;
- h.Add ("foo", "bar");
- Assert ("#3", elem.Attributes.Count != h.Count);
-
- elem.Attributes = h;
- Assert ("#4", elem.Attribute ("foo") != null);
- }
-
- public void TestEqual ()
- {
- int iTest = 0;
- try {
- SecurityElement elem2 = CreateElement ();
- iTest++;
- Assert ("#1", elem.Equal (elem2));
- iTest++;
- SecurityElement child = (SecurityElement) elem2.Children [0];
- iTest++;
- child = (SecurityElement) child.Children [1];
- iTest++;
- child.Text = "some text";
- iTest++;
- Assert ("#2", !elem.Equal (elem2));
- } catch (Exception e) {
- Fail ("Unexpected Exception at iTest = " + iTest + ". e = " + e);
- }
- }
-
- public void TestEscape ()
- {
- AssertEquals ("#1", SecurityElement.Escape ("foo<>\"'& bar"), "foo&lt;&gt;&quot;&apos;&amp; bar");
- }
-
- public void TestIsValidAttributeName ()
- {
- Assert ("#1", !SecurityElement.IsValidAttributeName ("x x"));
- Assert ("#2", !SecurityElement.IsValidAttributeName ("x<x"));
- Assert ("#3", !SecurityElement.IsValidAttributeName ("x>x"));
- Assert ("#4", SecurityElement.IsValidAttributeName ("x\"x"));
- Assert ("#5", SecurityElement.IsValidAttributeName ("x'x"));
- Assert ("#6", SecurityElement.IsValidAttributeName ("x&x"));
- }
-
- public void TestIsValidAttributeValue ()
- {
- Assert ("#1", SecurityElement.IsValidAttributeValue ("x x"));
- Assert ("#2", !SecurityElement.IsValidAttributeValue ("x<x"));
- Assert ("#3", !SecurityElement.IsValidAttributeValue ("x>x"));
- Assert ("#4", !SecurityElement.IsValidAttributeValue ("x\"x"));
- Assert ("#5", SecurityElement.IsValidAttributeValue ("x'x"));
- Assert ("#6", SecurityElement.IsValidAttributeValue ("x&x"));
- }
-
- public void TestIsValidTag ()
- {
- Assert ("#1", !SecurityElement.IsValidTag ("x x"));
- Assert ("#2", !SecurityElement.IsValidTag ("x<x"));
- Assert ("#3", !SecurityElement.IsValidTag ("x>x"));
- Assert ("#4", SecurityElement.IsValidTag ("x\"x"));
- Assert ("#5", SecurityElement.IsValidTag ("x'x"));
- Assert ("#6", SecurityElement.IsValidTag ("x&x"));
- }
-
- public void TestIsValidText ()
- {
- Assert ("#1", SecurityElement.IsValidText ("x x"));
- Assert ("#2", !SecurityElement.IsValidText ("x<x"));
- Assert ("#3", !SecurityElement.IsValidText ("x>x"));
- Assert ("#4", SecurityElement.IsValidText ("x\"x"));
- Assert ("#5", SecurityElement.IsValidText ("x'x"));
- Assert ("#6", SecurityElement.IsValidText ("x&x"));
- }
-
- public void TestSearchForChildByTag ()
- {
- SecurityElement child = null;
- try {
- child = elem.SearchForChildByTag (null);
- Fail ("#1 should have thrown an ArgumentNullException");
- } catch (ArgumentNullException) { }
-
- child = elem.SearchForChildByTag ("doesnotexist");
- AssertEquals ("#2", child, null);
-
- child = elem.SearchForChildByTag ("ENDPOINT");
- AssertEquals ("#3", child, null);
-
- child = (SecurityElement) elem.Children [0];
- child = child.SearchForChildByTag ("ENDPOINT");
- AssertEquals ("#4", child.Attribute ("transport"), "All");
- }
-
- public void TestSearchForTextOfTag ()
- {
- try {
- string t1 = elem.SearchForTextOfTag (null);
- Fail ("#1 should have thrown an ArgumentNullException");
- } catch (ArgumentNullException) { }
-
- string t2 = elem.SearchForTextOfTag ("ENDPOINT");
- AssertEquals ("#2", t2, "some text");
- }
-}
-
-}
-
diff --git a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs b/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs
deleted file mode 100755
index 971a37fc633..00000000000
--- a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// ASCIIEncodingTest - NUnit Test Cases for the System.Text.ASCIIEncoding class
-//
-// Author: Mike Kestner <mkestner@speakeasy.net>
-//
-// <c> 2002 Mike Kestner
-
-using NUnit.Framework;
-using System.Text;
-using System;
-
-
-namespace MonoTests.System.Text {
-
- public class ASCIIEncodingTest : TestCase {
-
- private char[] testchars;
- private byte[] testbytes;
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes2"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes3"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes4"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes5"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes6"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars2"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars3"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars4"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetString1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetString2"));
- suite.AddTest (new ASCIIEncodingTest ("TestDecoder"));
- suite.AddTest (new ASCIIEncodingTest ("TestEncoder"));
- return suite;
- }
- }
-
- public ASCIIEncodingTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- testchars = new char[4];
- testchars[0] = 'T';
- testchars[1] = 'e';
- testchars[2] = 's';
- testchars[3] = 't';
- testbytes = new byte[4];
- testbytes[0] = (byte) 'T';
- testbytes[1] = (byte) 'e';
- testbytes[2] = (byte) 's';
- testbytes[3] = (byte) 't';
- }
-
- // Test GetBytes(char[])
- public void TestGetBytes1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes(testchars);
- for (int i = 0; i < testchars.Length; i++)
- AssertEquals (testchars[i], (char) bytes[i]);
- }
-
- // Test GetBytes(char[], int, int)
- public void TestGetBytes2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes(testchars, 1, 1);
- AssertEquals (1, bytes.Length);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- // Test non-ASCII char in char[]
- public void TestGetBytes3 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- testchars[2] = (char) 0x80;
- byte[] bytes = ascii_encoding.GetBytes(testchars);
- AssertEquals ('T', (char) bytes[0]);
- AssertEquals ('e', (char) bytes[1]);
- AssertEquals ('?', (char) bytes[2]);
- AssertEquals ('t', (char) bytes[3]);
- }
-
- // Test GetBytes(char[], int, int, byte[], int)
- public void TestGetBytes4 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetBytes(testchars, 1, 1, bytes, 0);
- AssertEquals (1, cnt);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- // Test GetBytes(string, int, int, byte[], int)
- public void TestGetBytes5 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetBytes("Test", 1, 1, bytes, 0);
- AssertEquals ('e', (char) bytes[0]);
- }
-
- // Test GetBytes(string)
- public void TestGetBytes6 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes("Test");
- for (int i = 0; i < testchars.Length; i++)
- AssertEquals (testchars[i], (char) bytes[i]);
- }
-
- // Test GetChars(byte[])
- public void TestGetChars1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = ascii_encoding.GetChars(testbytes);
- for (int i = 0; i < testbytes.Length; i++)
- AssertEquals (testbytes[i], (byte) chars[i]);
- }
-
- // Test GetChars(byte[], int, int)
- public void TestGetChars2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = ascii_encoding.GetChars(testbytes, 1, 1);
- AssertEquals (1, chars.Length);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test non-ASCII char in byte[]
- public void TestGetChars3 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- testbytes[2] = 0x80;
- char[] chars = ascii_encoding.GetChars(testbytes);
- AssertEquals ('T', chars[0]);
- AssertEquals ('e', chars[1]);
- AssertEquals ('?', chars[2]);
- AssertEquals ('t', chars[3]);
- }
-
- // Test GetChars(byte[], int, int, char[], int)
- public void TestGetChars4 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = new char[1];
- int cnt = ascii_encoding.GetChars(testbytes, 1, 1, chars, 0);
- AssertEquals (1, cnt);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test GetString(char[])
- public void TestGetString1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- string str = ascii_encoding.GetString(testbytes);
- AssertEquals ("Test", str);
- }
-
- // Test GetString(char[], int, int)
- public void TestGetString2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- string str = ascii_encoding.GetString(testbytes, 1, 2);
- AssertEquals ("es", str);
- }
-
- // Test Decoder
- public void TestDecoder ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = new char[1];
- int cnt = ascii_encoding.GetDecoder().GetChars(testbytes, 1, 1, chars, 0);
- AssertEquals (1, cnt);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test Decoder
- public void TestEncoder ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetEncoder().GetBytes(testchars, 1, 1, bytes, 0, false);
- AssertEquals (1, cnt);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Text/AllTests.cs b/mcs/class/corlib/Test/System.Text/AllTests.cs
deleted file mode 100644
index 1069b3a3f91..00000000000
--- a/mcs/class/corlib/Test/System.Text/AllTests.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Text {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- //suite.AddTest(StringBuilderTest.Suite);
- suite.AddTest(ASCIIEncodingTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Text/ChangeLog b/mcs/class/corlib/Test/System.Text/ChangeLog
deleted file mode 100644
index 46c490e50a2..00000000000
--- a/mcs/class/corlib/Test/System.Text/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-03-17 Mike Kestner <mkestner@speakeasy.net>
-
- * ASCIIEncodingTest.cs : New suite for ASCIIEncoding.
- * AllTests.cs : Add the new suite.
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Remove StringBuilderTest suite. There's a major failure
- when it's included and the test errors aren't displayed.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilderTest.cs: Fixed tests that were failing against mscorlib.
diff --git a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
deleted file mode 100644
index 9f2677e1f1c..00000000000
--- a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// StringBuilderTest.dll - NUnit Test Cases for the System.Text.StringBuilder class
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// NOTES: I've also run all these tests against the MS implementation of
-// System.Text.StringBuilder to confirm that they return the same results
-// and they do.
-//
-// TODO: Add tests for the AppendFormat methods once the AppendFormat methods
-// are implemented in the StringBuilder class itself
-//
-// TODO: Potentially add more variations on Insert / Append tests for all the
-// possible types. I don't really think that's necessary as they all
-// pretty much just do .ToString().ToCharArray() and then use the Append / Insert
-// CharArray function. The ToString() bit for each type should be in the unit
-// tests for those types, and the unit test for ToCharArray should be in the
-// string test type. If someone wants to add those tests here for completness
-// (and some double checking) then feel free :)
-//
-
-using NUnit.Framework;
-using System.Text;
-using System;
-
-namespace MonoTests.System.Text {
-
-public class StringBuilderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringBuilderTest));
- }
- }
-
- public StringBuilderTest( string name ) : base(name) { }
-
-
- private StringBuilder sb;
-
- public void TestConstructor1()
- {
- // check the parameterless ctor
- sb = new StringBuilder();
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(16, sb.Capacity);
- }
-
- public void TestConstructor2()
- {
- // check ctor that specifies the capacity
- sb = new StringBuilder(10);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is not less than default
- AssertEquals(10, sb.Capacity);
-
- sb = new StringBuilder(42);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is set
- AssertEquals(42, sb.Capacity);
- }
-
- public void TestConstructor3() {
- // check ctor that specifies the capacity & maxCapacity
- sb = new StringBuilder(444, 1234);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(444, sb.Capacity);
- AssertEquals(1234, sb.MaxCapacity);
- }
-
- public void TestConstructor4()
- {
- // check for exception in ctor that specifies the capacity & maxCapacity
- try {
- sb = new StringBuilder(9999, 15);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Capacity exeeds MaxCapacity");
- }
-
- public void TestConstructor5() {
- String someString = null;
- sb = new StringBuilder(someString);
- AssertEquals("Should be empty string", String.Empty, sb.ToString());
- }
-
- public void TestConstructor6() {
- // check for exception in ctor that prevents startIndex less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, -1, 3, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex not allowed to be less than zero.");
- }
-
- public void TestConstructor7() {
- // check for exception in ctor that prevents length less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 2, -222, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Length not allowed to be less than zero.");
- }
-
- public void TestConstructor8() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that startIndex is not too big
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 10000, 4, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor9() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that length doesn't go beyond end of string
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 4000, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor10() {
- // check that substring is taken properly and made into a StringBuilder
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 6, 18);
- string expected = "String";
- AssertEquals( expected, sb.ToString());
- }
-
- public void TestAppend() {
- StringBuilder sb = new StringBuilder( "Foo" );
- sb.Append( "Two" );
- string expected = "FooTwo";
- AssertEquals( expected, sb.ToString() );
- }
-
- public void TestInsert() {
- StringBuilder sb = new StringBuilder();
-
- AssertEquals( String.Empty, sb.ToString() );
- /* Test empty StringBuilder conforms to spec */
-
- sb.Insert( 0, "Foo" ); /* Test insert at start of empty string */
-
- AssertEquals( "Foo", sb.ToString() );
-
- sb.Insert( 1, "!!" ); /* Test insert not at start of string */
-
- AssertEquals( "F!!oo", sb.ToString() );
-
- sb.Insert( 5, ".." ); /* Test insert at end of string */
-
- AssertEquals( "F!!oo..", sb.ToString() );
-
- sb.Insert( 0, 1234 ); /* Test insert of a number (at start of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F!!oo..", sb.ToString() );
-
- sb.Insert( 5, 1.5 ); /* Test insert of a decimal (and end of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F1.5!!oo..", sb.ToString() );
-
- sb.Insert( 4, 'A' ); /* Test char insert in middle of string */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234AF1.5!!oo..", sb.ToString() );
-
- }
-
- public void TestReplace() {
- StringBuilder sb = new StringBuilder( "Foobarbaz" );
-
- sb.Replace( "bar", "!!!" ); /* Test same length replace in middle of string */
-
- AssertEquals( "Foo!!!baz", sb.ToString() );
-
- sb.Replace( "Foo", "ABcD" ); /* Test longer replace at start of string */
-
- AssertEquals( "ABcD!!!baz", sb.ToString() );
-
- sb.Replace( "baz", "00" ); /* Test shorter replace at end of string */
-
- AssertEquals( "ABcD!!!00", sb.ToString() );
-
- sb.Replace( sb.ToString(), null ); /* Test string clear as in spec */
-
- AssertEquals( String.Empty, sb.ToString() );
-
- /* | 10 20 30
- /* |0123456789012345678901234567890| */
- sb.Append( "abc this is testing abc the abc abc partial replace abc" );
-
- sb.Replace( "abc", "!!!", 0, 31 ); /* Partial replace at start of string */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "testing", "", 0, 15 ); /* Test replace across boundary */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "!!!", "" ); /* Test replace with empty string */
-
- AssertEquals(" this is testing the abc partial replace abc", sb.ToString() );
- }
-
- public void TestAppendFormat() {
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/AllTests.cs b/mcs/class/corlib/Test/System/AllTests.cs
deleted file mode 100644
index 4c943007a4d..00000000000
--- a/mcs/class/corlib/Test/System/AllTests.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest (ArrayTest.Suite);
- suite.AddTest (AttributeTest.Suite);
- suite.AddTest (BitConverterTest.Suite);
- suite.AddTest (BooleanTest.Suite);
- suite.AddTest (ByteTest.Suite);
- suite.AddTest (CharEnumeratorTest.Suite);
- suite.AddTest (CharTest.Suite);
- suite.AddTest (ConsoleTest.Suite);
- suite.AddTest (ConvertTest.Suite);
- suite.AddTest (DateTimeTest.Suite);
- suite.AddTest (DecimalTest.Suite);
- suite.AddTest (DecimalTest2.Suite);
- suite.AddTest (DoubleTest.Suite);
- suite.AddTest (EnumTest.Suite);
- suite.AddTest (ExceptionTest.Suite);
- suite.AddTest (GuidTest.Suite);
- suite.AddTest (Int16Test.Suite);
- suite.AddTest (Int32Test.Suite);
- suite.AddTest (Int64Test.Suite);
- suite.AddTest (IntegerFormatterTest.Suite);
- suite.AddTest (MathTest.Suite);
- suite.AddTest (MulticastDelegateTest.Suite);
- suite.AddTest (ObjectTest.Suite);
- suite.AddTest (RandomTest.Suite);
- suite.AddTest (ResolveEventArgsTest.Suite);
- suite.AddTest (SByteTest.Suite);
- suite.AddTest (StringTest.Suite);
- suite.AddTest (TimeSpanTest.Suite);
- suite.AddTest (TimeZoneTest.Suite);
- suite.AddTest (UInt16Test.Suite);
- suite.AddTest (UInt32Test.Suite);
- suite.AddTest (UInt64Test.Suite);
- suite.AddTest (VersionTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs
deleted file mode 100644
index fec2b2ac240..00000000000
--- a/mcs/class/corlib/Test/System/ArrayTest.cs
+++ /dev/null
@@ -1,1996 +0,0 @@
-// ArrayTest.cs - NUnit Test Cases for the System.Array class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ArrayTest : TestCase
-{
- public ArrayTest() : base ("MonoTests.System.ArrayTest testsuite") {}
- public ArrayTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayTest));
- }
- }
-
- public void TestIsFixedSize() {
- char[] a1 = {'a'};
- Assert("All arrays are fixed", a1.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- char[] a1 = {'a'};
- Assert("No array is readonly", !a1.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- char[] a1 = {'a'};
- Assert("No array is synchronized", !a1.IsSynchronized);
- }
-
- public void TestLength() {
- {
- char[] a1 = { };
- AssertEquals("Zero length array", 0, a1.Length);
- }
- {
- char[] a1 = {'c'};
- AssertEquals("One-length array", 1, a1.Length);
- }
- {
- char[] a1 = {'c', 'c'};
- AssertEquals("Two-length array", 2, a1.Length);
- }
- }
-
- public void TestRank() {
- char[] a1 = { 'c', 'd', 'e' };
- AssertEquals("Rank one", 1, a1.Rank);
-
- char[,] a2 = new Char[3,3];
- AssertEquals("Rank two", 2, a2.Rank);
-
- char[,,] a3 = new Char[3,3,3];
- AssertEquals("Rank three", 3, a3.Rank);
- }
-
- public void TestBinarySearch1() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#B01", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#B02", errorThrown);
-
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("#B05",
- Array.BinarySearch(arr, 'c') >= 3);
- Assert("#B06",
- Array.BinarySearch(arr, 'c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("#B07",
- -4, Array.BinarySearch(arr, 'c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("#B08",
- -9, Array.BinarySearch(arr, 'e'));
- }
- }
- public void TestBinarySearch2() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, 0, 1, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#B20", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, 0, 1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#B21", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, -1, 1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#B22", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, -1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#B23", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, 4, 'a');
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#B24", errorThrown);
-
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("#B26",
- Array.BinarySearch(arr, 2, 8, 'c') >= 5);
- Assert("#B27",
- Array.BinarySearch(arr, 2, 8, 'c') < 8);
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("#B28",
- -6, Array.BinarySearch(arr, 2, 8, 'c'));
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("#B29",
- -11, Array.BinarySearch(arr, 2, 8, 'e'));
- }
- }
-
- // TODO - testBinarySearch with explicit IComparer args
-
- public void TestClear() {
- bool errorThrown = false;
- try {
- Array.Clear(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#C01", errorThrown);
-
- int[] i1 = { 1, 2, 3, 4 };
- {
- int[] compare = {1,2,3,4};
- AssertEquals("#C02", compare[0], i1[0]);
- AssertEquals("#C03", compare[1], i1[1]);
- AssertEquals("#C04", compare[2], i1[2]);
- AssertEquals("#C05", compare[3], i1[3]);
- }
- Array.Clear(i1, 3, 1);
- {
- int[] compare = {1,2,3,0};
- AssertEquals("#C06", compare[0], i1[0]);
- AssertEquals("#C07", compare[1], i1[1]);
- AssertEquals("#C08", compare[2], i1[2]);
- AssertEquals("#C09", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 1);
- {
- int[] compare = {1,0,3,0};
- AssertEquals("#C10", compare[0], i1[0]);
- AssertEquals("#C11", compare[1], i1[1]);
- AssertEquals("#C12", compare[2], i1[2]);
- AssertEquals("#C13", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 3);
- {
- int[] compare = {1,0,0,0};
- AssertEquals("#C14", compare[0], i1[0]);
- AssertEquals("#C15", compare[1], i1[1]);
- AssertEquals("#C16", compare[2], i1[2]);
- AssertEquals("#C17", compare[3], i1[3]);
- }
-
- string[] s1 = { "red", "green", "blue" };
- Array.Clear(s1, 0, 3);
- {
- string[] compare = {null, null, null};
- AssertEquals("#C18", compare[0], s1[0]);
- AssertEquals("#C19", compare[1], s1[1]);
- AssertEquals("#C20", compare[2], s1[2]);
- }
- }
-
- public void TestClone() {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = (char[])c1.Clone();
- AssertEquals("#D01", c1[0], c2[0]);
- AssertEquals("#D02", c1[1], c2[1]);
- AssertEquals("#D03", c1[2], c2[2]);
-
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- char[][] d2 = (char[][])d1.Clone();
- AssertEquals("#D04", d1[0], d2[0]);
- AssertEquals("#D05", d1[1], d2[1]);
- AssertEquals("#D06", d1[2], d2[2]);
-
- d1[0][0] = 'z';
- AssertEquals("#D07", d1[0], d2[0]);
- }
-
- public void TestCopy() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(c1, null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(null, c1, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[,] c2 = new Char[1,1];
- Array.Copy(c1, c2, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- string[] s1 = new String[1];
- Array.Copy(c1, s1, 1);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("#E04", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Object[] o1 = new Object[1];
- o1[0] = "hello";
- Array.Copy(o1, c1, 1);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("#E05", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[1];
- Array.Copy(c1, c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#E06", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c1, c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E07", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c2, c1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E08", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, copy, 4);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("#E09(" + i + ")",
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("#E10(" + i + ")",
- (char)0, copy[i]);
- }
- Array.Copy(orig, copy, 2);
- AssertEquals("#E11", orig[0], copy[0]);
- AssertEquals("#E12", orig[1], copy[1]);
- Assert("#E13", orig[2] != copy[2]);
- Assert("#E14", orig[3] != copy[3]);
- }
- public void TestCopy2() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 1, c1, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E31", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 0, c1, 1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E32", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, 1, copy, 1, 3);
- Assert("#E33", copy[0] != orig[0]);
- for (int i = 1; i < orig.Length; i++) {
- AssertEquals("#E34(" + i + ")",
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- Array.Copy(orig, 1, copy, 0, 2);
- AssertEquals("#E35", orig[1], copy[0]);
- AssertEquals("#E36", orig[2], copy[1]);
- Assert("#E37", copy[2] != orig[2]);
- Assert("#E38", copy[3] != orig[3]);
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- c1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[,] c2 = new Char[2,2];
- c1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, -1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 2);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E64", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#E65", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E66", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E67", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = new String[2];
- Char[] c2 = new Char[2];
- // FIXME: Our implementation doesn't throw an exception if
- // this is uninitialized.
- c1[0] = "Hello";
- c1[1] = "World";
- c1.CopyTo(c2, 0);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("#E68", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- orig.CopyTo(copy, 3);
- AssertEquals("#E69", (char)0, copy[0]);
- AssertEquals("#E70", (char)0, copy[1]);
- AssertEquals("#E71", (char)0, copy[2]);
- AssertEquals("#E72", orig[0], copy[3]);
- AssertEquals("#E73", orig[1], copy[4]);
- AssertEquals("#E74", orig[2], copy[5]);
- AssertEquals("#E75", orig[3], copy[6]);
- AssertEquals("#E76", (char)0, copy[7]);
- AssertEquals("#E77", (char)0, copy[8]);
- AssertEquals("#E78", (char)0, copy[9]);
-
- {
- // The following is valid and must not throw an exception.
- bool errorThrown = false;
- try {
- int[] src = new int [0];
- int[] dest = new int [0];
- src.CopyTo (dest, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E79", !errorThrown);
- }
- }
-
- public void TestCreateInstance() {
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(null, 12);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), -3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#F02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), null, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F04", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- int[] lengths = new int [0];
- Array.CreateInstance(Type.GetType("System.Char"), lengths);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#F05", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- int[] lengths = new int [1];
- int[] bounds = new int [2];
- // FIXME: Broken
- // Array.CreateInstance(Type.GetType("System.Char"), lengths, bounds);
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#F06", errorThrown);
- }
-
- char[] c1 = (char[])Array.CreateInstance(Type.GetType("System.Char"), 12);
- AssertEquals("#F07", 12, c1.Length);
-
- Array c2 = Array.CreateInstance(Type.GetType("System.Char"), 12, 5);
- AssertEquals("#F08", 2, c2.Rank);
- AssertEquals("#F09", 60, c2.Length);
-
-
- {
- int[] lengths = { 3 };
- int[] bounds = { 5 };
- int[] src = { 512, 718, 912 };
- Array array = Array.CreateInstance(typeof(int), lengths, bounds);
-
- AssertEquals("#F10", 3, array.Length);
- AssertEquals("#F11", 5, array.GetLowerBound(0));
- AssertEquals("#F12", 7, array.GetUpperBound(0));
-
- src.CopyTo (array, 5);
-
- for (int i = 0; i < src.Length; i++)
- AssertEquals("#F13(" + i + ")", src[i], array.GetValue(i+5));
- }
-
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- IEnumerator en = s1.GetEnumerator ();
- AssertNotNull ("#G01", en);
-
- Assert ("#G02", en.MoveNext ());
- AssertEquals ("#G03", "this", en.Current);
- Assert ("#G04", en.MoveNext ());
- AssertEquals ("#G05", "is", en.Current);
- Assert ("#G06", en.MoveNext ());
- AssertEquals ("#G07", "a", en.Current);
- Assert ("#G08", en.MoveNext ());
- AssertEquals ("#G09", "test", en.Current);
- Assert ("#G10", !en.MoveNext ());
-
- en.Reset ();
- Assert("#G11", en.MoveNext ());
- AssertEquals ("#G12", "this", en.Current);
-
- // mutation does not invalidate array enumerator!
- s1.SetValue ("change", 1);
- Assert ("#G13", en.MoveNext ());
- AssertEquals ("#G14", "change", en.Current);
- }
-
- public void TestGetEnumeratorMultipleDimension() {
- String[,] s1 = {{"this", "is"}, {"a", "test"}};
- IEnumerator en = s1.GetEnumerator ();
- AssertNotNull ("#AA01", en);
-
- Assert ("#AA02", en.MoveNext ());
- AssertEquals ("#AA03", "this", en.Current);
- Assert ("#AA04", en.MoveNext ());
- AssertEquals ("#AA05", "is", en.Current);
- Assert ("#AA06", en.MoveNext ());
- AssertEquals ("#AA07", "a", en.Current);
- Assert ("#AA08", en.MoveNext ());
- AssertEquals ("#AA09", "test", en.Current);
- Assert ("#AA10", !en.MoveNext ());
-
- en.Reset ();
- Assert("#AA11", en.MoveNext ());
- AssertEquals ("#AA12", "this", en.Current);
-
- int[] idxs = {0,1};
- // mutation does not invalidate array enumerator!
- s1.SetValue ("change", idxs);
- Assert ("#AA13", en.MoveNext ());
- AssertEquals ("#AA14", "change", en.Current);
- }
-
- public void TestGetEnumeratorNonZeroLowerBounds() {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance( typeof(String), myLengthsArray, myBoundsArray );
- for ( int i = myArray.GetLowerBound(0); i <= myArray.GetUpperBound(0); i++ )
- for ( int j = myArray.GetLowerBound(1); j <= myArray.GetUpperBound(1); j++ ) {
- int[] myIndicesArray = new int[2] { i, j };
- myArray.SetValue( Convert.ToString(i) + j, myIndicesArray );
- }
- IEnumerator en = myArray.GetEnumerator ();
- AssertNotNull ("#AB01", en);
-
- // check the first couple of values
- Assert ("#AB02", en.MoveNext ());
- AssertEquals ("#AB03", "23", en.Current);
- Assert ("#AB04", en.MoveNext ());
- AssertEquals ("#AB05", "24", en.Current);
-
- // then check the last element's value
- string lastElement;
- do {
- lastElement = (string)en.Current;
- } while (en.MoveNext());
- AssertEquals ("#AB06", "47", lastElement);
- }
-
- public void TestIList_Add () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Add ("can not");
- Fail ("IList.Add should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Add threw wrong exception type");
- }
-
- Fail("IList.Add shouldn't get this far");
- }
-
- public void TestIList_Insert () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Insert (0, "can not");
- Fail ("IList.Insert should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Insert threw wrong exception type");
- }
-
- Fail("IList.Insert shouldn't get this far");
- }
-
- public void TestIList_Remove () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Remove ("can not");
- Fail ("IList.Remove should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Remove threw wrong exception type");
- }
-
- Fail("IList.Remove shouldn't get this far");
- }
-
- public void TestIList_RemoveAt () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).RemoveAt (0);
- Fail ("IList.RemoveAt should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.RemoveAt threw wrong exception type");
- }
-
- Fail("IList.RemoveAt shouldn't get this far");
- }
-
- public void TestIList_Contains () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
-
- try {
- bool b = ((IList)myArray).Contains ("23");
- Fail("IList.Contains should throw with multi-dimensional arrays");
- }
- catch (RankException) {
- int[] iArr = new int[3] { 1, 2, 3};
- // check the first and last items
- Assert("AC01", ((IList)iArr).Contains (1));
- Assert("AC02", ((IList)iArr).Contains (3));
-
- // and one that is definately not there
- Assert("AC03", !((IList)iArr).Contains (42));
- return;
- }
-
- Fail("Should not get here");
- }
-
- public void TestIList_IndexOf () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
-
- try {
- bool b = ((IList)myArray).Contains ("23");
- Fail("IList.Contains should throw with multi-dimensional arrays");
- }
- catch (RankException) {
- int[] iArr = new int[3] { 1, 2, 3};
- // check the first and last items
- AssertEquals("AD01", 0, ((IList)iArr).IndexOf (1));
- AssertEquals("AD02", 2, ((IList)iArr).IndexOf (3));
-
- // and one that is definately not there
- AssertEquals("AD03", -1, ((IList)iArr).IndexOf (42));
- }
- catch (Exception e) {
- Fail("Unexpected exception: " + e.ToString());
- }
-
- // check that wierd case whem lowerbound is Int32.MinValue,
- // so that IndexOf() needs to return Int32.MaxValue when it cannot find the object
- int[] myLengthArray = new int[1] { 3 };
- int[] myBoundArray = new int[1] { Int32.MinValue };
- Array myExtremeArray=Array.CreateInstance ( typeof(String), myLengthArray, myBoundArray );
- AssertEquals("AD04", Int32.MaxValue, ((IList)myExtremeArray).IndexOf (42));
-
- }
-
- public void TestGetLength() {
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H02", errorThrown);
- }
-
- char[] c2 = new Char[5];
- AssertEquals("#H03",
- 5, c2.GetLength(0));
-
- char[,] c3 = new Char[6,7];
- AssertEquals("#H04",
- 6, c3.GetLength(0));
- AssertEquals("#H05",
- 7, c3.GetLength(1));
- }
-
- public void TestGetLowerBound() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H31", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H32", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("#H33",
- 0, c1.GetLowerBound(0));
-
- char[,] c2 = new Char[4,4];
- AssertEquals("#H34",
- 0, c2.GetLowerBound(0));
- AssertEquals("#H35",
- 0, c2.GetLowerBound(1));
- }
-
- public void TestGetUpperBound() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H62", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("#H63",
- 4, c1.GetUpperBound(0));
-
- char[,] c2 = new Char[4,6];
- AssertEquals("#H64",
- 3, c2.GetUpperBound(0));
- AssertEquals("#H65",
- 5, c2.GetUpperBound(1));
- }
-
- public void TestGetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I03", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("#I04(" + i + ")", c1[i], c1.GetValue(i));
- }
- }
- public void TestGetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(-1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I23", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#I24(" + i + "," + j + ")",
- c1[i,j], c1.GetValue(i, j));
- }
- }
- }
- public void TestGetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(-1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I43", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("#I44(" + i + "," + j + ")",
- c1[i,j,k], c1.GetValue(i,j,k));
- }
- }
- }
- }
- public void TestGetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#I61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.GetValue(coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I64", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- int[] coords = {i, j};
- AssertEquals("#I65(" + i + "," + j + ")",
- c1[i,j], c1.GetValue(coords));
- }
- }
- }
-
- public void TestIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J02", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "test"};
- AssertEquals("#J03", -1, Array.IndexOf(s1, null));
- AssertEquals("#J04", -1, Array.IndexOf(s1, "nothing"));
- AssertEquals("#J05", 0, Array.IndexOf(s1, "this"));
- AssertEquals("#J06", 3, Array.IndexOf(s1, "test"));
- }
- public void TestIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J23", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#J24", -1, Array.IndexOf(s1, null, 1));
- AssertEquals("#J25", -1, Array.IndexOf(s1, "nothing", 1));
- AssertEquals("#J26", -1, Array.IndexOf(s1, "this", 1));
- AssertEquals("#J27", 1, Array.IndexOf(s1, "is", 1));
- AssertEquals("#J28", 4, Array.IndexOf(s1, "test", 1));
- }
- public void TestIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J43", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J44", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#J45", -1, Array.IndexOf(s1, null, 1, 3));
- AssertEquals("#J46", -1, Array.IndexOf(s1, "nothing", 1, 3));
- AssertEquals("#J47", -1, Array.IndexOf(s1, "this", 1, 3));
- AssertEquals("#J48", 1, Array.IndexOf(s1, "is", 1, 3));
- AssertEquals("#J49", -1, Array.IndexOf(s1, "test", 1, 3));
- AssertEquals("#J50", 3, Array.IndexOf(s1, "a", 1, 3));
- }
-
- public void TestLastIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K02", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "a", "test"};
- AssertEquals("#K03", -1, Array.LastIndexOf(s1, null));
- AssertEquals("#K04", -1, Array.LastIndexOf(s1, "nothing"));
- AssertEquals("#K05", 0, Array.LastIndexOf(s1, "this"));
- AssertEquals("#K06", 4, Array.LastIndexOf(s1, "test"));
- AssertEquals("#K07", 3, Array.LastIndexOf(s1, "a"));
- }
- public void TestLastIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K23", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#K24", -1, Array.LastIndexOf(s1, null, 3));
- AssertEquals("#K25", -1, Array.LastIndexOf(s1, "nothing", 3));
- AssertEquals("#K26", -1, Array.LastIndexOf(s1, "test", 3));
- AssertEquals("#K27", 3, Array.LastIndexOf(s1, "a", 3));
- AssertEquals("#K28", 0, Array.LastIndexOf(s1, "this", 3));
- }
- public void TestLastIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K43", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K44", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#K45",
- -1, Array.LastIndexOf(s1, null, 3, 3));
- AssertEquals("#K46",
- -1, Array.LastIndexOf(s1, "nothing", 3, 3));
- AssertEquals("#K47",
- -1, Array.LastIndexOf(s1, "this", 3, 3));
- AssertEquals("#K48",
- 1, Array.LastIndexOf(s1, "is", 3, 3));
- AssertEquals("#K49",
- -1, Array.LastIndexOf(s1, "test", 3, 3));
- AssertEquals("#K50",
- 3, Array.LastIndexOf(s1, "a", 3, 3));
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#L01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#L02", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- Array.Reverse(c1);
- AssertEquals("#L03", 'd', c1[0]);
- AssertEquals("#L04", 'c', c1[1]);
- AssertEquals("#L05", 'b', c1[2]);
- AssertEquals("#L06", 'a', c1[3]);
-
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#L07", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c, 0, 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#L08", errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 0, 3);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("#L09", errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 3, 0);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("#L10", errorThrown);
- //}
-
- char[] c2 = { 'a', 'b', 'c', 'd'};
- Array.Reverse(c2, 1, 2);
- AssertEquals("#L11", 'a', c2[0]);
- AssertEquals("#L12", 'c', c2[1]);
- AssertEquals("#L13", 'b', c2[2]);
- AssertEquals("#L14", 'd', c2[3]);
- }
-
- public void TestSetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", -1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", 4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M03", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- char[] c2 = new char[4];
- for (int i = 0; i < c1.Length; i++) {
- c2.SetValue(c1[i], i);
- }
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("#M04(" + i + ")", c1[i], c2[i]);
- }
-
- int[] c3 = { 1, 2, 3 };
- long[] c4 = new long [3];
-
- for (int i = 0; i < c3.Length; i++)
- c4.SetValue (c3 [i], i);
- c3.CopyTo (c4, 0);
- for (int i = 0; i < c3.Length; i++)
- Assert ("#M05(" + i + ")", c3[i] == c4[i]);
-
- Object[] c5 = new Object [3];
- long[] c6 = new long [3];
-
- c4.CopyTo (c5, 0);
-
- c5.CopyTo (c6, 0);
- // for (int i = 0; i < c5.Length; i++)
- // Assert ("#M06(" + i + ")", c5[i] == c6[i]);
- }
-
- public void TestSetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", -1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M23", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- c2.SetValue(c1[first,second], first, second);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#M24(" + i + "," + j + ")",
- c1[i,j], c2[i, j]);
- }
- }
- }
- public void TestSetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", -1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", 4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M43", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- char[,,] c2 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- c2.SetValue(c1[first, second, third], first, second, third);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("#M44(" + i + "," + j + " )",
- c1[i,j,k], c2[i,j,k]);
- }
- }
- }
- }
- public void TestSetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#M61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.SetValue("buh", coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M64", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- int[] coords = {first, second};
- c2.SetValue(c1[first,second], coords);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#M65(" + i + "," + j + ")",
- c1[i,j], c2[i,j]);
- }
- }
- }
-
- public void TestSetValue4() {
- {
- int[] c1 = { 1, 2, 3 };
- long[] c2 = new long [3];
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++) {
- Assert ("#M81(" + i + ")", c1[i] == c2[i]);
- AssertEquals ("#M82(" + i + ")", typeof (long), c2[i].GetType ());
- }
- }
- {
- long[] c1 = { 1, 2, 3 };
- int[] c2 = new int [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M83", errorThrown);
- }
- {
- int[] c1 = { 1, 2, 3 };
- Object[] c2 = new Object [3];
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++)
- AssertEquals ("#M84(" + i + ")", c1[i], Convert.ToInt32 (c2[i]));
- }
- {
- Object[] c1 = new Object [3];
- Object[] c2 = new Object [3];
- c1[0] = new Object ();
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++)
- AssertEquals ("#M85(" + i + ")", c1[i], c2[i]);
- }
- {
- Object[] c1 = new Object [3];
- string[] c2 = new String [3];
- string test = "hello";
- c1[0] = test;
-
- c2.SetValue (c1 [0], 0);
- AssertEquals ("#M86", c1[0], c2[0]);
- AssertEquals ("#M87", "hello", c2[0]);
- }
- {
- char[] c1 = { 'a', 'b', 'c' };
- string[] c2 = new string [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- // FIXME
- errorThrown = true;
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("#M88", errorThrown);
- }
- {
- Single[] c1 = { 1.2F, 2.3F, 3.4F, 4.5F };
- long[] c2 = new long [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- // FIXME
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M89", errorThrown);
- }
- {
- Type[] types = {
- typeof (Boolean),
- typeof (Byte),
- typeof (Char),
- typeof (Double),
- typeof (Int16),
- typeof (Int32),
- typeof (Int64),
- typeof (SByte),
- typeof (Single),
- typeof (UInt16),
- typeof (UInt32),
- typeof (UInt64)
- };
-
- bool v1 = true;
- Byte v2 = 1;
- Char v3 = 'a';
- Double v4 = -1.2;
- Int16 v5 = -32;
- Int32 v6 = -234;
- Int64 v7 = -34523;
- SByte v8 = -1;
- Single v9 = -4.8F;
- UInt16 v10 = 24234;
- UInt32 v11 = 235354;
- UInt64 v12 = 234552;
-
- Object[] va1 = { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 };
- Object[] va2 = { "true", "1", "a", "-1.2", "-32", "-234", "-34523", "-1",
- "-4.8F", "24234", "235354", "234552" };
-
- Object[][] vt = { va1, va1, va1, va1, va1, va1, va1, va1, va1, va1, va1, va1 };
-
- int[] arg_ex = {
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1,
- 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0,
- 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0
- };
-
- // SetValue
-
- for (int i = 0; i < types.Length; i++) {
- for (int j = 0; j < types.Length; j++) {
- Array array = Array.CreateInstance (types [j], 2);
-
- Object value = vt[j][i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
-
- int ex_index = (i * types.Length) + j;
-
- AssertEquals ("#M90(" + types [i] + "," + types [j] + ")",
- errorThrown, arg_ex [ex_index] == 1);
- }
- }
-
- for (int i = 0; i < types.Length; i++) {
- String[] array = new String [2];
-
- Object value = va1 [i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M91(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array array = Array.CreateInstance (types [i], 2);
-
- Object value = va2 [i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M92(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array array = Array.CreateInstance (types [i], 2);
-
- Object value = null;
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M93(" + types [i] + ")", !errorThrown);
- }
-
- // Copy
-
- for (int i = 0; i < types.Length; i++) {
- for (int j = 0; j < types.Length; j++) {
- Array source = Array.CreateInstance (types [i], 2);
- Array array = Array.CreateInstance (types [j], 2);
-
- source.SetValue (vt[j][i], 0);
- source.SetValue (vt[j][i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- int ex_index = (i * types.Length) + j;
-
- AssertEquals ("#M94(" + types [i] + "," + types [j] + ")",
- errorThrown, arg_ex [ex_index] == 1);
- }
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array source = Array.CreateInstance (types [i], 2);
- String[] array = new String [2];
-
- source.SetValue (va1 [i], 0);
- source.SetValue (va1 [i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- Assert ("#M95(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- String[] source = new String [2];
- Array array = Array.CreateInstance (types [i], 2);
-
- source.SetValue (va2 [i], 0);
- source.SetValue (va2 [i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- Assert ("#M96(" + types [i] + ")", errorThrown);
- }
- }
- }
-
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- Array.Sort(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.Sort(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N04", errorThrown);
- }
-
- // note: null second array => just sort first array
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- int[] starter1 = {1,2,3,4,5,6};
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1);
- AssertEquals("#N21", 'a', c1[0]);
- AssertEquals("#N22", 'b', c1[1]);
- AssertEquals("#N23", 'c', c1[2]);
- AssertEquals("#N24", 'd', c1[3]);
- AssertEquals("#N25", 'e', c1[4]);
- AssertEquals("#N26", 'f', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1);
- AssertEquals("#N41", 'a', c1[0]);
- AssertEquals("#N42", 'b', c1[1]);
- AssertEquals("#N43", 'c', c1[2]);
- AssertEquals("#N44", 'd', c1[3]);
- AssertEquals("#N45", 'e', c1[4]);
- AssertEquals("#N46", 'f', c1[5]);
- AssertEquals("#N47", 5, i1[0]);
- AssertEquals("#N48", 2, i1[1]);
- AssertEquals("#N49", 6, i1[2]);
- AssertEquals("#N50", 1, i1[3]);
- AssertEquals("#N51", 4, i1[4]);
- AssertEquals("#N52", 3, i1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1, 1, 4);
- AssertEquals("#N61", 'd', c1[0]);
- AssertEquals("#N62", 'a', c1[1]);
- AssertEquals("#N63", 'b', c1[2]);
- AssertEquals("#N64", 'e', c1[3]);
- AssertEquals("#N65", 'f', c1[4]);
- AssertEquals("#N66", 'c', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1, 1, 4);
- AssertEquals("#N81", 'd', c1[0]);
- AssertEquals("#N82", 'a', c1[1]);
- AssertEquals("#N83", 'b', c1[2]);
- AssertEquals("#N84", 'e', c1[3]);
- AssertEquals("#N85", 'f', c1[4]);
- AssertEquals("#N86", 'c', c1[5]);
- AssertEquals("#N87", 1, i1[0]);
- AssertEquals("#N88", 5, i1[1]);
- AssertEquals("#N89", 2, i1[2]);
- AssertEquals("#N90", 4, i1[3]);
- AssertEquals("#N91", 3, i1[4]);
- AssertEquals("#N92", 6, i1[5]);
- }
- }
-
- // TODO - TestSort passed-in IComparable versions
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/AttributeTest.cs b/mcs/class/corlib/Test/System/AttributeTest.cs
deleted file mode 100755
index febe82fe118..00000000000
--- a/mcs/class/corlib/Test/System/AttributeTest.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// AttributeTest.cs - NUnit Test Cases for the System.Attribute class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-// Inner namespace for some test helper classes
-using MonoTests.System.AttributeTestInternals;
-
-namespace AttributeTestInternals
-{
-
-[AttributeUsage(AttributeTargets.Class, AllowMultiple=true, Inherited=false)]
-internal class MyCustomAttribute : Attribute {
-
- private string _info;
-
- public MyCustomAttribute (string info)
- {
- _info = info;
- }
-
- public string Info
- {
- get {
- return _info;
- }
- }
-
-}
-
-[AttributeUsage(AttributeTargets.Class)]
-internal class YourCustomAttribute : Attribute {
-
- private int _value;
-
- public YourCustomAttribute (int value)
- {
- _value = value;
- }
-
- public int Value
- {
- get {
- return _value;
- }
- }
-}
-
-[AttributeUsage(AttributeTargets.Class)]
-internal class UnusedAttribute : Attribute {
-}
-
-[MyCustomAttribute("MyBaseClass"), YourCustomAttribute(37)]
-internal class MyClass {
- int Value { get { return 42; }}
-}
-
-[MyCustomAttribute("MyDerivedClass")]
-internal class MyDerivedClass : MyClass {
- public void Do () {}
-}
-
-} // Namespace MonoTests.System.AttributeTestInternals
-
-public class AttributeTest : TestCase {
-
- public AttributeTest () : base("MonoTests.System.AttributeTest testcase") {}
- public AttributeTest (string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(AttributeTest));
- }
- }
-
- public void TestIsDefined ()
- {
- AssertEquals ("A1", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute)));
- AssertEquals ("A2", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute)));
- AssertEquals ("A3", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute)));
- AssertEquals ("A4", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute), true));
- AssertEquals ("A5", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute), true));
- AssertEquals ("A6", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute), false));
- AssertEquals ("A7", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute), false));
- AssertEquals ("A8", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute), false));
- AssertEquals ("A9", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute), false));
- }
-
-/*
- public static void TestIsDefaultAttribute ()
- {
- Console.WriteLine(">>>IsDefaultAttribute");
-
- Attribute a = Attribute.GetCustomAttribute(typeof(MyClass), typeof(MyCustomAttribute));
- Console.WriteLine (a.IsDefaultAttribute() );
- }
-
- private static void WriteAttribute (Attribute a)
- {
- if (a == null) {
- Console.WriteLine ("NULL");
- }
- else {
- Console.WriteLine (a);
- }
- }
-*/
-
- public void TestGetCustomAttribute ()
- {
- int i = 1;
- Type t = typeof(MyDerivedClass);
- try {
- AssertEquals ("A1", "MyDerivedClass", ((MyCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(MyCustomAttribute), false))).Info);
- i++;
- AssertEquals ("A2", null, ((YourCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(YourCustomAttribute), false))));
- i++;
- AssertEquals ("A3", "MyDerivedClass", ((MyCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(MyCustomAttribute)))).Info);
- i++;
- AssertEquals ("A4", 37, ((YourCustomAttribute) (Attribute.GetCustomAttribute(t, typeof(YourCustomAttribute)))).Value);
- } catch (Exception e) {
- Fail ("Unexpected exception thrown at i=" + i + " with t=" + t + ". e=" + e);
- }
- }
-/*
-
- public static void WriteAttributes (Attribute[] attrs)
- {
- Console.WriteLine("length = {0}", attrs.Length);
- foreach (Attribute a in attrs) {
- WriteAttribute (a);
- }
- }
-
-
- private static void TestGetCustomAttributes ()
- {
- Console.WriteLine(">>>GetCustomAttributes");
-
-
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute)));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute), true));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute), false));
-
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass)));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), true));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), false));
- }
-
-*/
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/BitConverterTest.cs b/mcs/class/corlib/Test/System/BitConverterTest.cs
deleted file mode 100755
index 6510b83255e..00000000000
--- a/mcs/class/corlib/Test/System/BitConverterTest.cs
+++ /dev/null
@@ -1,545 +0,0 @@
-//
-// BitConverterTest.cs - NUnit Test Cases for System.BitConverter
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class BitConverterTest : TestCase {
-
- public BitConverterTest () : base ("System.BitConverter testsuite") {}
- public BitConverterTest (string name) : base(name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof(BitConverterTest));
- }
- }
-
- public void TestIsLittleEndian ()
- {
- byte[] b;
-
- b = BitConverter.GetBytes (1);
- AssertEquals ("A1", b[0] == 1, BitConverter.IsLittleEndian );
- }
-
- private void PrivateTestSingle (float v1)
- {
- float v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 4, b.Length);
-
- v2 = BitConverter.ToSingle (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToSingle (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToSingle (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToSingle ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestSingle()
- {
- PrivateTestSingle (0.1f);
- PrivateTestSingle (24.1e30f);
- }
-
- private void PrivateTestDouble (double v1)
- {
- double v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 8, b.Length);
-
- v2 = BitConverter.ToDouble (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToDouble (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToDouble (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToDouble ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestDouble ()
- {
- double d = 123.321;
-
- AssertEquals("A1", d, BitConverter.Int64BitsToDouble (BitConverter.DoubleToInt64Bits (d)));
-
- PrivateTestDouble (0.1);
- PrivateTestDouble (24.1e77);
- }
-
- private void PrivateTestBool (bool v1)
- {
- bool v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 1, b.Length);
-
- v2 = BitConverter.ToBoolean (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToBoolean (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToBoolean (larger, 4);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToBoolean ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestBool () {
- PrivateTestBool(true);
- PrivateTestBool(false);
- }
-
- private void PrivateTestChar (char v1)
- {
- char v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToChar (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToChar (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToChar (larger, 3);
- exception = false;
- }
- // LAMESPEC:
- // the docs say it should be ArgumentOutOfRangeException, but
- // the mscorlib throws an ArgumentException.
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToChar ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestChar ()
- {
- PrivateTestChar('A');
- PrivateTestChar('\x01ff');
- }
-
- private void PrivateTestInt16 (short v1)
- {
- short v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToInt16 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt16 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt16 (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt16 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt16 ()
- {
- PrivateTestInt16 (0);
- PrivateTestInt16 (1000);
- PrivateTestInt16 (-32768);
- PrivateTestInt16 (32767);
- }
-
- private void PrivateTestUInt16 (ushort v1)
- {
- ushort v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToUInt16 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt16 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt16 (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt16 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt16 ()
- {
- PrivateTestUInt16 (0);
- PrivateTestUInt16 (1000);
- PrivateTestUInt16 (65535);
- }
-
- private void PrivateTestInt32 (int v1)
- {
- int v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 4, b.Length);
-
- v2 = BitConverter.ToInt32 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt32 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt32 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt32 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt32 ()
- {
- PrivateTestInt32 (0);
- PrivateTestInt32 (1000);
- PrivateTestInt32 (-2147483648);
- PrivateTestInt32 (2147483647);
- }
-
- private void PrivateTestUInt32 (uint v1)
- {
- uint v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals ("A1", 4, b.Length);
-
- v2 = BitConverter.ToUInt32 (b, 0);
- AssertEquals ("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt32 (larger, 1);
- AssertEquals ("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt32 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt32 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt32 ()
- {
- PrivateTestUInt32 (0u);
- PrivateTestUInt32 (1000u);
- PrivateTestUInt32 (4294967295u);
- }
-
- private void PrivateTestInt64 (long v1)
- {
- long v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals ("A1", 8, b.Length);
-
- v2 = BitConverter.ToInt64 (b, 0);
- AssertEquals ("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt64 (larger, 1);
- AssertEquals ("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt64 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt64 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt64 ()
- {
- PrivateTestInt64 (0);
- PrivateTestInt64 (1000);
- PrivateTestInt64 (-9223372036854775808);
- PrivateTestInt64 (9223372036854775807);
- }
-
- private void PrivateTestUInt64 (ulong v1)
- {
- ulong v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 8, b.Length);
-
- v2 = BitConverter.ToUInt64 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt64 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt64 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt64 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt64 ()
- {
- PrivateTestUInt64 (0);
- PrivateTestUInt64 (1000);
- PrivateTestUInt64 (18446744073709551615);
- }
-
- public void TestToString ()
- {
- string s;
- bool exception;
-
- byte[] b = new byte[] {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
-
- AssertEquals ("A1", "00-11-22-33-44-55-66-77-88-99-AA-BB-CC-DD-EE-FF", BitConverter.ToString (b));
- AssertEquals ("A2", "66-77-88-99-AA-BB-CC-DD-EE-FF", BitConverter.ToString (b, 6));
- AssertEquals ("A3", "66-77-88", BitConverter.ToString (b, 6, 3));
-
- try {
- s = BitConverter.ToString ((byte[]) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- s = BitConverter.ToString (b, 20);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- try {
- s = BitConverter.ToString ((byte[]) null, 20);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A6", exception);
-
- try {
- s = BitConverter.ToString (b, 20, 3);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- try {
- s = BitConverter.ToString ((byte[]) null, 20, 3);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A8", exception);
-
- try {
- s = BitConverter.ToString (b, 16, 0);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A9", exception);
-
-
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/BooleanTest.cs b/mcs/class/corlib/Test/System/BooleanTest.cs
deleted file mode 100644
index a7bae95c993..00000000000
--- a/mcs/class/corlib/Test/System/BooleanTest.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Boolean class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class BooleanTest : TestCase
-{
- public BooleanTest () : base ("MonoTests.System.BooleanTests testcase") {}
- public BooleanTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (BooleanTest));
- }
- }
-
- public void TestStrings ()
- {
- AssertEquals("Wrong False string", "False", Boolean.FalseString);
- AssertEquals("Wrong True string", "True", Boolean.TrueString);
- }
-
- public void TestCompareTo() {
- Boolean t=true,f=false;
- String s = "What Ever";
- AssertEquals("CompareTo Failed", true, f.CompareTo(t) < 0);
- AssertEquals("CompareTo Failed", 0, f.CompareTo(f));
- AssertEquals("CompareTo Failed", 0, t.CompareTo(t));
- AssertEquals("CompareTo Failed", true, t.CompareTo(f) > 0);
- AssertEquals("CompareTo Failed", true, t.CompareTo(null) > 0);
- try {
- t.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals() {
- Boolean t=true, f=false;
- String s = "What Ever";
- AssertEquals("Equals Failed", true, t.Equals(t));
- AssertEquals("Equals Failed", true, f.Equals(f));
- AssertEquals("Equals Failed", false, f.Equals(t));
- AssertEquals("Equals Failed", false, t.Equals(null));
- AssertEquals("Equals Failed", false, t.Equals(s));
- }
-
- public void TestGetHashCode() {
- Boolean t=true, f=false;
- AssertEquals("GetHashCode True failed", 1, t.GetHashCode());
- AssertEquals("GetHashCode True failed", 0, f.GetHashCode());
- }
-
- public void TestGetType() {
- Boolean t=true, f=false;
- AssertEquals("GetType failed", true, Object.ReferenceEquals(t.GetType(), f.GetType()));
- }
-
- public void TestGetTypeCode() {
- Boolean b=true;
- AssertEquals("GetTypeCode failed", TypeCode.Boolean, b.GetTypeCode());
- }
-
- public void TestParse() {
- AssertEquals("Parse True failed", true, Boolean.Parse("True"));
- AssertEquals("Parse True failed", true, Boolean.Parse(" True"));
- AssertEquals("Parse True failed", true, Boolean.Parse("True "));
- AssertEquals("Parse True failed", true, Boolean.Parse("tRuE"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False"));
- AssertEquals("Parse False failed", false, Boolean.Parse(" False"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False "));
- AssertEquals("Parse False failed", false, Boolean.Parse("fAlSe"));
-
- try {
- Boolean.Parse("not-t-or-f");
- Fail("Parse should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.FormatException", typeof(FormatException) == e.GetType());
- }
-
- try {
- Boolean.Parse(null);
- Fail("Parse should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- }
-
- public void TestToString() {
- Boolean t=true,f=false;
- AssertEquals("ToString True Failed", Boolean.TrueString, t.ToString());
- AssertEquals("ToString False Failed", Boolean.FalseString, f.ToString());
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ByteTest.cs b/mcs/class/corlib/Test/System/ByteTest.cs
deleted file mode 100644
index 751d5c22517..00000000000
--- a/mcs/class/corlib/Test/System/ByteTest.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-// ByteTest.cs - NUnit Test Cases for the System.Byte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class ByteTest : TestCase
-{
- private const Byte MyByte1 = 42;
- private const Byte MyByte2 = 0;
- private const Byte MyByte3 = 255;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "255";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = { "",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results1_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
- private string[] Results2_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public ByteTest() : base ("MonoTests.System.ByteTests testcase") {}
- public ByteTest(string name) : base(name) {}
-
- protected override void SetUp() {
- int cdd = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- string csym = NumberFormatInfo.CurrentInfo.CurrencySymbol;
- string csuffix = (cdd > 0 ? "." : "").PadRight(cdd + (cdd > 0 ? 1 : 0), '0');
- Results1[0] = csym + "0" + csuffix;
- }
-
- protected override void TearDown () {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(Byte.MinValue, MyByte2);
- AssertEquals(Byte.MaxValue, MyByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyByte3.CompareTo(MyByte2) > 0);
- Assert(MyByte2.CompareTo(MyByte2) == 0);
- Assert(MyByte1.CompareTo((Byte)42) == 0);
- Assert(MyByte2.CompareTo(MyByte3) < 0);
- try {
- MyByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyByte1.Equals(MyByte1));
- Assert(MyByte1.Equals((Byte)42));
- Assert(MyByte1.Equals((Int16)42) == false);
- Assert(MyByte1.Equals(MyByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyByte1.GetHashCode();
- MyByte2.GetHashCode();
- MyByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("MyByte1="+MyByte1+", MyString1="+MyString1+", Parse="+Byte.Parse(MyString1) , MyByte1 == Byte.Parse(MyString1));
- Assert("MyByte2", MyByte2 == Byte.Parse(MyString2));
- Assert("MyByte3", MyByte3 == Byte.Parse(MyString3));
-
- try {
- Byte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Should get ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Byte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("not-a-number", typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Byte.MaxValue + 1;
- Byte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("OverflowException", typeof(OverflowException) == e.GetType());
- }
-
- //test Parse(string s, NumberStyles style)
- AssertEquals(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ",
- (byte)42, Byte.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ",
- NumberStyles.Currency));
- try {
- Byte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 and NumberStyles.Integer", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(" 42 and Nfi", 42 == Byte.Parse(" 42 ", Nfi));
- try {
- Byte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("%42 and Nfi", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert("NumberStyles.HexNumber", 16 == Byte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Byte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42, NumberStyles.Integer, Nfi", typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals("Compare failed for MyString1 and MyByte1", MyString1, MyByte1.ToString());
- AssertEquals("Compare failed for MyString2 and MyByte2", MyString2, MyByte2.ToString());
- AssertEquals("Compare failed for MyString3 and MyByte3", MyString3, MyByte3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"]", Results1[i], MyByte2.ToString(Formats1[i]));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"]", Results2[i], MyByte3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"] with Nfi", Results1_Nfi[i], MyByte2.ToString(Formats1[i], Nfi));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"] with Nfi", Results2_Nfi[i], MyByte3.ToString(Formats2[i], Nfi));
- }
- try {
- MyByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- AssertEquals("Exception is the wrong type", typeof(FormatException), e.GetType());
- }
-
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
deleted file mode 100644
index 0f6fe6db0d0..00000000000
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ /dev/null
@@ -1,468 +0,0 @@
-2002-06-20 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest2.cs: Make tests pass against ms.net.
-
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: DecimalTest2
- * DecimalTest2.cs: Convert Console.Writeline() into a Fail()
-
-2002/06/14 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Make currency symbol test more culturally sensitive.
-
-2002-06-14 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: Make some of the tests a bit more timezone neutral.
-
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * ConvertTest.cs: Punt bug in DateTime.Parse() over to that test.
- * DateTimeTest.cs: Add test for date format of yyyy-mm-dd which mono
- doesn't handle automagically like ms.net does. This smells like a
- LAMESPEC, however.
-
-2002/06/12 Nick Drochak <ndrochak@gol.com>
-
- * RandomTest.cs: Exercise Next(min,max) a little more, especially
- boundary conditions.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Check for "end of string" conditions for IndexOf() and
- Substring().
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * DoubleTest.cs: Add some more detail to failure message.
- * Int64Test.cs: Add some details, and fix a copy-paste error.
- * UInt32Test.cs: Fix currency symbol/culture issues
- * UInt64Test.cs: Fix currency symbol/culture issues
-
-2002/06/11 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: Remove RunTest override and put culture manipulation
- in SetUp and TearDown like the other tests.
- * TimeZoneTest.cs: Same.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Set the culture to en-US for testing.
- * MathTest.cs: mono is more precise in Log2, so change test to compare
- values within a slightly larger margin of error.
-
-2002/06/10 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: More culture indepenence. Fixes the problems we were
- having with tests failing against MS.NET.
- * Int64Test.cs: Same plus some formatting fixes.
- * RandomTest.cs: Split Assert into two to figure out which one part is
- failing.
-
-2002-06-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTimeTest.cs: Making tests culture independent
-
-2002-06-07 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Catch unexpected exception and report it.
-
-2002/06/04 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Fix currency constant that we use for the expected
- value. Try to be more culture-diverse.
-
-2002/06/03 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Fix some errors that were showing up when run against
- ms.net.
-
-2002-06-02 Nick Drochak <ndrochak@gol.com>
-
- * ConvertTest.cs: Use en-US culture since that's all we support in our
- corlib right now. Change constants accordingly. Also added a bunch of
- try-catch blocks to show which Assert is failing.
-
-2002-06-02 Duncan Mak <duncan@ximian.com>
-
- * ConvertTest.cs (TestToDecimal): Fixed typo in case #H11.
-
-2002-06-01 Nick Drochak <ndrochak@gol.com>
-
- * BugTest.cs: Remove, bug fixed. Yay!
- * AllTests.cs: Remove BugTest from suite.
-
-2002-05-31 Nick Drochak <ndrochak@gol.com>
-
- * BugTest.cs: Small file to show NullReferenceException bug
- * AllTests.cs: Include BugTest.cs in the suite.
-
-2002-05-29 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Use AssertEquals to get nice error report, and mark
- each one with a unique message string so we know which one failed.
-
-2002-05-29 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTimeTest.cs: Added tests M01 to M03 to TestParseExact,
- passing typeof this class as arg in property Suite.
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * ConsoleTest.cs: Added test writing null.
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * MathTest.cs:
- (TestPow): Add try-catch to determine where we are throwing.
- (TestLog): Re-enable failing test
- (TestLog2): same although this test still fails on mono. Not
- sure what the proper value to use here. It works on MS.NET
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * MathTest.cs: Better reporting of failures
- * Int64Test.cs: Add try-catch to determine where we are throwing.
-
-2002-05-20 Nick Drochak <ndrochak@gol.com>
-
- * AttributeTest.cs (TestGetCustomAttribute): Add try-catch to find out
- which assert is failing.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: Removed.
-
-2002-05-14 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: A couple more tests
-
-2002-05-07 Nick Drochak <ndrochak@gol.com>
-
- * ExceptionTest.cs: New File. Provided by Linus Upson.
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * StringTest.cs: Added test for replace function
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * UInt32Test.cs: More verbose on unexepected exception to eliminate
- compiler warning.
-
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Mark Assert() messages with unique identifiers.
- * DecimalTest2.cs: Write out more info in the Report method. Need this
- to determine why op_Subtraction() is failing in the next line.
- * MathTest.cs:
- * DoubleTest.cs:
- * UInt32Test.cs: Add try-catch blocks to find out where the test is
- failing.
-
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs (TestIList_IndexOf): Display exception details if we get
- an unexpected one.
-
-2002/04/24 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatterTest.cs: Remove Console.WriteLines and use
- AssertEquals() instead.
-
-2002-04-22 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Add unique markers to Assert messages.
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Remove BinarySearch test on unsorted arrays. The
- behavior is undefined if the array isn't sorted.
-
-2002/04/09 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Use AssertEquals() for better diagnostic message.
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Use AssertEquals() for better diagnostic message.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Add a few tests for differently underlying types and
- the [Flags] attribute to test ToString().
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Add test for ToString for the case where the enum
- has [Flags] on it, and a mask value is used.
-
-2002-04-04 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Change one Assert() message string so the two are
- unique. And clean up exception catching logic.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatterTest.cs: Eliminate warnings about unused exception
- variables.
-
-2002-03-28 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs(TestFormat): Use Fail() instead of AssertEquals() in
- try-catch blocks. Add test to check if correct exception is being
- thrown.
-
-2002/03/18 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs:
- * Int64Test.cs:
- * SByteTest.cs: Do not hard code the "$" as the currency symbol to
- use for Parse tests. This isn not really the fix we need. These
- number formats vary wildly depending on the culture the system
- runs with. We need a much better strategy here for testing this.
- * Int32Test.cs: Use #if NOTYET-#endif to disable a test. This removes
- an annoying compile warning.
-
-2002-03-18 Nick Drochak <ndrochak@gol.com>
-
- * DoubleTest.cs:
- * EnumTest.cs: Add unique identifier to Assert()'s. Needed to find
- which one was faling on Linux.
-
-2002-03-12 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Add tests for IList methods and for enumerator on
- an array with non-zero lower bounds.
-
-2002-03-09 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Enable the enumerator test and include test for
- Multi-dimensional array enumerator. Also include test for
- mutation _not_ invalidating the enumerator.
-
-2002-03-09 Martin Baulig <martin@gnome.org>
-
- * Int16Test.cs, Int32Tests.cs, UInt16Tests.cs: Use "en-US" culture and
- don't let the user override.
-
- * Int32Tests.cs: Cleanup. Use unique names in Assert()s, use AssertEquals()
- where appropriate etc.
-
-2002-03-08 Martin Baulig <martin@gnome.org>
-
- * StringTest.cs: More String.Split tests.
-
-2002-03-07 Martin Baulig <martin@gnome.org>
-
- * StringTest.cs: Added a few more tests for the bug fixes I just
- committed to String.cs.
-
-2002-03-07 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Fixed the FIXME in test #E05.
-
-2002-03-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * CharEnumeratorTest.cs: made test regarding out-of-bounds checking
- a bit stronger (new failures fixed in CharEnumerator.cs).
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs (TestSetValue4): Added testcases #M94-#M96 for Array.Copy.
-
- * ArrayTest.cs (TestCopyTo): Added testcases #F10-#F13 for arrays with
- non-zero lower bounds.
-
- * ArrayTest.cs (TestCopyTo): Added test for copying an empty array
- to an empty array.
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Use unique labels for all the tests.
- (TestSetValue4): A big new testcase.
-
-2002-03-06 Nick Drochak <ndrochak@gol.com>
-
- * VersionTest.cs: Fix for mscorlib behavior vs. docs. CompareTo(null)
- is legal.
- * UInt16Test.cs:
- * UInt32Test.cs:
- * UInt64Test.cs: Use NumberFormatInfo.InvariantInfo.CurrencySymbol
- where "$" was used. Should help suppress false negatives on systems
- where "$" is not the currency symbol.
-
-2002-03-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * VersionTest.cs: created test cases for System.Version
-
-2002-03-03 Duco Fijma <duco@lorentz.xs4all.nl>
- * CharEnumeratorTest.cs: completed the test cases
-
-2002-03-03 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: make static member non-static -- wouldn't work on
- Windows if it was static. Doesn't _need_ to be static anyway.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
- * AttributeTest.cs: created, far from complete.
- * CharEnumeratorTest.cs: created. Contains just the basic case.
- * AllTests.cs: added the two new tests above
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
- * BitConverterTest.cs: added one test for bug fix made to BitConverter
- * class.
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Commented out a few bits which are not yet implemented and
- marked them with FIXME's.
-
- * DecimalTest.cs, DecimalTest2.cs: Added zero-arg constructors.
-
- * MartinTests.cs: Enabled ArrayTests.cs.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * BitConverterTest.cs: completed test cases
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: 15 tests currently work on Linux, call them all and
- provide comments for the non-working tests.
-
-2002-02-28 Duncan Mak <duncan@ximian.com>
-
- * MathTest.cs: Committed for Jon Guymon <gnarg@slackworks.com>.
-
-2002-02-28 Martin Baulig <martin@gnome.org>
-
- * String.cs (TestCompare): Added a few tests.
- (TestFormat): Please don't compare two strings with Assert (... == ...),
- use AssertEquals instead - this gives you a better idea what went wrong
- if the test fails.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * BitConverterTest.cs: Test was trying to catch the wrong Exception.
- The MSDN docs clearly say ArgumentOutOfRangeException, but that's
- not what get's thrown.
-
- * DoubleTest.cs: Get working against mscorlib reference.
-
-2002-02-27 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: changed to reflect new meaning of Guid.ToString("")
- and Guid.ToString(null)
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the test which already
- work on Linux.
-
- * String.cs: Added two testcases to TestTrim(), TestTrimStart() and
- TestTrimEnd().
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: Added testcases for the parsers. Use the invariant
- culture to run this test suite.
-
- * TimeZoneTest.cs: Use the invariant culture to run this test suite.
-
-2002-02-26 Duco Fijma <duco@lorentz.xs4all>
- * TimeSpanTest.cs: added test from TimeSpan.FromMilliseconds
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: New test.
-
- * TimeZoneTest.cs: New test.
-
-2002-02-25 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: all methods of System.Guid are now covered
- * BitConverterTest.cs: created, not yet complete
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: changed according to fix in System.Guid
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: One array was giving us trouble. Not sure why, but
- it's related to the number of elements in an Array. For short Arrays
- the compiler doesn't use the PrivateImplmentationDetails struct,
- but for longer ones it does. That's when our corlib fails. I paired
- down the array for now.
-
-2002-02-19 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: added a few cases
-
-2002-02-18 Nick Drochak <ndrochak@gol.com>
-
- * GuidTest.cs: Fix compile error. Needed to cast the null in the call to
- constructor to avoid ambiguity.
-
-2002-02-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Various fixes to make tests work against the ms corlib.
- Currency Symbol tests seem to be system dependant. Not sure if this
- will work on other systems, so please test it if you can. The most
- disturbing one is negative numbers. Should they be (n) or -n ?
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add Int64Test to the Suite
- * Int64Test.cs: Change static member to instance member. This was
- causing NUnitConsole some grief. Should be instance member anyway.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs:
- * Int16Test.cs:
- * Int32Test.cs:
- * SByteTest.cs:
- * UInt16Test.cs:
- * UInt32Test.cs:
- * UInt64Test.cs: Fixed tests where a "$" was hard coded. Change it to
- use NumberFormatInfo.CurrentInfo.CurrencySymbol. Also used
- NumberFormatInfo.InvariantInfo.CurrencySymbol where appropriate. These
- tests all pass now with mscorlib.
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgsTest.cs: New test.
- * AllTests.cs: Added new test to suite.
-
-2001-12-27 Nick Drochak <ndrochak@gol.com>
-
- * UInt32Test.cs: Added messages to Asserts()'s to find out which one was faliing.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * UInt32Test.cs: Added tests for UInt32.Parse.
-
- * Int32Test.cs: Added tests for Int32.Parse for various cases.
-
-2001-12-08 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Added messages to Assert()'s to find out which one was failing.
-
-2001-11-28 Nick Drochak <ndrochak@gol.com>
-
- * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that rely on culture of system. These need to be crafted a bit differently.
-
-2001-11-27 Nick Drochak <ndrochak@gol.com>
-
- * SByteTest.cs: Add messages to Assert()'s so we can tell where the tests fail.
-
-2002-02-21 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Added New test suite
- * AllTests.cs: Added new Boolean test to suite.
-
-2002-02-24 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Use correct argument order in AssertEquals
- * AllTests.cs: Added new Double test to suite.
- * DoubleTest.cs: Add new test suite
-
-2002-02-24 Bob Doan <bdoan@sicompos.com>
-
- * DoubleTest.cs: Added parse tests to Double test suite, removed GetHashCodeTests
diff --git a/mcs/class/corlib/Test/System/CharEnumeratorTest.cs b/mcs/class/corlib/Test/System/CharEnumeratorTest.cs
deleted file mode 100755
index da7fecbc221..00000000000
--- a/mcs/class/corlib/Test/System/CharEnumeratorTest.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// CharEnumeratorTest.cs - NUnit Test Cases for the System.CharEnumerator class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class CharEnumeratorTest : TestCase
-{
- public CharEnumeratorTest () : base ("MonoTests.System.CharEnumeratorTest testcase") {}
- public CharEnumeratorTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (CharEnumeratorTest));
- }
- }
-
- string _s;
-
- protected override void SetUp ()
- {
- _s = "Emma en Sophie";
- }
-
- private string GetFromEnumerator (CharEnumerator ce)
- {
- string res = "";
- bool cont = true;
-
- while (cont) {
- res += ce.Current;
- cont = ce.MoveNext ();
- }
-
- return res;
- }
-
- public void TestBasic ()
- {
- CharEnumerator ce = _s.GetEnumerator ();
-
- ce.MoveNext ();
-
- AssertEquals ("A1", _s, GetFromEnumerator (ce));
- }
-
- public void TestClone ()
- {
- CharEnumerator ce1, ce2=null;
- bool cont;
-
- ce1 = _s.GetEnumerator ();
- cont = ce1.MoveNext ();
- while (cont) {
- if (ce1.Current == 'S') {
- ce2 = (CharEnumerator) (ce1.Clone ());
- }
- cont = ce1.MoveNext ();
- }
-
- AssertEquals ("A1", "Sophie", GetFromEnumerator(ce2));
- }
-
- public void TestReadOutOfBounds ()
- {
- char c;
- bool exception;
- CharEnumerator ce = _s.GetEnumerator ();
-
- try {
- c = ce.Current;
- exception = false;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A1", exception);
-
- AssertEquals("A2", true, ce.MoveNext ());
-
- AssertEquals ("A3", _s, GetFromEnumerator (ce));
-
- try {
- c = ce.Current;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- AssertEquals("A5", false, ce.MoveNext() );
- AssertEquals("A6", false, ce.MoveNext() );
-
- ce.Reset ();
-
- try {
- c = ce.Current;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- AssertEquals ("A8", true, ce.MoveNext ());
-
- AssertEquals ("A9", _s, GetFromEnumerator (ce));
-
- AssertEquals ("A10", false, ce.MoveNext ());
- AssertEquals ("A11", false, ce.MoveNext ());
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/CharTest.cs b/mcs/class/corlib/Test/System/CharTest.cs
deleted file mode 100644
index 3f89fd24381..00000000000
--- a/mcs/class/corlib/Test/System/CharTest.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-// CharTest.cs - NUnit Test Cases for the System.Char struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class CharTest : TestCase
-{
- public CharTest() : base ("MonoTests.System.CharTest testsuite") {}
- public CharTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CharTest));
- }
- }
-
- public void TestCompareTo()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Less than", c1.CompareTo(c2) == -1);
- Assert("Greater than", c2.CompareTo(c1) == 1);
- Assert("Equal 1", c2.CompareTo(c3) == 0);
- Assert("Equal 2", c1.CompareTo(c1) == 0);
- }
-
- public void TestEquals()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Same", c1.Equals(c1));
- Assert("Same value", c2.Equals(c3));
- Assert("Not same", !c1.Equals(c2));
- }
-
- public void TestGetHashValue()
- {
- Char c1 = ' ';
- AssertEquals("deterministic hash code ", c1.GetHashCode(), c1.GetHashCode());
- // TODO - the spec doesn't say what algorithm is used to get hash codes. So far, just a weak test for determinism and mostly-uniqueness.
- }
-
- public void TestGetNumericValue()
- {
- Char c1 = ' ';
- Char c2 = '3';
- AssertEquals("code 1", -1.0, Char.GetNumericValue(c1), 0.1);
- AssertEquals("code 2", 3.0, Char.GetNumericValue(c2), 0.1);
-
- string s1 = " 3 ";
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 0), 0.1);
- AssertEquals("space not number", 3.0, Char.GetNumericValue(s1, 1), 0.1);
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 2), 0.1);
- }
-
- public void TestGetUnicodeCategory()
- {
- {
- char Pe1 = ']';
- char Pe2 = '}';
- char Pe3 = ')';
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe1));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe2));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe3));
- }
- // TODO - ConnectorPunctuation
- {
- char c1 = (char)0; // 0000-001F, 007F-009F
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x00F;
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c4));
- }
- {
- // TODO - more currencies?
- char c1 = '$';
- AssertEquals("Currency",
- UnicodeCategory.CurrencySymbol,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '-';
- AssertEquals("Dash Punctuation",
- UnicodeCategory.DashPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '2';
- char c2 = '7';
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - EnclosingMark
- // TODO - FinalQuotePunctuation
- // TODO - Format
- // TODO - InitialQuotePunctuation
- // TODO - LetterNumber
- // TODO - LineSeparator (not '\n', that's a control char)
- {
- char c1 = 'a';
- char c2 = 'z';
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- {
- char c1 = '+';
- char c2 = '=';
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c1));
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - ModifierSymbol
- // TODO - NonSpacingMark
- // TODO - OpenPunctuation
- {
- char c1 = '[';
- char c2 = '{';
- char c3 = '(';
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c1));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c2));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c3));
- }
- // TODO - OtherLetter
- // TODO - OtherNotAssigned
- // TODO - OtherNumber
- {
- char c1 = '/';
- AssertEquals("OtherPunctuation",
- UnicodeCategory.OtherPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - OtherSymbol
- // TODO - ParagraphSeparator
- // TODO - PrivateUse
- {
- char c1 = ' ';
- AssertEquals("SpaceSeparator",
- UnicodeCategory.SpaceSeparator,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - SpacingCombiningMark
- {
- char c1 = (char)0xD800; // D800-DBFF
- char c2 = (char)0xDBFF; // D800-DBFF
- char c3 = (char)0xDC01; // DC00-DEFF
- char c4 = (char)0xDEFF; // DC00-DEFF
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c1));
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c4));
- }
- // TODO - TitlecaseLetter
- // TODO - UppercaseLetter
- {
- char c1 = 'A';
- char c2 = 'Z';
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- }
-
- public void TestIsControl()
- {
- // control is 0000-001F, 007F-009F
- char c1 = (char)0;
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x009F;
- Assert("Not control", !Char.IsControl(' '));
- Assert("control", Char.IsControl(c1));
- Assert("control", Char.IsControl(c2));
- Assert("control", Char.IsControl(c3));
- Assert("control", Char.IsControl(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not control", !Char.IsControl(s1, 0));
- Assert("control", Char.IsControl(s1, 1));
- Assert("control", Char.IsControl(s1, 2));
- Assert("control", Char.IsControl(s1, 3));
- Assert("control", Char.IsControl(s1, 4));
- }
-
- public void TestIsDigit()
- {
- char c1 = '0';
- char c2 = '9';
- Assert("Not digit", !Char.IsDigit(' '));
- Assert("digit", Char.IsDigit(c1));
- Assert("digit", Char.IsDigit(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not digit", !Char.IsDigit(s1, 0));
- Assert("digit", Char.IsDigit(s1, 1));
- Assert("digit", Char.IsDigit(s1, 2));
- }
-
- public void TestIsLetter()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- Assert("Not letter", !Char.IsLetter(' '));
- Assert("letter", Char.IsLetter(c1));
- Assert("letter", Char.IsLetter(c2));
- Assert("letter", Char.IsLetter(c3));
- Assert("letter", Char.IsLetter(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not letter", !Char.IsLetter(s1, 0));
- Assert("letter", Char.IsLetter(s1, 1));
- Assert("letter", Char.IsLetter(s1, 2));
- Assert("letter", Char.IsLetter(s1, 3));
- Assert("letter", Char.IsLetter(s1, 4));
- }
-
- public void TestIsLetterOrDigit()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- char c5 = '0';
- char c6 = '9';
- Assert("Not letterordigit", !Char.IsLetterOrDigit(' '));
- Assert("letterordigit", Char.IsLetterOrDigit(c1));
- Assert("letterordigit", Char.IsLetterOrDigit(c2));
- Assert("letterordigit", Char.IsLetterOrDigit(c3));
- Assert("letterordigit", Char.IsLetterOrDigit(c4));
- Assert("letterordigit", Char.IsLetterOrDigit(c5));
- Assert("letterordigit", Char.IsLetterOrDigit(c6));
-
- string s1 = " " + c1 + c2 + c3 + c4 + c5 + c6;
- Assert("Not letterordigit", !Char.IsLetterOrDigit(s1, 0));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 1));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 2));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 3));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 4));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 5));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 6));
- }
-
- public void TestIsLower()
- {
- char c1 = 'a';
- char c2 = 'z';
- Assert("Not lower", !Char.IsLower(' '));
- Assert("lower", Char.IsLower(c1));
- Assert("lower", Char.IsLower(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not lower", !Char.IsLower(s1, 0));
- Assert("lower", Char.IsLower(s1, 1));
- Assert("lower", Char.IsLower(s1, 2));
- }
-
- public void TestIsNumber()
- {
- char c1 = '0';
- char c2 = '9';
- // TODO - IsNumber of less obvious characters
-
- Assert("Not number", !Char.IsNumber(' '));
- Assert("number", Char.IsNumber(c1));
- Assert("number", Char.IsNumber(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not number", !Char.IsNumber(s1, 0));
- Assert("number", Char.IsNumber(s1, 1));
- Assert("number", Char.IsNumber(s1, 2));
- }
-
- public void TestIsPunctuation()
- {
- char c1 = '.';
- char c2 = '?';
- Assert("Not punctuation", !Char.IsPunctuation(' '));
- Assert("punctuation", Char.IsPunctuation(c1));
- Assert("punctuation", Char.IsPunctuation(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not punctuation", !Char.IsPunctuation(s1, 0));
- Assert("punctuation", Char.IsPunctuation(s1, 1));
- Assert("punctuation", Char.IsPunctuation(s1, 2));
- }
-
- public void TestIsSeparator()
- {
- char c1 = ' ';
-
- Assert("Not separator", !Char.IsSeparator('.'));
- Assert("separator1", Char.IsSeparator(c1));
-
- string s1 = "." + c1;
- Assert("Not separator", !Char.IsSeparator(s1, 0));
- Assert("separator1-2", Char.IsSeparator(s1, 1));
- }
-
- public void TestIsSurrogate()
- {
- // high surrogate - D800-DBFF
- // low surrogate - DC00-DEFF
- char c1 = (char)0xD800;
- char c2 = (char)0xDBFF;
- char c3 = (char)0xDC00;
- char c4 = (char)0xDEFF;
- Assert("Not surrogate", !Char.IsSurrogate(' '));
- Assert("surrogate1", Char.IsSurrogate(c1));
- Assert("surrogate2", Char.IsSurrogate(c2));
- Assert("surrogate3", Char.IsSurrogate(c3));
- Assert("surrogate4", Char.IsSurrogate(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not surrogate", !Char.IsSurrogate(s1, 0));
- Assert("surrogate1-2", Char.IsSurrogate(s1, 1));
- Assert("surrogate2-2", Char.IsSurrogate(s1, 2));
- Assert("surrogate3-2", Char.IsSurrogate(s1, 3));
- Assert("surrogate4-2", Char.IsSurrogate(s1, 4));
- }
-
- public void TestIsSymbol()
- {
- char c1 = '+';
- char c2 = '=';
- Assert("Not symbol", !Char.IsSymbol(' '));
- Assert("symbol", Char.IsSymbol(c1));
- Assert("symbol", Char.IsSymbol(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not symbol", !Char.IsSymbol(s1, 0));
- Assert("symbol", Char.IsSymbol(s1, 1));
- Assert("symbol", Char.IsSymbol(s1, 2));
- }
-
- public void TestIsUpper()
- {
- char c1 = 'A';
- char c2 = 'Z';
- Assert("Not upper", !Char.IsUpper('a'));
- Assert("upper", Char.IsUpper(c1));
- Assert("upper", Char.IsUpper(c2));
-
- string s1 = "a" + c1 + c2;
- Assert("Not upper", !Char.IsUpper(s1, 0));
- Assert("upper", Char.IsUpper(s1, 1));
- Assert("upper", Char.IsUpper(s1, 2));
- }
-
- public void TestIsWhiteSpace()
- {
- char c1 = ' ';
- char c2 = '\n';
- char c3 = '\t';
-
- Assert("Not whitespace", !Char.IsWhiteSpace('.'));
- Assert("whitespace1", Char.IsWhiteSpace(c1));
- Assert("whitespace2", Char.IsWhiteSpace(c2));
- Assert("whitespace3", Char.IsWhiteSpace(c3));
-
- string s1 = "." + c1 + c2 + c3;
- Assert("Not whitespace", !Char.IsWhiteSpace(s1, 0));
- Assert("whitespace1-2", Char.IsWhiteSpace(s1, 1));
- Assert("whitespace2-2", Char.IsWhiteSpace(s1, 2));
- Assert("whitespace3-2", Char.IsWhiteSpace(s1, 3));
- }
-
-
- public void TestParse()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(c1.Equals(Char.Parse(s1)));
- }
-
- public void TestToLower()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'a';
- char b2 = 'a';
- char b3 = 'z';
- char b4 = 'z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char lowered", b1, Char.ToLower(a1));
- AssertEquals("char lowered", b2, Char.ToLower(a2));
- AssertEquals("char lowered", b3, Char.ToLower(a3));
- AssertEquals("char lowered", b4, Char.ToLower(a4));
- AssertEquals("char lowered", b5, Char.ToLower(a5));
- AssertEquals("char lowered", b6, Char.ToLower(a6));
- }
-
- public void TestToUpper()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'A';
- char b2 = 'A';
- char b3 = 'Z';
- char b4 = 'Z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char uppered", b1, Char.ToUpper(a1));
- AssertEquals("char uppered", b2, Char.ToUpper(a2));
- AssertEquals("char uppered", b3, Char.ToUpper(a3));
- AssertEquals("char uppered", b4, Char.ToUpper(a4));
- AssertEquals("char uppered", b5, Char.ToUpper(a5));
- AssertEquals("char uppered", b6, Char.ToUpper(a6));
- }
-
-
- public void TestToString()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(s1.Equals(c1.ToString()));
- }
-
- public void TestGetTypeCode()
- {
- char c1 = 'a';
- Assert(c1.GetTypeCode().Equals(TypeCode.Char));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ConsoleTest.cs b/mcs/class/corlib/Test/System/ConsoleTest.cs
deleted file mode 100644
index da949017630..00000000000
--- a/mcs/class/corlib/Test/System/ConsoleTest.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-// ConsoleTest.cs - NUnit Test Cases for the System.Console class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class ConsoleTest : TestCase
-{
- public ConsoleTest() : base ("MonoTests.System.ConsoleTest testsuite") {}
- public ConsoleTest(string name) : base(name) {}
-
- TextWriter _err;
- TextReader _in;
- TextWriter _out;
- protected override void SetUp()
- {
- _err = Console.Error;
- _in = Console.In;
- _out = Console.Out;
- }
-
- protected override void TearDown()
- {
- Console.SetError(_err);
- Console.SetIn(_in);
- Console.SetOut(_out);
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConsoleTest));
- }
- }
-
- public void TestError() {
- AssertNotNull("No error", Console.Error);
- }
-
- public void TestIn() {
- AssertNotNull("No in", Console.In);
- }
-
- public void TestOut() {
- AssertNotNull("No out", Console.Out);
- }
-
- public void TestOpenStandardError() {
- {
- Stream err = Console.OpenStandardError();
- AssertNotNull("Can't open error", err);
- }
- {
- Stream err = Console.OpenStandardError(512);
- AssertNotNull("Can't open error", err);
- }
- // Spec says these are here, MS implementation says no.
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(-1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("negative buffer error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(0);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("zero buffer error not thrown", errorThrown);
- //}
- }
-
- public void TestOpenStandardInput() {
- {
- Stream in1 = Console.OpenStandardInput();
- AssertNotNull("Can't open input", in1);
- }
- {
- Stream in1 = Console.OpenStandardInput(512);
- AssertNotNull("Can't open input", in1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestOpenStandardOutput() {
- {
- Stream out1 = Console.OpenStandardOutput();
- AssertNotNull("Can't open output", out1);
- }
- {
- Stream out1 = Console.OpenStandardOutput(512);
- AssertNotNull("Can't open output", out1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestRead() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- char val = (char) Console.Read();
- AssertEquals("Wrong read", 'T', val);
- }
-
- public void TestReadLine() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
-
- public void TestSetError() {
- {
- bool errorThrown = false;
- try {
- Console.SetError(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null error error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stderr test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetError(w);
- Console.Error.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetIn() {
- {
- bool errorThrown = false;
- try {
- Console.SetIn(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null in error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdin test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.In.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetOut() {
- {
- bool errorThrown = false;
- try {
- Console.SetOut(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null out error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdout test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
- Console.Out.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestWrite() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout write test";
- Console.Write(testStr);
- s.Position = endPos;
- String line = r.ReadToEnd();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.Write(b);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.Write(c);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // test writing a null value
- string x = null;
- Console.Write (x);
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
- public void TestWriteLine() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout writeline test";
- Console.WriteLine(testStr);
- s.Position = endPos;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.WriteLine(b);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.WriteLine(c);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // test writing a null value
- string x = null;
- Console.WriteLine (x);
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/ConvertTest.cs b/mcs/class/corlib/Test/System/ConvertTest.cs
deleted file mode 100755
index d4fc75aaca6..00000000000
--- a/mcs/class/corlib/Test/System/ConvertTest.cs
+++ /dev/null
@@ -1,2734 +0,0 @@
-// TestConvert.cs - NUnit Test Cases for System.Convert class
-//
-// Krister Hansson (ds99krha@thn.htu.se)
-// Andreas Jonsson (ds99anjn@thn.htu.se)
-//
-// (C) Krister Hansson & Andreas Jonsson
-//
-
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
- public class ConvertTest : TestCase
- {
- public ConvertTest() : base ("MonoTests.System.ConvertTest testsuite") {}
- public ConvertTest(string name) : base(name) {}
-
- bool boolTrue;
- bool boolFalse;
- byte tryByte;
- char tryChar;
- DateTime tryDT;
- decimal tryDec;
- double tryDbl;
- short tryInt16;
- int tryInt32;
- long tryInt64;
- object tryObj;
- sbyte trySByte;
- float tryFloat;
- string falseString;
- string trueString;
- string nullString;
- string tryStr;
- ushort tryUI16;
- uint tryUI32;
- ulong tryUI64;
- CultureInfo ci;
-
- protected override void SetUp() {
- boolTrue = true;
- boolFalse = false;
- tryByte = 0;
- tryChar = 'a';
- tryDT = new DateTime(2002,1,1);
- tryDec = 1234.2345m;
- tryDbl = 0;
- tryInt16 = 1234;
- tryInt32 = 12345;
- tryInt64 = 123456789012;
- tryObj = new Object();
- trySByte = 123;
- tryFloat = 1234.2345f;
- falseString = "false";
- trueString = "true";
- nullString = "null";
- tryStr = "foobar";
- tryUI16 = 34567;
- tryUI32 = 567891234;
- tryUI64 = 0;
- ci = new CultureInfo("en-US");
- ci.NumberFormat.NumberDecimalDigits = 3;
- }
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConvertTest));
- }
- }
-
- public void TestChangeType() {
- int iTest = 1;
- try {
- AssertEquals("#A01", (short)12345, Convert.ChangeType(tryInt32, typeof(short)));
- iTest++;
- AssertEquals("#A02", 'A', Convert.ChangeType(65, typeof(char)));
- iTest++;
- AssertEquals("#A03", 66, Convert.ChangeType('B', typeof(int)));
- iTest++;
- AssertEquals("#A04", ((ulong)12345), Convert.ChangeType(tryInt32, typeof(ulong)));
-
- iTest++;
- AssertEquals("#A05", true, Convert.ChangeType(tryDec, TypeCode.Boolean));
- iTest++;
- AssertEquals("#A06", 'f', Convert.ChangeType("f", TypeCode.Char));
- iTest++;
- AssertEquals("#A07", (decimal)123456789012, Convert.ChangeType(tryInt64, TypeCode.Decimal));
- iTest++;
- AssertEquals("#A08", (int)34567, Convert.ChangeType(tryUI16, TypeCode.Int32));
-
- iTest++;
- AssertEquals("#A09", (double)567891234, Convert.ChangeType(tryUI32, typeof(double), ci));
- iTest++;
- AssertEquals("#A10", (ushort)0, Convert.ChangeType(tryByte, typeof(ushort), ci));
- iTest++;
- AssertEquals("#A11", (decimal)567891234, Convert.ChangeType(tryUI32, typeof(decimal), ci));
- iTest++;
- AssertEquals("#A12", (float)1234, Convert.ChangeType(tryInt16, typeof(float), ci));
- iTest++;
- AssertEquals("#A13", null, Convert.ChangeType(null, null, ci));
-
- iTest++;
- AssertEquals("#A14", (decimal)0, Convert.ChangeType(tryByte, TypeCode.Decimal, ci));
- iTest++;
- AssertEquals("#A15", "f", Convert.ChangeType('f', TypeCode.String, ci));
- iTest++;
- AssertEquals("#A16", 'D', Convert.ChangeType(68, TypeCode.Char, ci));
- iTest++;
- AssertEquals("#A17", (long)34567, Convert.ChangeType(tryUI16, TypeCode.Int64, ci));
- iTest++;
- AssertEquals("#A18", null, Convert.ChangeType(null, TypeCode.Empty, ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ChangeType(boolTrue, typeof(char));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(tryChar, typeof(DateTime));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(ci, TypeCode.String);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(tryInt32, null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A28", typeof(ArgumentNullException), e.GetType());
- }
-
- try
- {
- Convert.ChangeType(boolTrue, typeof(DateTime), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A29", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(ci, typeof(DateTime), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A30", typeof(InvalidCastException), e.GetType());
- }
-
- /* Should throw ArgumentException but throws InvalidCastException
- try {
- Convert.ChangeType(tryUI32, typeof(FormatException), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A??", typeof(ArgumentException), e.GetType());
- }*/
-
- try {
- Convert.ChangeType(tryUI32, TypeCode.Byte, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ChangeType(boolTrue, TypeCode.Char, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(boolTrue, null, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A33", typeof(ArgumentNullException), e.GetType());
- }
- }
-
- public void TestGetTypeCode() {
- AssertEquals("#B01", TypeCode.String, Convert.GetTypeCode(tryStr));
- AssertEquals("#B02", TypeCode.UInt16, Convert.GetTypeCode(tryUI16));
- AssertEquals("#B03", TypeCode.UInt32, Convert.GetTypeCode(tryUI32));
- AssertEquals("#B04", TypeCode.UInt64, Convert.GetTypeCode(tryUI64));
- AssertEquals("#B05", TypeCode.Double, Convert.GetTypeCode(tryDbl));
- AssertEquals("#B06", TypeCode.Int16, Convert.GetTypeCode(tryInt16));
- AssertEquals("#B07", TypeCode.Int64, Convert.GetTypeCode(tryInt64));
- AssertEquals("#B08", TypeCode.Object, Convert.GetTypeCode(tryObj));
- AssertEquals("#B09", TypeCode.SByte, Convert.GetTypeCode(trySByte));
- AssertEquals("#B10", TypeCode.Single, Convert.GetTypeCode(tryFloat));
- AssertEquals("#B11", TypeCode.Byte, Convert.GetTypeCode(tryByte));
- AssertEquals("#B12", TypeCode.Char, Convert.GetTypeCode(tryChar));
- AssertEquals("#B13", TypeCode.DateTime, Convert.GetTypeCode(tryDT));
- AssertEquals("#B14", TypeCode.Decimal, Convert.GetTypeCode(tryDec));
- AssertEquals("#B15", TypeCode.Int32, Convert.GetTypeCode(tryInt32));
- AssertEquals("#B16", TypeCode.Boolean, Convert.GetTypeCode(boolTrue));
- }
-
- public void TestIsDBNull() {
- AssertEquals("#C01", false, Convert.IsDBNull(tryInt32));
- AssertEquals("#C02", true, Convert.IsDBNull(Convert.DBNull));
- AssertEquals("#C03", false, Convert.IsDBNull(boolTrue));
- AssertEquals("#C04", false, Convert.IsDBNull(tryChar));
- AssertEquals("#C05", false, Convert.IsDBNull(tryFloat));
- }
-
- public void TestToBoolean() {
- tryObj = (object)tryDbl;
-
- AssertEquals("#D01", true, Convert.ToBoolean(boolTrue));
- AssertEquals("#D02", false, Convert.ToBoolean(tryByte));
- AssertEquals("#D03", true, Convert.ToBoolean(tryDec));
- AssertEquals("#D04", false, Convert.ToBoolean(tryDbl));
- AssertEquals("#D05", true, Convert.ToBoolean(tryInt16));
- AssertEquals("#D06", true, Convert.ToBoolean(tryInt32));
- AssertEquals("#D07", true, Convert.ToBoolean(tryInt64));
- AssertEquals("#D08", false, Convert.ToBoolean(tryObj));
- AssertEquals("#D09", true, Convert.ToBoolean(trySByte));
- AssertEquals("#D10", true, Convert.ToBoolean(tryFloat));
- AssertEquals("#D11", true, Convert.ToBoolean(trueString));
- AssertEquals("#D12", false, Convert.ToBoolean(falseString));
- AssertEquals("#D13", true, Convert.ToBoolean(tryUI16));
- AssertEquals("#D14", true, Convert.ToBoolean(tryUI32));
- AssertEquals("#D15", false, Convert.ToBoolean(tryUI64));
- AssertEquals("#D16", false, Convert.ToBoolean(tryObj,ci));
- AssertEquals("#D17", true, Convert.ToBoolean(trueString, ci));
- AssertEquals("#D18", false, Convert.ToBoolean(falseString, ci));
-
- try {
- Convert.ToBoolean(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D22", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(nullString);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D23", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToByte() {
-
- AssertEquals("#E01", (byte)1, Convert.ToByte(boolTrue));
- AssertEquals("#E02", (byte)0, Convert.ToByte(boolFalse));
- AssertEquals("#E03", tryByte, Convert.ToByte(tryByte));
- AssertEquals("#E04", (byte)114, Convert.ToByte('r'));
- AssertEquals("#E05", (byte)201, Convert.ToByte((decimal)200.6));
- AssertEquals("#E06", (byte)125, Convert.ToByte((double)125.4));
- AssertEquals("#E07", (byte)255, Convert.ToByte((short)255));
- AssertEquals("#E08", (byte)254, Convert.ToByte((int)254));
- AssertEquals("#E09", (byte)34, Convert.ToByte((long)34));
- AssertEquals("#E10", (byte)1, Convert.ToByte((object)boolTrue));
- AssertEquals("#E11", (byte)123, Convert.ToByte((float)123.49f));
- AssertEquals("#E12", (byte)57, Convert.ToByte("57"));
- AssertEquals("#E13", (byte)75, Convert.ToByte((ushort)75));
- AssertEquals("#E14", (byte)184, Convert.ToByte((uint)184));
- AssertEquals("#E15", (byte)241, Convert.ToByte((ulong)241));
- AssertEquals("#E16", (byte)123, Convert.ToByte(trySByte, ci));
- AssertEquals("#E17", (byte)27, Convert.ToByte("011011", 2));
- AssertEquals("#E18", (byte)13, Convert.ToByte("15", 8));
- AssertEquals("#E19", (byte)27, Convert.ToByte("27", 10));
- AssertEquals("#E20", (byte)250, Convert.ToByte("FA", 16));
-
- try {
- Convert.ToByte('\u03A9'); // sign of Omega on Win2k
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToByte((decimal)22000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((double)255.5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(-tryInt16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((int)-256);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((object)ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToByte((sbyte)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((float)-0.6f);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte("1a1");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E35", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToByte("457");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((ushort)30000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((uint)300);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((ulong)987654321321);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte("10010111", 3);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E40", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToByte("3F3", 16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E41", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToChar(){
- tryByte = 58;
- AssertEquals("#F01", ':', Convert.ToChar(tryByte));
- AssertEquals("#F02", 'a', Convert.ToChar(tryChar));
- AssertEquals("#F03", 'A', Convert.ToChar((short)65));
- AssertEquals("#F04", 'x', Convert.ToChar((int)120));
- AssertEquals("#F05", '"', Convert.ToChar((long)34));
- AssertEquals("#F06", '-', Convert.ToChar((sbyte)45));
- AssertEquals("#F07", '@', Convert.ToChar("@"));
- AssertEquals("#F08", 'K', Convert.ToChar((ushort)75));
- AssertEquals("#F09", '=', Convert.ToChar((uint)61));
- AssertEquals("#F10", 'È', Convert.ToChar((ulong)200));
- AssertEquals("#F11", '{', Convert.ToChar((object)trySByte, ci));
- AssertEquals("#F12", 'o', Convert.ToChar(tryStr.Substring(1,1), ci));
-
- try {
- Convert.ToChar(boolTrue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F22", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDbl);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F23", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar((short)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(Int32.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(Int32.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar((long)-123);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F29", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(-trySByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryFloat);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F31", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar("foo");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F32", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToChar(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F33", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToChar(new Exception(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F34", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(null, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F35", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToChar("", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F36", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F37", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToDateTime() {
- string dateString = "01/01/2002";
-
- int iTest = 1;
- try {
- AssertEquals("#G01", tryDT, Convert.ToDateTime(tryDT));
- iTest++;
- AssertEquals("#G02", tryDT, Convert.ToDateTime(dateString));
- iTest++;
- AssertEquals("#G03", tryDT, Convert.ToDateTime(dateString, ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToDateTime(boolTrue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G10", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G11", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G12", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G13", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryDbl);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G14", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G15", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt32);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G16", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G17", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G18", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(trySByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G19", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryFloat);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20a2-01-01");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G21", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20002-25-01");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G22", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G23", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI32);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G24", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20a2-01-01", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G27", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToDecimal() {
- AssertEquals("#H01", (decimal)1, Convert.ToDecimal(boolTrue));
- AssertEquals("#H02", (decimal)0, Convert.ToDecimal(boolFalse));
- AssertEquals("#H03", (decimal)tryByte, Convert.ToDecimal(tryByte));
- AssertEquals("#H04", tryDec, Convert.ToDecimal(tryDec));
- AssertEquals("#H05", (decimal)tryDbl, Convert.ToDecimal(tryDbl));
- AssertEquals("#H06", (decimal)tryInt16, Convert.ToDecimal(tryInt16));
- AssertEquals("#H07", (decimal)tryInt32, Convert.ToDecimal(tryInt32));
- AssertEquals("#H08", (decimal)tryInt64, Convert.ToDecimal(tryInt64));
- AssertEquals("#H09", (decimal)trySByte, Convert.ToDecimal(trySByte));
- AssertEquals("#H10", (decimal)tryFloat, Convert.ToDecimal(tryFloat));
- AssertEquals("#H11", (decimal)23456.432, Convert.ToDecimal("23456.432"));
- AssertEquals("#H12", (decimal)tryUI16, Convert.ToDecimal(tryUI16));
- AssertEquals("#H13", (decimal)tryUI32, Convert.ToDecimal(tryUI32));
- AssertEquals("#H14", (decimal)tryUI64, Convert.ToDecimal(tryUI64));
- AssertEquals("#H15", (decimal)63784, Convert.ToDecimal("63784", ci));
-
- try {
- Convert.ToDecimal(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H22", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(double.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H23", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H24", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H25", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = decimal.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDecimal(maxDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H28", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = decimal.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDecimal(maxDec, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H29", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToDouble() {
- int iTest = 1;
- try {
- AssertEquals("#I01", (double)1, Convert.ToDouble(boolTrue));
- iTest++;
- AssertEquals("#I02", (double)0, Convert.ToDouble(boolFalse));
- iTest++;
- AssertEquals("#I03", (double)tryByte, Convert.ToDouble(tryByte));
- iTest++;
- AssertEquals("#I04", tryDbl, Convert.ToDouble(tryDbl));
- iTest++;
- AssertEquals("#I05", (double)tryDec, Convert.ToDouble(tryDec));
- iTest++;
- AssertEquals("#I06", (double)tryInt16, Convert.ToDouble(tryInt16));
- iTest++;
- AssertEquals("#I07", (double)tryInt32, Convert.ToDouble(tryInt32));
- iTest++;
- AssertEquals("#I08", (double)tryInt64, Convert.ToDouble(tryInt64));
- iTest++;
- AssertEquals("#I09", (double)trySByte, Convert.ToDouble(trySByte));
- iTest++;
- AssertEquals("#I10", (double)tryFloat, Convert.ToDouble(tryFloat));
- iTest++;
- AssertEquals("#I11", (double)23456.432, Convert.ToDouble("23456.432"));
- iTest++;
- AssertEquals("#I12", (double)tryUI16, Convert.ToDouble(tryUI16));
- iTest++;
- AssertEquals("#I13", (double)tryUI32, Convert.ToDouble(tryUI32));
- iTest++;
- AssertEquals("#I14", (double)tryUI64, Convert.ToDouble(tryUI64));
- iTest++;
- AssertEquals("#H15", (double)63784, Convert.ToDouble("63784", ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToDouble(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I22", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I23", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = double.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDouble(maxDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDouble(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I26", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = double.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDouble(maxDec, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I28", typeof(InvalidCastException), e.GetType());
- }
- }
-
- public void TestToInt16() {
- AssertEquals("#J01", (short)0, Convert.ToInt16(boolFalse));
- AssertEquals("#J02", (short)1, Convert.ToInt16(boolTrue));
- AssertEquals("#J03", (short)97, Convert.ToInt16(tryChar));
- AssertEquals("#J04", (short)1234, Convert.ToInt16(tryDec));
- AssertEquals("#J05", (short)0, Convert.ToInt16(tryDbl));
- AssertEquals("#J06", (short)1234, Convert.ToInt16(tryInt16));
- AssertEquals("#J07", (short)12345, Convert.ToInt16(tryInt32));
- AssertEquals("#J08", (short)30000, Convert.ToInt16((long)30000));
- AssertEquals("#J09", (short)123, Convert.ToInt16(trySByte));
- AssertEquals("#J10", (short)1234, Convert.ToInt16(tryFloat));
- AssertEquals("#J11", (short)578, Convert.ToInt16("578"));
- AssertEquals("#J12", (short)15500, Convert.ToInt16((ushort)15500));
- AssertEquals("#J13", (short)5489, Convert.ToInt16((uint)5489));
- AssertEquals("#J14", (short)9876, Convert.ToInt16((ulong)9876));
- AssertEquals("#J15", (short)14, Convert.ToInt16("14", ci));
- AssertEquals("#J16", (short)11, Convert.ToInt16("01011", 2));
- AssertEquals("#J17", (short)1540, Convert.ToInt16("3004", 8));
- AssertEquals("#J18", (short)321, Convert.ToInt16("321", 10));
- AssertEquals("#J19", (short)2748, Convert.ToInt16("ABC", 16));
-
- try {
- Convert.ToInt16(char.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16((decimal)(short.MaxValue + 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((decimal)(short.MinValue - 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((double)(short.MaxValue + 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((double)(short.MinValue - 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(-50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(-tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J35", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16((float)32767.5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((float)-33000.54);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J38", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt16("-33000");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(ushort.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(uint.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J43", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J44", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt16("-33000", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16("321", 11);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J46", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToInt16("D8BF1", 16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J47", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToInt32() {
- long tryMax = long.MaxValue;
- long tryMin = long.MinValue;
- AssertEquals("#K01", (int)0, Convert.ToInt32(boolFalse));
- AssertEquals("#K02", (int)1, Convert.ToInt32(boolTrue));
- AssertEquals("#K03", (int)0, Convert.ToInt32(tryByte));
- AssertEquals("#K04", (int)97, Convert.ToInt32(tryChar));
- AssertEquals("#K05", (int)1234, Convert.ToInt32(tryDec));
- AssertEquals("#K06", (int)0, Convert.ToInt32(tryDbl));
- AssertEquals("#K07", (int)1234, Convert.ToInt32(tryInt16));
- AssertEquals("#K08", (int)12345, Convert.ToInt32(tryInt32));
- AssertEquals("#K09", (int)60000, Convert.ToInt32((long)60000));
- AssertEquals("#K10", (int)123, Convert.ToInt32(trySByte));
- AssertEquals("#K11", (int)1234, Convert.ToInt32(tryFloat));
- AssertEquals("#K12", (int)9876, Convert.ToInt32((string)"9876"));
- AssertEquals("#K13", (int)34567, Convert.ToInt32(tryUI16));
- AssertEquals("#K14", (int)567891234, Convert.ToInt32(tryUI32));
- AssertEquals("#K15", (int)0, Convert.ToInt32(tryUI64));
- AssertEquals("#K16", (int)123, Convert.ToInt32("123", ci));
- AssertEquals("#K17", (int)128, Convert.ToInt32("10000000", 2));
- AssertEquals("#K18", (int)302, Convert.ToInt32("456", 8));
- AssertEquals("#K19", (int)456, Convert.ToInt32("456", 10));
- AssertEquals("#K20", (int)1110, Convert.ToInt32("456", 16));
-
- try {
- Convert.ToInt32(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32((decimal)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((decimal)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((double)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((double)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(-tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32((float)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((float)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K35", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt32("-46565465123");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32("46565465123");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((uint)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((ulong)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K40", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K41", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt32("-46565465123", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32("654", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K43", typeof(ArgumentException), e.GetType());
- }
- }
- public void TestToInt64() {
- decimal longMax = long.MaxValue;
- longMax += 1;
- decimal longMin = long.MinValue;
- longMin -= 1;
-
- AssertEquals("#L01", (long)0, Convert.ToInt64(boolFalse));
- AssertEquals("#L02", (long)1, Convert.ToInt64(boolTrue));
- AssertEquals("#L03", (long)97, Convert.ToInt64(tryChar));
- AssertEquals("#L04", (long)1234, Convert.ToInt64(tryDec));
- AssertEquals("#L05", (long)0, Convert.ToInt64(tryDbl));
- AssertEquals("#L06", (long)1234, Convert.ToInt64(tryInt16));
- AssertEquals("#L07", (long)12345, Convert.ToInt64(tryInt32));
- AssertEquals("#L08", (long)123456789012, Convert.ToInt64(tryInt64));
- AssertEquals("#L09", (long)123, Convert.ToInt64(trySByte));
- AssertEquals("#L10", (long)1234, Convert.ToInt64(tryFloat));
- AssertEquals("#L11", (long)564897, Convert.ToInt64("564897"));
- AssertEquals("#L12", (long)34567, Convert.ToInt64(tryUI16));
- AssertEquals("#L13", (long)567891234, Convert.ToInt64(tryUI32));
- AssertEquals("#L14", (long)0, Convert.ToInt64(tryUI64));
- AssertEquals("#L15", (long)-2548751, Convert.ToInt64("-2548751", ci));
- AssertEquals("#L16", (long)24987562, Convert.ToInt64("1011111010100011110101010", 2));
- AssertEquals("#L17", (long)-24578965, Convert.ToInt64("1777777777777642172153", 8));
- AssertEquals("#L18", (long)248759757, Convert.ToInt64("248759757", 10));
- AssertEquals("#L19", (long)256, Convert.ToInt64("100", 16));
-
- try {
- Convert.ToInt64(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt64((decimal)longMax + 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L21", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((decimal)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((double)longMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((double)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(new Exception());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt64((float)longMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((float)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64("-567b3");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L30", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt64(longMax.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L32", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt64(longMin.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64("321", 11);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L34", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToSByte() {
- int iTest = 1;
- try {
- AssertEquals("#M01", (sbyte)0, Convert.ToSByte(boolFalse));
- iTest++;
- AssertEquals("#M02", (sbyte)1, Convert.ToSByte(boolTrue));
- iTest++;
- AssertEquals("#M03", (sbyte)97, Convert.ToSByte(tryChar));
- iTest++;
- AssertEquals("#M04", (sbyte)15, Convert.ToSByte((decimal)15));
- iTest++;
- AssertEquals("#M05", (sbyte)0, Convert.ToSByte(tryDbl));
- iTest++;
- AssertEquals("#M06", (sbyte)127, Convert.ToSByte((short)127));
- iTest++;
- AssertEquals("#M07", (sbyte)-128, Convert.ToSByte((int)-128));
- iTest++;
- AssertEquals("#M08", (sbyte)30, Convert.ToSByte((long)30));
- iTest++;
- AssertEquals("#M09", (sbyte)123, Convert.ToSByte(trySByte));
- iTest++;
- AssertEquals("#M10", (sbyte)12, Convert.ToSByte((float)12.46987f));
- iTest++;
- AssertEquals("#M11", (sbyte)1, Convert.ToSByte("1"));
- iTest++;
- AssertEquals("#M12", (sbyte)99, Convert.ToSByte((ushort)99));
- iTest++;
- AssertEquals("#M13", (sbyte)54, Convert.ToSByte((uint)54));
- iTest++;
- AssertEquals("#M14", (sbyte)127, Convert.ToSByte((ulong)127));
- iTest++;
- AssertEquals("#M15", (sbyte)14, Convert.ToSByte("14", ci));
- iTest++;
- AssertEquals("#M16", (sbyte)11, Convert.ToSByte("01011", 2));
- iTest++;
- AssertEquals("#M17", (sbyte)5, Convert.ToSByte("5", 8));
- iTest++;
- AssertEquals("#M18", (sbyte)100, Convert.ToSByte("100", 10));
- iTest++;
- AssertEquals("#M19", (sbyte)-1, Convert.ToSByte("FF", 16));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToSByte((byte)200);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((char)130);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte((decimal)127.5m);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((decimal)-200m);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((double)150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((double)-128.6);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((short)150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((short)-300);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((int)1500);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((int)-1286);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((long)128);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((long)-129);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(new NumberFormatInfo());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M38", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte((float)333);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((float)-666);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte("B3");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M41", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSByte("251");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ushort.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M43", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((uint)600);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M46", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M47", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSByte("325", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M48", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte("5D", 15);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M49", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToSByte("111111111", 2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M50", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToSingle() {
- int iTest = 1;
- try {
- AssertEquals("#N01", (float)0, Convert.ToSingle(boolFalse));
- iTest++;
- AssertEquals("#N02", (float)1, Convert.ToSingle(boolTrue));
- iTest++;
- AssertEquals("#N03", (float)0, Convert.ToSingle(tryByte));
- iTest++;
- AssertEquals("#N04", (float)1234,234, Convert.ToSingle(tryDec));
- iTest++;
- AssertEquals("#N05", (float)0, Convert.ToSingle(tryDbl));
- iTest++;
- AssertEquals("#N06", (float)1234, Convert.ToSingle(tryInt16));
- iTest++;
- AssertEquals("#N07", (float)12345, Convert.ToSingle(tryInt32));
- iTest++;
- AssertEquals("#N08", (float)123456789012, Convert.ToSingle(tryInt64));
- iTest++;
- AssertEquals("#N09", (float)123, Convert.ToSingle(trySByte));
- iTest++;
- AssertEquals("#N10", (float)1234,2345, Convert.ToSingle(tryFloat));
- iTest++;
- AssertEquals("#N11", (float)987, Convert.ToSingle("987"));
- iTest++;
- AssertEquals("#N12", (float)34567, Convert.ToSingle(tryUI16));
- iTest++;
- AssertEquals("#N13", (float)567891234, Convert.ToSingle(tryUI32));
- iTest++;
- AssertEquals("#N14", (float)0, Convert.ToSingle(tryUI64));
- iTest++;
- AssertEquals("#N15", (float)654.234, Convert.ToSingle("654.234", ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToSingle(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle("A345H");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N28", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSingle(double.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N30", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle("J345K", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N31", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSingle("11000000000000000000000000000000000000000000000", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N32", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToString() {
-
- tryByte = 123;
- AssertEquals("#O01", "False", Convert.ToString(boolFalse));
- AssertEquals("#O02", "True", Convert.ToString(boolTrue));
- AssertEquals("#O03", "123", Convert.ToString(tryByte));
- AssertEquals("#O04", "a", Convert.ToString(tryChar));
- AssertEquals("#O05", tryDT.ToString(), Convert.ToString(tryDT));
- AssertEquals("#O06", tryDec.ToString(), Convert.ToString(tryDec));
- AssertEquals("#O07", tryDbl.ToString(), Convert.ToString(tryDbl));
- AssertEquals("#O08", "1234", Convert.ToString(tryInt16));
- AssertEquals("#O09", "12345", Convert.ToString(tryInt32));
- AssertEquals("#O10", "123456789012", Convert.ToString(tryInt64));
- AssertEquals("#O11", "123", Convert.ToString(trySByte));
- AssertEquals("#O12", tryFloat.ToString(), Convert.ToString(tryFloat));
- AssertEquals("#O13", "foobar", Convert.ToString(tryStr));
- AssertEquals("#O14", "34567", Convert.ToString(tryUI16));
- AssertEquals("#O15", "567891234", Convert.ToString(tryUI32));
- AssertEquals("#O16", "True", Convert.ToString(boolTrue, ci));
- AssertEquals("#O17", "False", Convert.ToString(boolFalse, ci));
- AssertEquals("#O18", "123", Convert.ToString(tryByte, ci));
- AssertEquals("#O19", "1111011", Convert.ToString(tryByte, 2));
- AssertEquals("#O20", "173", Convert.ToString(tryByte, 8));
- AssertEquals("#O21", "123", Convert.ToString(tryByte, 10));
- AssertEquals("#O22", "7b", Convert.ToString(tryByte, 16));
- AssertEquals("#O23", "a", Convert.ToString(tryChar, ci));
- AssertEquals("#O24", tryDT.ToString(ci), Convert.ToString(tryDT, ci));
- AssertEquals("#O25", tryDec.ToString(ci), Convert.ToString(tryDec,ci));
- AssertEquals("#O26", tryDbl.ToString(ci), Convert.ToString(tryDbl, ci));
- AssertEquals("#O27", "1234", Convert.ToString(tryInt16, ci));
- AssertEquals("#O28", "10011010010", Convert.ToString(tryInt16, 2));
- AssertEquals("#O29", "2322", Convert.ToString(tryInt16, 8));
- AssertEquals("#O30", "1234", Convert.ToString(tryInt16, 10));
- AssertEquals("#O31", "4d2", Convert.ToString(tryInt16, 16));
- AssertEquals("#O32", "12345", Convert.ToString(tryInt32, ci));
- AssertEquals("#O33", "11000000111001", Convert.ToString(tryInt32, 2));
- AssertEquals("#O34", "30071", Convert.ToString(tryInt32, 8));
- AssertEquals("#O35", "12345", Convert.ToString(tryInt32, 10));
- AssertEquals("#O36", "3039", Convert.ToString(tryInt32, 16));
- AssertEquals("#O37", "123456789012", Convert.ToString(tryInt64, ci));
- AssertEquals("#O38", "1110010111110100110010001101000010100",
- Convert.ToString(tryInt64, 2));
- AssertEquals("#O39", "1627646215024", Convert.ToString(tryInt64, 8));
- AssertEquals("#O40", "123456789012", Convert.ToString(tryInt64, 10));
- AssertEquals("#O41", "1cbe991a14", Convert.ToString(tryInt64, 16));
- AssertEquals("#O42", "123", Convert.ToString((trySByte), ci));
- AssertEquals("#O43", tryFloat.ToString(ci), Convert.ToString((tryFloat), ci));
- AssertEquals("#O44", "foobar", Convert.ToString((tryStr), ci));
- AssertEquals("#O45", "34567", Convert.ToString((tryUI16), ci));
- AssertEquals("#O46", "567891234", Convert.ToString((tryUI32), ci));
- AssertEquals("#O47", "0", Convert.ToString(tryUI64));
- AssertEquals("#O48", "0", Convert.ToString((tryUI64), ci));
-
- try {
- Convert.ToString(tryInt16, 5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O55", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToString(tryInt32, 17);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O56", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToString(tryInt64, 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O57", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt16() {
- AssertEquals("#P01", (ushort)0, Convert.ToUInt16(boolFalse));
- AssertEquals("#P02", (ushort)1, Convert.ToUInt16(boolTrue));
- AssertEquals("#P03", (ushort)0, Convert.ToUInt16(tryByte));
- AssertEquals("#P04", (ushort)97, Convert.ToUInt16(tryChar));
- AssertEquals("#P05", (ushort)1234, Convert.ToUInt16(tryDec));
- AssertEquals("#P06", (ushort)0, Convert.ToUInt16(tryDbl));
- AssertEquals("#P07", (ushort)1234, Convert.ToUInt16(tryInt16));
- AssertEquals("#P08", (ushort)12345, Convert.ToUInt16(tryInt32));
- AssertEquals("#P09", (ushort)43752, Convert.ToUInt16((long)43752));
- AssertEquals("#P10", (ushort)123, Convert.ToUInt16(trySByte));
- AssertEquals("#P11", (ushort)1234, Convert.ToUInt16(tryFloat));
- AssertEquals("#P12", (ushort)123, Convert.ToUInt16((string)"123"));
- AssertEquals("#P13", (ushort)34567, Convert.ToUInt16(tryUI16));
- AssertEquals("#P14", (ushort)56789, Convert.ToUInt16((uint)56789));
- AssertEquals("#P15", (ushort)0, Convert.ToUInt16(tryUI64));
- AssertEquals("#P16", (ushort)31, Convert.ToUInt16("31", ci));
- AssertEquals("#P17", (ushort)14, Convert.ToUInt16("1110", 2));
- AssertEquals("#P18", (ushort)32, Convert.ToUInt16("40", 8));
- AssertEquals("#P19", (ushort)40, Convert.ToUInt16("40", 10));
- AssertEquals("#P20", (ushort)64, Convert.ToUInt16("40", 16));
-
-
- try {
- Convert.ToUInt16(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(decimal.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(double.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(long.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(long.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P35", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("1A2");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P39", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("-32800");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("1A2", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P43", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("-32800", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("456987", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("40", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P46", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt32() {
- AssertEquals("#Q01", (uint)1, Convert.ToUInt32(boolTrue));
- AssertEquals("#Q02", (uint)0, Convert.ToUInt32(boolFalse));
- AssertEquals("#Q03", (uint)0, Convert.ToUInt32(tryByte));
- AssertEquals("#Q04", (uint)97, Convert.ToUInt32(tryChar));
- AssertEquals("#Q05", (uint)1234, Convert.ToUInt32(tryDec));
- AssertEquals("#Q06", (uint)0, Convert.ToUInt32(tryDbl));
- AssertEquals("#Q07", (uint)1234, Convert.ToUInt32(tryInt16));
- AssertEquals("#Q08", (uint)12345, Convert.ToUInt32(tryInt32));
- AssertEquals("#Q09", (uint)1234567890, Convert.ToUInt32((long)1234567890));
- AssertEquals("#Q10", (uint)123, Convert.ToUInt32(trySByte));
- AssertEquals("#Q11", (uint)1234, Convert.ToUInt32(tryFloat));
- AssertEquals("#Q12", (uint)3456789, Convert.ToUInt32("3456789"));
- AssertEquals("#Q13", (uint)34567, Convert.ToUInt32(tryUI16));
- AssertEquals("#Q14", (uint)567891234, Convert.ToUInt32(tryUI32));
- AssertEquals("#Q15", (uint)0, Convert.ToUInt32(tryUI64));
- AssertEquals("#Q16", (uint)415, Convert.ToUInt32("110011111", 2));
- AssertEquals("#Q17", (uint)156, Convert.ToUInt32("234" ,8));
- AssertEquals("#Q18", (uint)234, Convert.ToUInt32("234" ,10));
- AssertEquals("#Q19", (uint)564, Convert.ToUInt32("234" ,16));
-
-
- try {
- Convert.ToUInt32(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((decimal)-150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((double)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(long.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((long)-50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(new Exception());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q34", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("45t54");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q38", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("-55");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(new Exception(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q41", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q42", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("-50", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q43", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(decimal.MaxValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("1001110", 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q45", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt64()
- {
- int iTest = 1;
- try {
- AssertEquals("#R01", (ulong)1, Convert.ToUInt64(boolTrue));
- iTest++;
- AssertEquals("#R02", (ulong)0, Convert.ToUInt64(boolFalse));
- iTest++;
- AssertEquals("#R03", (ulong)0, Convert.ToUInt64(tryByte));
- iTest++;
- AssertEquals("#R04", (ulong)97, Convert.ToUInt64(tryChar));
- iTest++;
- AssertEquals("#R05", (ulong)1234, Convert.ToUInt64(tryDec));
- iTest++;
- AssertEquals("#R06", (ulong)0, Convert.ToUInt64(tryDbl));
- iTest++;
- AssertEquals("#R07", (ulong)1234, Convert.ToUInt64(tryInt16));
- iTest++;
- AssertEquals("#R08", (ulong)12345, Convert.ToUInt64(tryInt32));
- iTest++;
- AssertEquals("#R09", (ulong)123456789012, Convert.ToUInt64(tryInt64));
- iTest++;
- AssertEquals("#R10", (ulong)123, Convert.ToUInt64(trySByte));
- iTest++;
- AssertEquals("#R11", (ulong)1234, Convert.ToUInt64(tryFloat));
- iTest++;
- AssertEquals("#R12", (ulong)345678, Convert.ToUInt64("345678"));
- iTest++;
- AssertEquals("#R13", (ulong)34567, Convert.ToUInt64(tryUI16));
- iTest++;
- AssertEquals("#R14", (ulong)567891234, Convert.ToUInt64(tryUI32));
- iTest++;
- AssertEquals("#R15", (ulong)0, Convert.ToUInt64(tryUI64));
- iTest++;
- AssertEquals("#R16", (ulong)123, Convert.ToUInt64("123", ci));
- iTest++;
- AssertEquals("#R17", (ulong)4, Convert.ToUInt64("100", 2));
- iTest++;
- AssertEquals("#R18", (ulong)64, Convert.ToUInt64("100", 8));
- iTest++;
- AssertEquals("#R19", (ulong)100, Convert.ToUInt64("100", 10));
- iTest++;
- AssertEquals("#R20", (ulong)256, Convert.ToUInt64("100", 16));
- } catch (Exception e) {
- Fail ("Unexpected exception caught when iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToUInt64(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64((decimal)-140);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64((double)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(long.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R33", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("234rt78");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R37", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("-68");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("23rd2", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R40", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MinValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("132", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R43", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToBase64CharArray() {
- byte[] byteArr = {33, 127, 255, 109, 170, 54};
- // 0 1 2 3 4 5 6 7
- char[] expectedCharArr = {'I', 'X', '/', '/', 'b', 'a', 'o', '2'};
- char[] result = new Char[8];
-
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, 0);
-
- for (int i = 0; i < expectedCharArr.Length; i++) {
- AssertEquals("#S0" + i, expectedCharArr[i], result[i]);
- }
-
- try {
- Convert.ToBase64CharArray(null, 0, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, -1, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S11", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, -5, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S12", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, -2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S13", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 4, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S14", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, 2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S15", typeof(ArgumentOutOfRangeException), e.GetType());
- }
- }
- public void TestToBase64String() {
- byte[] byteArr = {33, 127, 255, 109, 170, 54};
- string expectedStr = "IX//bao2";
- string result1;
- string result2;
-
- result1 = Convert.ToBase64String(byteArr);
- result2 = Convert.ToBase64String(byteArr, 0, byteArr.Length);
-
- AssertEquals("#T01", expectedStr, result1);
- AssertEquals("#T02", expectedStr, result2);
-
- try {
- Convert.ToBase64String(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T05", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, -1, byteArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T06", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, 0, -10);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T07", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, 4, byteArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T08", typeof(ArgumentOutOfRangeException), e.GetType());
- }
- }
-
- /* Have experienced some problems with FromBase64CharArray using mono. Something
- * about error in a unicode file.
- *
- * However the test seems to run fine using mono in a cygwin environment
- */
- public void TestFromBase64CharArray() {
-
- char[] charArr = {'M','o','n','o','m','o','n','o'};
- byte[] expectedByteArr = {50, 137, 232, 154, 137, 232};
-
- byte[] fromCharArr = Convert.FromBase64CharArray(charArr, 0, 8);
-
- for (int i = 0; i < fromCharArr.Length; i++){
- AssertEquals("#U0" + i, expectedByteArr[i], fromCharArr[i]);
- }
-
- try {
- Convert.FromBase64CharArray(null, 0, charArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, -1, charArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U11", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, -5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U12", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 3);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U13", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U14", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U15", typeof(FormatException), e.GetType());
- }
- }
-
- /* Have experienced some problems with FromBase64String using mono. Something about
- * error in a unicode file.
- *
- * However the test seems to run fine using mono in a cygwin environment
- */
- public void TestFromBase64String() {
- string str = "Monomono";
- string err01 = "foo";
-
- byte[] expectedByteArr = {50, 137, 232, 154, 137, 232};
- byte[] fromStr = Convert.FromBase64String(str);
-
- for (int i = 0; i < fromStr.Length; i++){
- AssertEquals("#V0" + i, expectedByteArr[i], fromStr[i]);
- }
-
- try {
- Convert.FromBase64String(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.FromBase64String(err01);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V11", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.FromBase64String(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V12", typeof(FormatException), e.GetType());
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs
deleted file mode 100755
index 0ef803ef37a..00000000000
--- a/mcs/class/corlib/Test/System/DateTimeTest.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-//
-// DateTimeTest.cs - NUnit Test Cases for the System.DateTime struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Free Software Foundation
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DateTimeTest : TestCase
-{
- private CultureInfo oldcult;
-
- long[] myTicks = {
- 631501920000000000L, // 25 Feb 2002 - 00:00:00
- 631502475130080000L, // 25 Feb 2002 - 15:25:13,8
- 631502115130080000L, // 25 Feb 2002 - 05:25:13,8
- 631502115000000000L, // 25 Feb 2002 - 05:25:00
- 631502115130000000L, // 25 Feb 2002 - 05:25:13
- 631502079130000000L, // 25 Feb 2002 - 04:25:13
- 629197085770000000L // 06 Nov 1994 - 08:49:37
- };
-
- public DateTimeTest() : base ("MonoTests.System.DateTimeTest testcase") {}
- public DateTimeTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (DateTimeTest));
- }
- }
-
- protected override void SetUp()
- {
- // the current culture determines the result of formatting
- oldcult = Thread.CurrentThread.CurrentCulture;
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
- }
-
- protected override void TearDown ()
- {
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
- public void TestCtors ()
- {
- DateTime t1 = new DateTime (2002,2,25);
- AssertEquals("A01", myTicks[0], t1.Ticks);
- DateTime t2 = new DateTime (2002,2,25,15,25,13,8);
- AssertEquals("A02", myTicks[1], t2.Ticks);
- AssertEquals("A03", myTicks[0], t2.Date.Ticks);
- AssertEquals("A04", 2002, t2.Year);
- AssertEquals("A05", 2, t2.Month);
- AssertEquals("A06", 25, t2.Day);
- AssertEquals("A07", 15, t2.Hour);
- AssertEquals("A08", 25, t2.Minute);
- AssertEquals("A09", 13, t2.Second);
- AssertEquals("A10", 8, t2.Millisecond);
- DateTime t3 = new DateTime (2002,2,25,5,25,13,8);
- AssertEquals("A11", myTicks[2], t3.Ticks);
- }
-
- public void TestToString ()
- {
- DateTime t1 = new DateTime (myTicks[2]);
- DateTime t2 = new DateTime (myTicks[1]);
- // Standard patterns
- AssertEquals("B01", "02/25/2002", t1.ToString ("d"));
- AssertEquals("B02", "Monday, 25 February 2002", t1.ToString ("D"));
- AssertEquals("B03", "Monday, 25 February 2002 05:25", t1.ToString ("f"));
- AssertEquals("B04", "Monday, 25 February 2002 05:25:13", t1.ToString ("F"));
- AssertEquals("B05", "02/25/2002 05:25", t1.ToString ("g"));
- AssertEquals("B06", "02/25/2002 05:25:13", t1.ToString ("G"));
- AssertEquals("B07", "February 25", t1.ToString ("m"));
- AssertEquals("B08", "February 25", t1.ToString ("M"));
- AssertEquals("B09", "Mon, 25 Feb 2002 05:25:13 GMT", t1.ToString ("r"));
- AssertEquals("B10", "Mon, 25 Feb 2002 05:25:13 GMT", t1.ToString ("R"));
- AssertEquals("B11", "2002-02-25T05:25:13", t1.ToString ("s"));
- AssertEquals("B12", "05:25", t1.ToString ("t"));
- AssertEquals("B13", "05:25:13", t1.ToString ("T"));
- AssertEquals("B14", "2002-02-25 05:25:13Z", t1.ToString ("u"));
- AssertEquals("B15", "Sunday, 24 February 2002 11:25:13", t1.ToUniversalTime().ToString ("U"));
- AssertEquals("B16", "2002 February", t1.ToString ("y"));
- AssertEquals("B17", "2002 February", t1.ToString ("Y"));
-
- // Custom patterns
- AssertEquals("C01", "25", t1.ToString ("%d"));
- AssertEquals("C02", "25", t1.ToString ("dd"));
- AssertEquals("C03", "Mon", t1.ToString ("ddd"));
- AssertEquals("C04", "Monday", t1.ToString ("dddd"));
- AssertEquals("C05", "2", t1.ToString ("%M"));
- AssertEquals("C06", "02", t1.ToString ("MM"));
- AssertEquals("C07", "Feb", t1.ToString ("MMM"));
- AssertEquals("C08", "February", t1.ToString ("MMMM"));
- AssertEquals("C09", "2", t1.ToString ("%y"));
- AssertEquals("C10", "02", t1.ToString ("yy"));
- AssertEquals("C11", "2002", t1.ToString ("yyyy"));
- AssertEquals("C12", "5", t1.ToString ("%h"));
- AssertEquals("C13", "05", t1.ToString ("hh"));
- AssertEquals("C14", "3", t2.ToString ("%h"));
- AssertEquals("C15", "03", t2.ToString ("hh"));
- AssertEquals("C16", "15", t2.ToString ("%H"));
- AssertEquals("C17", "15", t2.ToString ("HH"));
- AssertEquals("C18", "25", t2.ToString ("%m"));
- AssertEquals("C19", "25", t2.ToString ("mm"));
- AssertEquals("C20", "13", t2.ToString ("%s"));
- AssertEquals("C21", "13", t2.ToString ("ss"));
- AssertEquals("C22", "A", t1.ToString ("%t"));
- AssertEquals("C23", "P", t2.ToString ("%t"));
- AssertEquals("C24", "AM", t1.ToString ("tt"));
- AssertEquals("C25", "PM", t2.ToString ("tt"));
- long offset = TimeZone.CurrentTimeZone.GetUtcOffset(t1).Ticks / 36000000000;
- AssertEquals("C26", offset.ToString("+#;-#;0"), t1.ToString ("%z"));
- AssertEquals("C27", offset.ToString("+00;-00;00"), t1.ToString ("zz"));
- AssertEquals("C28", offset.ToString("+00;-00;00") + ":00", t1.ToString ("zzz"));
- AssertEquals("C29", " : ", t1.ToString (" : "));
- AssertEquals("C30", " / ", t1.ToString (" / "));
- AssertEquals("C31", " yyy ", t1.ToString (" 'yyy' "));
- AssertEquals("C32", " d", t1.ToString (" \\d"));
- }
-
- public void TestParseExact ()
- {
- // Standard patterns
- DateTime t1 = DateTime.ParseExact ("02/25/2002", "d", null);
- AssertEquals ("D01", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002", "D", null);
- AssertEquals ("D02", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25", "f", null);
- AssertEquals ("D03", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F", null);
- AssertEquals ("D04", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25", "g", null);
- AssertEquals ("D05", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25:13", "G", null);
- AssertEquals ("D06", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("2002-02-25 04:25:13Z", "u", null);
- AssertEquals ("D07", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 04:25:13", "U", null);
- AssertEquals ("D08", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "m", null);
- AssertEquals ("D09", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "M", null);
- AssertEquals ("D10", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "r", null);
- AssertEquals ("D11", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "R", null);
- AssertEquals ("D12", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("2002-02-25T05:25:13", "s", null);
- AssertEquals ("D13", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.ParseExact ("05:25", "t", null);
- AssertEquals("D14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.ParseExact ("05:25:13", "T", null);
- AssertEquals("D15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "Y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- // Custom patterns
- t2 = new DateTime (2002, 1, 25);
- t1 = DateTime.ParseExact ("25", "%d", null);
- AssertEquals ("E01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("25", "dd", null);
- AssertEquals ("E02", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 1);
- t1 = DateTime.ParseExact ("2", "%M", null);
- AssertEquals ("E03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("02", "MM", null);
- AssertEquals ("E04", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("Feb", "MMM", null);
- AssertEquals ("E05", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("February", "MMMM", null);
- AssertEquals ("E06", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2005, 1, 1);
- t1 = DateTime.ParseExact ("5", "%y", null);
- AssertEquals ("E07", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05", "yy", null);
- AssertEquals ("E08", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("2005", "yyyy", null);
- AssertEquals ("E09", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5A", "ht", null);
- AssertEquals ("E10", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05A", "hht", null);
- AssertEquals ("E11", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("3P", "ht", null);
- AssertEquals ("E12", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("03P", "hht", null);
- AssertEquals ("E13", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5", "%H", null);
- AssertEquals ("E14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("15", "%H", null);
- AssertEquals ("E15", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("15", "HH", null);
- AssertEquals ("E16", t2.Ticks, t1.Ticks);
-
- // Time zones
- t2 = DateTime.Today + new TimeSpan (17, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z", null);
- AssertEquals ("F01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("11:18AM -05:00", "h:mmtt zzz", null);
- AssertEquals ("F02", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:18PM +03", "h:mmtt zz", null);
- AssertEquals ("F03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:48PM +03:30", "h:mmtt zzz", null);
- AssertEquals ("F04", t2.Ticks, t1.Ticks);
-
- // Options
- t2 = DateTime.Today + new TimeSpan (16, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G01", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G02", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13",
- "dddd, dd MMMM yyyy HH:mm:ss",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G03", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G04", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02/25/2002", "d", null,
- DateTimeStyles.AllowLeadingWhite);
- AssertEquals ("G05", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002 ", "d", null,
- DateTimeStyles.AllowTrailingWhite);
- AssertEquals ("G06", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02 / 25 / 2002 ", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G07", myTicks[0], t1.Ticks);
-
- // Multi Custom Patterns
- string rfc1123_date = "r";
- string rfc850_date = "dddd, dd'-'MMM'-'yy HH':'mm':'ss 'GMT'";
- string asctime_date = "ddd MMM d HH':'mm':'ss yyyy";
- string [] formats = new string [] {rfc1123_date, rfc850_date, asctime_date};
- CultureInfo enUS = new CultureInfo("en-US", false);
- t1 = DateTime.ParseExact ("Sun, 06 Nov 1994 08:49:37 GMT", formats[0], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M01", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sunday, 06-Nov-94 08:49:37 GMT", formats[1], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M02", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun Nov 6 08:49:37 1994", formats[2], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M03", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun, 06 Nov 1994 08:49:37 GMT", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M04", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sunday, 06-Nov-94 08:49:37 GMT", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M05", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun Nov 6 08:49:37 1994", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M06", myTicks[6], t1.Ticks);
- }
-
- public void TestParse ()
- {
- // Standard patterns
- DateTime t1 = DateTime.Parse ("02/25/2002");
- AssertEquals ("H00", myTicks[0], t1.Ticks);
- try {
- t1 = DateTime.Parse ("2002-02-25");
- }
- catch (Exception e) {
- Fail ("Unexpected exception. e=" + e);
- }
- AssertEquals ("H01", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002");
- AssertEquals ("H02", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25");
- AssertEquals ("H03", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25:13");
- AssertEquals ("H04", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25");
- AssertEquals ("H05", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25:13");
- AssertEquals ("H06", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("2002-02-25 04:25:13Z");
- AssertEquals ("H07", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.Parse ("February 25");
- AssertEquals ("H08", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 08");
- AssertEquals ("H09", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.Parse ("Mon, 25 Feb 2002 04:25:13 GMT");
- AssertEquals ("H10", myTicks[4], t1.Ticks);
-
- t1 = DateTime.Parse ("2002-02-25T05:25:13");
- AssertEquals ("H11", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.Parse ("05:25");
- AssertEquals("H12", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.Parse ("05:25:13");
- AssertEquals("H13", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H14", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 8");
- AssertEquals ("H16", t2.Ticks, t1.Ticks);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/DecimalTest.cs b/mcs/class/corlib/Test/System/DecimalTest.cs
deleted file mode 100644
index a670f641b31..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest.cs
+++ /dev/null
@@ -1,873 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // for implementation switching only
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-namespace MonoTests.System {
- internal struct ParseTest
- {
- public ParseTest(String str, bool exceptionFlag)
- {
- this.str = str;
- this.exceptionFlag = exceptionFlag;
- this.style = NumberStyles.Number;
- this.d = 0;
- }
-
- public ParseTest(String str, S.Decimal d)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = NumberStyles.Number;
- this.d = d;
- }
-
- public ParseTest(String str, S.Decimal d, NumberStyles style)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = style;
- this.d = d;
- }
-
- public String str;
- public S.Decimal d;
- public NumberStyles style;
- public bool exceptionFlag;
- }
-
- internal struct ToStringTest
- {
- public ToStringTest(String format, S.Decimal d, String str)
- {
- this.format = format;
- this.d = d;
- this.str = str;
- }
-
- public String format;
- public S.Decimal d;
- public String str;
- }
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest : TestCase
- {
- public DecimalTest() : base ("MonoTests.System.DecimalTest testcase") {}
- public DecimalTest(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest)); }
- }
-
- private const int negativeBitValue = unchecked ((int)0x80000000);
- private const int negativeScale4Value = unchecked ((int)0x80040000);
- private int [] parts0 = {0,0,0,0}; //Positive Zero.
- private int [] parts1 = {1,0,0,0};
- private int [] parts2 = {0,1,0,0};
- private int [] parts3 = {0,0,1,0};
- private int [] parts4 = {0,0,0,negativeBitValue}; // Negative zero.
- private int [] parts5 = {1,1,1,0};
- private int [] partsMaxValue = {-1,-1,-1,0};
- private int [] partsMinValue = {-1,-1,-1,negativeBitValue};
- private int [] parts6 = {1234, 5678, 8888, negativeScale4Value};
- private NumberFormatInfo NfiUser;
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ",";
- NfiUser.CurrencyGroupSeparator = "_";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10;
- NfiUser.CurrencyPositivePattern = 3;
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.NumberDecimalSeparator = "##";
- NfiUser.NumberDecimalDigits = 4;
- NfiUser.NumberGroupSeparator = "__";
- NfiUser.NumberGroupSizes = new int[] { 2,1 };
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public void TestToString()
- {
- ToStringTest[] tab = {
- new ToStringTest("F", 12.345678m, "12.35"),
- new ToStringTest("F3", 12.345678m, "12.346"),
- new ToStringTest("F0", 12.345678m, "12"),
- new ToStringTest("F7", 12.345678m, "12.3456780"),
- new ToStringTest("g", 12.345678m, "12.345678"),
- new ToStringTest("E", 12.345678m, "1.234568E+001"),
- new ToStringTest("E3", 12.345678m, "1.235E+001"),
- new ToStringTest("E0", 12.345678m, "1E+001"),
- new ToStringTest("e8", 12.345678m, "1.23456780e+001"),
- new ToStringTest("F", 0.0012m, "0.00"),
- new ToStringTest("F3", 0.0012m, "0.001"),
- new ToStringTest("F0", 0.0012m, "0"),
- new ToStringTest("F6", 0.0012m, "0.001200"),
- new ToStringTest("e", 0.0012m, "1.200000e-003"),
- new ToStringTest("E3", 0.0012m, "1.200E-003"),
- new ToStringTest("E0", 0.0012m, "1E-003"),
- new ToStringTest("E6", 0.0012m, "1.200000E-003"),
- new ToStringTest("F4", -0.001234m, "-0.0012"),
- new ToStringTest("E3", -0.001234m, "-1.234E-003"),
- new ToStringTest("g", -0.000012m, "-1.2e-05"),
- new ToStringTest("g", -0.00012m, "-0.00012"),
- new ToStringTest("g4", -0.00012m, "-0.00012"),
- new ToStringTest("g7", -0.00012m, "-0.00012"),
- new ToStringTest("g", -0.0001234m, "-0.0001234"),
- new ToStringTest("g", -0.0012m, "-0.0012"),
- new ToStringTest("g", -0.001234m, "-0.001234"),
- new ToStringTest("g", -0.012m, "-0.012"),
- new ToStringTest("g4", -0.012m, "-0.012"),
- new ToStringTest("g", -0.12m, "-0.12"),
- new ToStringTest("g", -1.2m, "-1.2"),
- new ToStringTest("g4", -120m, "-120"),
- new ToStringTest("g", -12m, "-12"),
- new ToStringTest("g", -120m, "-120"),
- new ToStringTest("g", -1200m, "-1200"),
- new ToStringTest("g4", -1200m, "-1200"),
- new ToStringTest("g", -1234m, "-1234"),
- new ToStringTest("g", -12000m, "-12000"),
- new ToStringTest("g4", -12000m, "-1.2e+04"),
- new ToStringTest("g5", -12000m, "-12000"),
- new ToStringTest("g", -12345m, "-12345"),
- new ToStringTest("g", -120000m, "-120000"),
- new ToStringTest("g4", -120000m, "-1.2e+05"),
- new ToStringTest("g5", -120000m, "-1.2e+05"),
- new ToStringTest("g6", -120000m, "-120000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g5", -123456.1m, "-1.2346e+05"),
- new ToStringTest("g6", -123456.1m, "-123456"),
- new ToStringTest("g", -1200000m, "-1200000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -1234567.1m, "-1234567.1"),
- new ToStringTest("g", -12000000m, "-12000000"),
- new ToStringTest("g", -12345678.1m, "-12345678.1"),
- new ToStringTest("g", -12000000000000000000m, "-12000000000000000000"),
- new ToStringTest("F", -123, "-123.00"),
- new ToStringTest("F3", -123, "-123.000"),
- new ToStringTest("F0", -123, "-123"),
- new ToStringTest("E3", -123, "-1.230E+002"),
- new ToStringTest("E0", -123, "-1E+002"),
- new ToStringTest("E", -123, "-1.230000E+002"),
- new ToStringTest("F3", S.Decimal.MinValue, "-79228162514264337593543950335.000"),
- new ToStringTest("F", S.Decimal.MinValue, "-79228162514264337593543950335.00"),
- new ToStringTest("F0", S.Decimal.MinValue, "-79228162514264337593543950335"),
- new ToStringTest("E", S.Decimal.MinValue, "-7.922816E+028"),
- new ToStringTest("E3", S.Decimal.MinValue, "-7.923E+028"),
- new ToStringTest("E28", S.Decimal.MinValue, "-7.9228162514264337593543950335E+028"),
- new ToStringTest("E30", S.Decimal.MinValue, "-7.922816251426433759354395033500E+028"),
- new ToStringTest("E0", S.Decimal.MinValue, "-8E+028"),
- new ToStringTest("N3", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
- new ToStringTest("N0", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
- new ToStringTest("N", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.00"),
- new ToStringTest("n3", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
- new ToStringTest("n0", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
- new ToStringTest("n", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.00"),
- new ToStringTest("C", 123456.7890m, NumberFormatInfo.InvariantInfo.CurrencySymbol + "123,456.79"),
- new ToStringTest("C", -123456.7890m, "(" + NumberFormatInfo.InvariantInfo.CurrencySymbol + "123,456.79)"),
- new ToStringTest("C3", 1123456.7890m, NumberFormatInfo.InvariantInfo.CurrencySymbol + "1,123,456.789"),
- new ToStringTest("P", 123456.7891m, "12,345,678.91 %"),
- new ToStringTest("P", -123456.7892m, "-12,345,678.92 %"),
- new ToStringTest("P3", 1234.56789m, "123,456.789 %"),
- };
-
- NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;
-
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- string s = tab[i].d.ToString(tab[i].format, nfi);
- AssertEquals("A01 tab[" + i + "].format = '" + tab[i].format + "')", tab[i].str, s);
- }
- catch (OverflowException)
- {
- Fail(tab[i].d.ToString(tab[i].format, nfi) + " (format = '" + tab[i].format + "'): unexpected exception !");
- }
- catch (NUnit.Framework.AssertionFailedError e) {
- throw e;
- }
- catch (Exception e) {
- Fail ("Unexpected Exception when i = " + i + ". e = " + e);
- }
- }
- }
-
- public void TestCurrencyPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234567.8976m;
- string[] ergCurrencyNegativePattern = new String[16] {
- "(XYZ1234_5_67,898)", "-XYZ1234_5_67,898", "XYZ-1234_5_67,898", "XYZ1234_5_67,898-",
- "(1234_5_67,898XYZ)", "-1234_5_67,898XYZ", "1234_5_67,898-XYZ", "1234_5_67,898XYZ-",
- "-1234_5_67,898 XYZ", "-XYZ 1234_5_67,898", "1234_5_67,898 XYZ-", "XYZ 1234_5_67,898-",
- "XYZ -1234_5_67,898", "1234_5_67,898- XYZ", "(XYZ 1234_5_67,898)", "(1234_5_67,898 XYZ)",
- };
-
- for (int i = 0; i < ergCurrencyNegativePattern.Length; i++)
- {
- nfi2.CurrencyNegativePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyNegativePattern[i])
- {
- Fail("CurrencyNegativePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyNegativePattern[i]);
- }
- }
-
- d = 1234567.8976m;
- string[] ergCurrencyPositivePattern = new String[4] {
- "XYZ1234_5_67,898", "1234_5_67,898XYZ", "XYZ 1234_5_67,898", "1234_5_67,898 XYZ",
- };
-
- for (int i = 0; i < ergCurrencyPositivePattern.Length; i++)
- {
- nfi2.CurrencyPositivePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyPositivePattern[i])
- {
- Fail("CurrencyPositivePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyPositivePattern[i]);
- }
- }
- }
-
- public void TestNumberNegativePattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.89765m;
- string[] ergNumberNegativePattern = new String[5] {
- "(1__2__34##8977)", "-1__2__34##8977", "- 1__2__34##8977", "1__2__34##8977-", "1__2__34##8977 -",
- };
-
- for (int i = 0; i < ergNumberNegativePattern.Length; i++)
- {
- nfi2.NumberNegativePattern = i;
- AssertEquals ("NumberNegativePattern #" + i, ergNumberNegativePattern[i], d.ToString("N", nfi2));
- }
- }
-
- public void TestPercentPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.8976m;
- string[] ergPercentNegativePattern = new String[3] {
- "-1~2~3~4~8~9;8 %%%", "-1~2~3~4~8~9;8%%%", "-%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentNegativePattern.Length; i++)
- {
- nfi2.PercentNegativePattern = i;
- if (d.ToString("P", nfi2) != ergPercentNegativePattern[i])
- {
- Fail("PercentNegativePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentNegativePattern[i]);
- }
- }
-
- d = 1234.8976m;
- string[] ergPercentPositivePattern = new String[3] {
- "1~2~3~4~8~9;8 %%%", "1~2~3~4~8~9;8%%%", "%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentPositivePattern.Length; i++)
- {
- nfi2.PercentPositivePattern = i;
- if (d.ToString("P", nfi2) != ergPercentPositivePattern[i])
- {
- Fail("PercentPositivePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentPositivePattern[i]);
- }
- }
- }
-
- public void TestParse()
- {
- ParseTest[] tab = {
- new ParseTest("1.2345", 1.2345m),
- new ParseTest("-9876543210", -9876543210m),
- new ParseTest(NumberFormatInfo.InvariantInfo.CurrencySymbol
- + " ( 79,228,162,514,264,337,593,543,950,335.000 ) ", S.Decimal.MinValue, NumberStyles.Currency),
- new ParseTest("1.234567890e-10", (S.Decimal)1.234567890e-10, NumberStyles.Float),
- new ParseTest("1.234567890e-24", 1.2346e-24m, NumberStyles.Float),
- new ParseTest(" 47896396.457983645462346E10 ", 478963964579836454.62346m, NumberStyles.Float),
- new ParseTest("-7922816251426433759354395033.250000000000001", -7922816251426433759354395033.3m),
- new ParseTest("-00000000000000795033.2500000000000000", -795033.25m),
- new ParseTest("-000000000000001922816251426433759354395033.300000000000000", -1922816251426433759354395033.3m),
- new ParseTest("-7922816251426433759354395033.150000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2400000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2600000000000", -7922816251426433759354395033.3m)
- };
-
- S.Decimal d;
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- d = S.Decimal.Parse(tab[i].str, tab[i].style, NumberFormatInfo.InvariantInfo);
- if (tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": missing exception !");
- }
- else if (d != tab[i].d)
- {
- Fail(tab[i].str + " != " + d);
- }
- }
- catch (OverflowException)
- {
- if (!tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": unexpected exception !");
- }
- }
- }
-
- try
- {
- d = S.Decimal.Parse(null);
- Fail("Expected ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("123nx");
- Fail("Expected FormatException");
- }
- catch (FormatException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("79228162514264337593543950336");
- Fail("Expected OverflowException" + d);
- }
- catch (OverflowException)
- {
- //ok
- }
- }
-
- public void TestConstants()
- {
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(1m == (decimal)S.Decimal.One);
- Assert(-1m == (decimal)S.Decimal.MinusOne);
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(79228162514264337593543950335m == (decimal)S.Decimal.MaxValue);
- Assert(-79228162514264337593543950335m == (decimal)S.Decimal.MinValue);
- }
-
- public void TestConstructInt32()
- {
- decimal[] dtab = {0m, 1m, -1m, 123456m, -1234567m};
- int[] itab = {0, 1, -1, 123456, -1234567};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- int n = (int) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int32.MaxValue);
- Assert((int)d == Int32.MaxValue);
-
- d = new S.Decimal(Int32.MinValue);
- Assert((int)d == Int32.MinValue);
- }
-
- public void TestConstructUInt32()
- {
- decimal[] dtab = {0m, 1m, 123456m, 123456789m};
- uint[] itab = {0, 1, 123456, 123456789};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- uint n = (uint) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt32.MaxValue);
- Assert((uint)d == UInt32.MaxValue);
-
- d = new Decimal(UInt32.MinValue);
- Assert((uint)d == UInt32.MinValue);
- }
-
- public void TestConstructInt64()
- {
- decimal[] dtab = {0m, 1m, -1m, 9876543m, -9876543210m, 12345678987654321m};
- long[] itab = {0, 1, -1, 9876543, -9876543210L, 12345678987654321L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- long n = (long) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int64.MaxValue);
- Assert((long)d == Int64.MaxValue);
-
- d = new Decimal(Int64.MinValue);
- Assert((long)d == Int64.MinValue);
- }
-
- public void TestConstructUInt64()
- {
- decimal[] dtab = {0m, 1m, 987654321m, 123456789876543210m};
- ulong[] itab = {0, 1, 987654321, 123456789876543210L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- ulong n = (ulong) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt64.MaxValue);
- Assert((ulong)d == UInt64.MaxValue);
-
- d = new Decimal(UInt64.MinValue);
- Assert((ulong)d == UInt64.MinValue);
- }
-
- public void TestConstructSingle()
- {
- S.Decimal d;
-
- d = new S.Decimal(-1.2345678f);
- AssertEquals("A#01", -1.234568m, (decimal)d);
-
- d=3;
- AssertEquals("A#02", 3.0f, (float)d);
-
- d = new S.Decimal(0.0f);
- AssertEquals("A#03", 0m, (decimal)d);
- AssertEquals("A#04", 0.0f, (float)d);
-
- d = new S.Decimal(1.0f);
- AssertEquals("A#05", 1m, (decimal)d);
- AssertEquals("A#06", 1.0f, (float)d);
-
- d = new S.Decimal(-1.2345678f);
- AssertEquals("A#07", -1.234568m, (decimal)d);
- AssertEquals("A#08", -1.234568f, (float)d);
-
- d = new S.Decimal(1.2345673f);
- AssertEquals("A#09", 1.234567m, (decimal)d);
-
- d = new S.Decimal(1.2345673e7f);
- AssertEquals("A#10", 12345670m, (decimal)d);
-
- d = new S.Decimal(1.2345673e-17f);
- AssertEquals("A#11", 0.00000000000000001234567m, (decimal)d);
- AssertEquals("A#12", 1.234567e-17f, (float)d);
-
- // test exceptions
- try
- {
- d = new S.Decimal(Single.MaxValue);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructSingleRounding()
- {
- decimal d;
-
- d = new S.Decimal(1765.2356f);
- Assert(d == 1765.236m);
-
- d = new S.Decimal(1765.23554f);
- Assert("failed banker's rule rounding test 1", d == 1765.236m);
-
- d = new S.Decimal(1765.2354f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.2346f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.23454f);
- Assert("failed banker's rule rounding test 2", d == 1765.234m);
-
- d = new S.Decimal(1765.2344f);
- Assert(d == 1765.234m);
-
- d = new S.Decimal(0.00017652356f);
- Assert(d == 0.0001765236m);
-
- d = new S.Decimal(0.000176523554f);
- Assert("failed banker's rule rounding test 3", d == 0.0001765236m);
-
- d = new S.Decimal(0.00017652354f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.00017652346f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.000176523454f);
- Assert("failed banker's rule rounding test 4", d == 0.0001765234m);
-
- d = new S.Decimal(0.00017652344f);
- Assert(d == 0.0001765234m);
-
- d = new S.Decimal(3.7652356e10f);
- Assert(d == 37652360000m);
-
- d = new S.Decimal(3.7652356e20f);
- Assert(d == 376523600000000000000m);
-
- d = new S.Decimal(3.76523554e20f);
- Assert("failed banker's rule rounding test 5", d == 376523600000000000000m);
-
- d = new S.Decimal(3.7652352e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.7652348e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.76523454e20f);
- Assert("failed banker's rule rounding test 6", d == 376523400000000000000m);
-
- d = new S.Decimal(3.7652342e20f);
- Assert(d == 376523400000000000000m);
- }
-
- public void TestConstructDouble()
- {
- S.Decimal d;
-
- d = new S.Decimal(0.0);
- Assert((decimal)d == 0m);
-
- d = new S.Decimal(1.0);
- Assert((decimal)d == 1m);
- Assert(1.0 == (double)d);
-
- d = new S.Decimal(-1.2345678901234);
- Assert((decimal)d == -1.2345678901234m);
- Assert(-1.2345678901234 == (double)d);
-
- d = new S.Decimal(1.2345678901234);
- Assert((decimal)d == 1.2345678901234m);
-
- d = new S.Decimal(1.2345678901234e8);
- Assert((decimal)d == 123456789.01234m);
- Assert(1.2345678901234e8 == (double)d);
-
- d = new S.Decimal(1.2345678901234e16);
- Assert((decimal)d == 12345678901234000m);
- Assert(1.2345678901234e16 == (double)d);
-
- d = new S.Decimal(1.2345678901234e24);
- Assert((decimal)d == 1234567890123400000000000m);
- Assert(1.2345678901234e24 == (double)d);
-
- d = new S.Decimal(1.2345678901234e28);
- Assert((decimal)d == 1.2345678901234e28m);
- Assert(1.2345678901234e28 == (double)d);
-
- d = new S.Decimal(7.2345678901234e28);
- Assert((decimal)d == 7.2345678901234e28m);
- Assert(new S.Decimal((double)d) == d);
-
- d = new S.Decimal(1.2345678901234e-8);
- Assert((decimal)d == 1.2345678901234e-8m);
-
- d = new S.Decimal(1.2345678901234e-14);
- Assert((decimal)d == 1.2345678901234e-14m);
- Assert(1.2345678901234e-14 == (double)d);
-
- d = new S.Decimal(1.2342278901234e-25);
- Assert((decimal)d == 1.234e-25m);
-
- // test exceptions
- try
- {
- d = new S.Decimal(8e28);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(8e48);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructDoubleRound()
- {
- decimal d;
-
- d = new S.Decimal(1765.231234567857);
- Assert(d == 1765.23123456786m);
-
- d = new S.Decimal(1765.2312345678554);
- Assert("failed banker's rule rounding test 1", d == 1765.23123456786m);
- Assert(1765.23123456786 == (double)d);
-
- d = new S.Decimal(1765.231234567853);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567847);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567843);
- Assert(d == 1765.23123456784m);
-
- d = new S.Decimal(1.765231234567857e-9);
- Assert(d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.7652312345678554e-9);
- Assert("failed banker's rule rounding test 3", d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.765231234567853e-9);
- Assert(d == 1.76523123456785e-9m);
-
- d = new S.Decimal(1.765231234567857e+24);
- Assert(d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.7652312345678554e+24);
- Assert("failed banker's rule rounding test 4", d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.765231234567853e+24);
- Assert(d == 1.76523123456785e+24m);
-
- d = new S.Decimal(1765.2312345678454);
- Assert(d == 1765.23123456785m);
- }
-
- public void TestNegate()
- {
- decimal d;
-
- d = new S.Decimal(12345678);
- Assert((decimal)S.Decimal.Negate(d) == -12345678m);
- }
-
- public void TestPartConstruct()
- {
- decimal d;
-
- d = new Decimal(parts0);
- Assert(d == 0);
-
- d = new Decimal(parts1);
- Assert(d == 1);
-
- d = new Decimal(parts2);
- Assert(d == 4294967296m);
-
- d = new Decimal(parts3);
- Assert(d == 18446744073709551616m);
-
- d = new Decimal(parts4);
- Assert(d == 0m);
-
- d = new Decimal(parts5);
- Assert(d == 18446744078004518913m);
-
- d = new Decimal(partsMaxValue);
- Assert(d == Decimal.MaxValue);
-
- d = new Decimal(partsMinValue);
- Assert(d == Decimal.MinValue);
-
- d = new Decimal(parts6);
- int[] erg = Decimal.GetBits(d);
- for (int i = 0; i < 4; i++)
- {
- Assert(erg[i] == parts6[i]);
- }
- }
-
- public void TestFloorTruncate()
- {
- decimal[,] dtab = {
- {0m, 0m, 0m}, {1m, 1m, 1m}, {-1m, -1m, -1m}, {1.1m, 1m, 1m},
- {-1.000000000001m, -2m, -1m}, {12345.67890m,12345m,12345m},
- {-123456789012345.67890m, -123456789012346m, -123456789012345m},
- {S.Decimal.MaxValue, S.Decimal.MaxValue, S.Decimal.MaxValue},
- {S.Decimal.MinValue, S.Decimal.MinValue, S.Decimal.MinValue},
- {6.999999999m, 6m, 6m}, {-6.999999999m, -7m, -6m},
- {0.00001m, 0m, 0m}, {-0.00001m, -1m, 0m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Floor(dtab[i,0]);
- if (d != dtab[i,1])
- {
- Fail("Floor: Floor(" + dtab[i,0] + ") != " + d);
- }
- d = S.Decimal.Truncate(dtab[i,0]);
- if (d != dtab[i,2])
- {
- Fail("Truncate: Truncate(" + dtab[i,0] + ") != " + d);
- }
- }
- }
-
- public void TestRound()
- {
- decimal[,] dtab = {
- {1m, 0, 1m}, {1.234567890m, 1, 1.2m},
- {1.234567890m, 2, 1.23m}, {1.23450000001m, 3, 1.235m},
- {1.2345m, 3, 1.234m}, {1.2355m, 3, 1.236m},
- {1.234567890m, 4, 1.2346m}, {1.23567890m, 2, 1.24m},
- {47893764694.4578563236436621m, 7, 47893764694.4578563m},
- {-47893764694.4578563236436621m, 9, -47893764694.457856324m},
- {-47893764694.4578m, 5, -47893764694.4578m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Round(dtab[i,0], (int)dtab[i,1]);
- if (d != dtab[i,2])
- {
- Fail("Round: Round(" + dtab[i,0] + "," + (int)dtab[i,1] + ") != " + d);
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System/DecimalTest2.cs b/mcs/class/corlib/Test/System/DecimalTest2.cs
deleted file mode 100644
index d7859c8b456..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest2.cs
+++ /dev/null
@@ -1,3126 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // used for implementation switching
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace MonoTests.System
-{
-
- public enum TestResultInfo
- {
- Ok = 0,
- Overflow = 1,
- ReverseRound = 2,
- DivideByZero = 3,
- ReverseOverflow = 4
- }
-
- public struct TestResult
- {
- public TestResult(int i, decimal v)
- {
- info = (TestResultInfo) i;
- val = v;
- }
-
- public TestResultInfo info;
- public decimal val;
- }
-
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest2 : TestCase
- {
- public DecimalTest2() : base ("MonoTests.System.DecimalTest2 testcase") {}
- public DecimalTest2(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest2)); }
- }
-
- private void ReportOpError(string msg, int i, int j, decimal d1, decimal d2, decimal d3, decimal d3b)
- {
- Fail ("*** " + msg + " for d1=" + d1 + " i=" + i + " d2=" + d2 + " j=" + j + " d3=" + d3 + " d3b=" + d3b + "\n"
- + "Ist:" + d3 + " Soll:" + d3b + " delta=" + (d3 - d3b) + " == " + (d3 == d3b));
- }
-
- public void TestCompare()
- {
- const int size = 14;
- decimal[] data = new decimal[size] {
- 0m, 1m, -1m, 2m, 10m, 0.1m, 0.11m,
- 79228162514264337593543950335m,
- -79228162514264337593543950335m,
- 27703302467091960609331879.532m,
- -3203854.9559968181492513385018m,
- -3203854.9559968181492513385017m,
- -48466870444188873796420.0286m,
- -48466870444188873796420.02860m
- };
-
- short[,] cmpTable = new short[size,size] {
- {0,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,0,1,-1,-1,1,1,-1,1,-1,1,1,1,1},
- {-1,-1,0,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,1,1,0,-1,1,1,-1,1,-1,1,1,1,1},
- {1,1,1,1,0,1,1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,0,-1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,1,0,-1,1,-1,1,1,1,1},
- {1,1,1,1,1,1,1,0,1,1,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1},
- {1,1,1,1,1,1,1,-1,1,0,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,0,-1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,0,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0}
- };
-
- for (int i = 0; i < size; i++)
- {
- S.Decimal d1 = data[i];
- for (int j = 0; j < size; j++)
- {
- Assert(cmpTable[i,j] == -cmpTable[j,i]);
- int x = cmpTable[i,j];
- S.Decimal d2 = data[j];
-
- int y = S.Decimal.Compare(d1, d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- y = d1.CompareTo(d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- bool b = d1 < d2;
- if (x != -1) b = !b;
- Assert(b);
-
- b = d1 <= d2;
- if (x == 1) b = !b;
- Assert(b);
-
- b = d1 >= d2;
- if (x == -1) b = !b;
- Assert(b);
-
- b = d1 > d2;
- if (x != 1) b = !b;
- Assert(b);
-
- b = d1 == d2;
- if (x != 0) b = !b;
- Assert(b);
-
- b = d1.Equals(d2);
- if (x != 0) b = !b;
- Assert(b);
-
- b = S.Decimal.Equals(d1, d2);
- if (x != 0) b = !b;
- Assert(b);
- }
- }
- }
-
- public void TestRemainder()
- {
- Assert((decimal)S.Decimal.Remainder(3.6m, 1.3m) == 1.0m);
- Assert((decimal)S.Decimal.Remainder(79228162514264337593543950335m ,
- 27703302467091960609331879.53200m) == 24420760848422211464106753m);
-
- Assert((decimal)S.Decimal.Remainder(45937986975432m, 43987453m)
- == 42334506m);
- Assert((decimal)S.Decimal.Remainder(45937986975000m, 5000m)
- == 0m);
- Assert((decimal)S.Decimal.Remainder(-54789548973.6234m, 1.3356m)
- == -0.1074m);
- }
-
- public void TestAdd()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Add_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Add(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Add: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Add: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- else if (tr.info == TestResultInfo.Ok)
- {
- d4 = S.Decimal.Subtract(d3, d2);
- if (d4 != d1)
- {
- ReportOpError("Subtract: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Add: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong additions, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestMult()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Mult_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Multiply(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Mult: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Mult: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Mult: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
-
- if (d2 != 0 && tr.info != TestResultInfo.Overflow)
- {
- try
- {
- d4 = S.Decimal.Divide(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("MultDiv: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("MultDiv: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
-
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong multiplications, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestDiv()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Div_build2;
- int errOverflow = 0;
- int errDivideByZero = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Divide(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Div: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else if (tr.info == TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: expected divide by zero", i, j, d1, d2, d3, tr.val);
- errDivideByZero++;
- }
- else
- {
- ReportOpError("Div: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Div: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- catch (DivideByZeroException)
- {
- if (tr.info != TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: unexpected divide by zero", i, j, d1, d2, d3, 0);
- errDivideByZero++;
- }
- }
-
- if (d3 != 0)
- {
- try
- {
- d4 = S.Decimal.Multiply(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("DivMult: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("DivMult: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong division, " + errOverflow + " wrong overflows, " + errDivideByZero + " wrong divide by zero, ");
- }
- }
-
- #region Data
-
-
- // generated argument list build2
- decimal[] auto_build2 = new decimal[] {
- 0m, // 0
- 1m, // 1
- -1m, // 2
- 2m, // 3
- 10m, // 4
- 0.1m, // 5
- 79228162514264337593543950335m, // 6
- -79228162514264337593543950335m, // 7
- 27703302467091960609331879.532m, // 8
- -3203854.9559968181492513385018m, // 9
- -48466870444188873796420.028868m, // 10
- -545193693242804794.30331374676m, // 11
- 0.7629234053338741809892531431m, // 12
- -400453059665371395972.33474452m, // 13
- 222851627785191714190050.61676m, // 14
- 14246043379204153213661335.584m, // 15
- -421123.30446308691436596648186m, // 16
- 24463288738299545.200508898642m, // 17
- -5323259153836385912697776.001m, // 18
- 102801066199805834724673169.19m, // 19
- 7081320760.3793287174700927968m, // 20
- 415752273939.77704245656837041m, // 21
- -6389392489892.6362673670820462m, // 22
- 442346282742915.0596416330681m, // 23
- -512833780867323.89020837443764m, // 24
- 608940580690915704.1450897514m, // 25
- -42535053313319986966115.037787m, // 26
- -7808274522591953107485.8812311m, // 27
- 1037807626804273037330059471.7m, // 28
- -4997122966.448652425771563042m, // 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Add_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 + 0
- new TestResult(0, 1m), // 0 + 1
- new TestResult(0, -1m), // 0 + 2
- new TestResult(0, 2m), // 0 + 3
- new TestResult(0, 10m), // 0 + 4
- new TestResult(0, 0.1m), // 0 + 5
- new TestResult(0, 79228162514264337593543950335m), // 0 + 6
- new TestResult(0, -79228162514264337593543950335m), // 0 + 7
- new TestResult(0, 27703302467091960609331879.532m), // 0 + 8
- new TestResult(0, -3203854.9559968181492513385018m), // 0 + 9
- new TestResult(0, -48466870444188873796420.028868m), // 0 + 10
- new TestResult(0, -545193693242804794.30331374676m), // 0 + 11
- new TestResult(0, 0.7629234053338741809892531431m), // 0 + 12
- new TestResult(0, -400453059665371395972.33474452m), // 0 + 13
- new TestResult(0, 222851627785191714190050.61676m), // 0 + 14
- new TestResult(0, 14246043379204153213661335.584m), // 0 + 15
- new TestResult(0, -421123.30446308691436596648186m), // 0 + 16
- new TestResult(0, 24463288738299545.200508898642m), // 0 + 17
- new TestResult(0, -5323259153836385912697776.001m), // 0 + 18
- new TestResult(0, 102801066199805834724673169.19m), // 0 + 19
- new TestResult(0, 7081320760.3793287174700927968m), // 0 + 20
- new TestResult(0, 415752273939.77704245656837041m), // 0 + 21
- new TestResult(0, -6389392489892.6362673670820462m), // 0 + 22
- new TestResult(0, 442346282742915.0596416330681m), // 0 + 23
- new TestResult(0, -512833780867323.89020837443764m), // 0 + 24
- new TestResult(0, 608940580690915704.1450897514m), // 0 + 25
- new TestResult(0, -42535053313319986966115.037787m), // 0 + 26
- new TestResult(0, -7808274522591953107485.8812311m), // 0 + 27
- new TestResult(0, 1037807626804273037330059471.7m), // 0 + 28
- new TestResult(0, -4997122966.448652425771563042m), // 0 + 29
- new TestResult(0, 1m), // 1 + 0
- new TestResult(0, 2m), // 1 + 1
- new TestResult(0, 0m), // 1 + 2
- new TestResult(0, 3m), // 1 + 3
- new TestResult(0, 11m), // 1 + 4
- new TestResult(0, 1.1m), // 1 + 5
- new TestResult(1, 0m), // 1 + 6
- new TestResult(0, -79228162514264337593543950334m), // 1 + 7
- new TestResult(0, 27703302467091960609331880.532m), // 1 + 8
- new TestResult(0, -3203853.9559968181492513385018m), // 1 + 9
- new TestResult(0, -48466870444188873796419.028868m), // 1 + 10
- new TestResult(0, -545193693242804793.30331374676m), // 1 + 11
- new TestResult(0, 1.7629234053338741809892531431m), // 1 + 12
- new TestResult(0, -400453059665371395971.33474452m), // 1 + 13
- new TestResult(0, 222851627785191714190051.61676m), // 1 + 14
- new TestResult(0, 14246043379204153213661336.584m), // 1 + 15
- new TestResult(0, -421122.30446308691436596648186m), // 1 + 16
- new TestResult(0, 24463288738299546.200508898642m), // 1 + 17
- new TestResult(0, -5323259153836385912697775.001m), // 1 + 18
- new TestResult(0, 102801066199805834724673170.19m), // 1 + 19
- new TestResult(0, 7081320761.3793287174700927968m), // 1 + 20
- new TestResult(0, 415752273940.77704245656837041m), // 1 + 21
- new TestResult(0, -6389392489891.6362673670820462m), // 1 + 22
- new TestResult(0, 442346282742916.0596416330681m), // 1 + 23
- new TestResult(0, -512833780867322.89020837443764m), // 1 + 24
- new TestResult(0, 608940580690915705.1450897514m), // 1 + 25
- new TestResult(0, -42535053313319986966114.037787m), // 1 + 26
- new TestResult(0, -7808274522591953107484.8812311m), // 1 + 27
- new TestResult(0, 1037807626804273037330059472.7m), // 1 + 28
- new TestResult(0, -4997122965.448652425771563042m), // 1 + 29
- new TestResult(0, -1m), // 2 + 0
- new TestResult(0, 0m), // 2 + 1
- new TestResult(0, -2m), // 2 + 2
- new TestResult(0, 1m), // 2 + 3
- new TestResult(0, 9m), // 2 + 4
- new TestResult(0, -0.9m), // 2 + 5
- new TestResult(0, 79228162514264337593543950334m), // 2 + 6
- new TestResult(1, 0m), // 2 + 7
- new TestResult(0, 27703302467091960609331878.532m), // 2 + 8
- new TestResult(0, -3203855.9559968181492513385018m), // 2 + 9
- new TestResult(0, -48466870444188873796421.028868m), // 2 + 10
- new TestResult(0, -545193693242804795.30331374676m), // 2 + 11
- new TestResult(0, -0.2370765946661258190107468569m), // 2 + 12
- new TestResult(0, -400453059665371395973.33474452m), // 2 + 13
- new TestResult(0, 222851627785191714190049.61676m), // 2 + 14
- new TestResult(0, 14246043379204153213661334.584m), // 2 + 15
- new TestResult(0, -421124.30446308691436596648186m), // 2 + 16
- new TestResult(0, 24463288738299544.200508898642m), // 2 + 17
- new TestResult(0, -5323259153836385912697777.001m), // 2 + 18
- new TestResult(0, 102801066199805834724673168.19m), // 2 + 19
- new TestResult(0, 7081320759.3793287174700927968m), // 2 + 20
- new TestResult(0, 415752273938.77704245656837041m), // 2 + 21
- new TestResult(0, -6389392489893.6362673670820462m), // 2 + 22
- new TestResult(0, 442346282742914.0596416330681m), // 2 + 23
- new TestResult(0, -512833780867324.89020837443764m), // 2 + 24
- new TestResult(0, 608940580690915703.1450897514m), // 2 + 25
- new TestResult(0, -42535053313319986966116.037787m), // 2 + 26
- new TestResult(0, -7808274522591953107486.8812311m), // 2 + 27
- new TestResult(0, 1037807626804273037330059470.7m), // 2 + 28
- new TestResult(0, -4997122967.448652425771563042m), // 2 + 29
- new TestResult(0, 2m), // 3 + 0
- new TestResult(0, 3m), // 3 + 1
- new TestResult(0, 1m), // 3 + 2
- new TestResult(0, 4m), // 3 + 3
- new TestResult(0, 12m), // 3 + 4
- new TestResult(0, 2.1m), // 3 + 5
- new TestResult(1, 0m), // 3 + 6
- new TestResult(0, -79228162514264337593543950333m), // 3 + 7
- new TestResult(0, 27703302467091960609331881.532m), // 3 + 8
- new TestResult(0, -3203852.9559968181492513385018m), // 3 + 9
- new TestResult(0, -48466870444188873796418.028868m), // 3 + 10
- new TestResult(0, -545193693242804792.30331374676m), // 3 + 11
- new TestResult(0, 2.7629234053338741809892531431m), // 3 + 12
- new TestResult(0, -400453059665371395970.33474452m), // 3 + 13
- new TestResult(0, 222851627785191714190052.61676m), // 3 + 14
- new TestResult(0, 14246043379204153213661337.584m), // 3 + 15
- new TestResult(0, -421121.30446308691436596648186m), // 3 + 16
- new TestResult(0, 24463288738299547.200508898642m), // 3 + 17
- new TestResult(0, -5323259153836385912697774.001m), // 3 + 18
- new TestResult(0, 102801066199805834724673171.19m), // 3 + 19
- new TestResult(0, 7081320762.3793287174700927968m), // 3 + 20
- new TestResult(0, 415752273941.77704245656837041m), // 3 + 21
- new TestResult(0, -6389392489890.6362673670820462m), // 3 + 22
- new TestResult(0, 442346282742917.0596416330681m), // 3 + 23
- new TestResult(0, -512833780867321.89020837443764m), // 3 + 24
- new TestResult(0, 608940580690915706.1450897514m), // 3 + 25
- new TestResult(0, -42535053313319986966113.037787m), // 3 + 26
- new TestResult(0, -7808274522591953107483.8812311m), // 3 + 27
- new TestResult(0, 1037807626804273037330059473.7m), // 3 + 28
- new TestResult(0, -4997122964.448652425771563042m), // 3 + 29
- new TestResult(0, 10m), // 4 + 0
- new TestResult(0, 11m), // 4 + 1
- new TestResult(0, 9m), // 4 + 2
- new TestResult(0, 12m), // 4 + 3
- new TestResult(0, 20m), // 4 + 4
- new TestResult(0, 10.1m), // 4 + 5
- new TestResult(1, 0m), // 4 + 6
- new TestResult(0, -79228162514264337593543950325m), // 4 + 7
- new TestResult(0, 27703302467091960609331889.532m), // 4 + 8
- new TestResult(0, -3203844.9559968181492513385018m), // 4 + 9
- new TestResult(0, -48466870444188873796410.028868m), // 4 + 10
- new TestResult(0, -545193693242804784.30331374676m), // 4 + 11
- new TestResult(0, 10.762923405333874180989253143m), // 4 + 12
- new TestResult(0, -400453059665371395962.33474452m), // 4 + 13
- new TestResult(0, 222851627785191714190060.61676m), // 4 + 14
- new TestResult(0, 14246043379204153213661345.584m), // 4 + 15
- new TestResult(0, -421113.30446308691436596648186m), // 4 + 16
- new TestResult(0, 24463288738299555.200508898642m), // 4 + 17
- new TestResult(0, -5323259153836385912697766.001m), // 4 + 18
- new TestResult(0, 102801066199805834724673179.19m), // 4 + 19
- new TestResult(0, 7081320770.3793287174700927968m), // 4 + 20
- new TestResult(0, 415752273949.77704245656837041m), // 4 + 21
- new TestResult(0, -6389392489882.6362673670820462m), // 4 + 22
- new TestResult(0, 442346282742925.0596416330681m), // 4 + 23
- new TestResult(0, -512833780867313.89020837443764m), // 4 + 24
- new TestResult(0, 608940580690915714.1450897514m), // 4 + 25
- new TestResult(0, -42535053313319986966105.037787m), // 4 + 26
- new TestResult(0, -7808274522591953107475.8812311m), // 4 + 27
- new TestResult(0, 1037807626804273037330059481.7m), // 4 + 28
- new TestResult(0, -4997122956.448652425771563042m), // 4 + 29
- new TestResult(0, 0.1m), // 5 + 0
- new TestResult(0, 1.1m), // 5 + 1
- new TestResult(0, -0.9m), // 5 + 2
- new TestResult(0, 2.1m), // 5 + 3
- new TestResult(0, 10.1m), // 5 + 4
- new TestResult(0, 0.2m), // 5 + 5
- new TestResult(2, 79228162514264337593543950335m), // 5 + 6
- new TestResult(2, -79228162514264337593543950335m), // 5 + 7
- new TestResult(0, 27703302467091960609331879.632m), // 5 + 8
- new TestResult(0, -3203854.8559968181492513385018m), // 5 + 9
- new TestResult(0, -48466870444188873796419.928868m), // 5 + 10
- new TestResult(0, -545193693242804794.20331374676m), // 5 + 11
- new TestResult(0, 0.8629234053338741809892531431m), // 5 + 12
- new TestResult(0, -400453059665371395972.23474452m), // 5 + 13
- new TestResult(0, 222851627785191714190050.71676m), // 5 + 14
- new TestResult(0, 14246043379204153213661335.684m), // 5 + 15
- new TestResult(0, -421123.20446308691436596648186m), // 5 + 16
- new TestResult(0, 24463288738299545.300508898642m), // 5 + 17
- new TestResult(0, -5323259153836385912697775.901m), // 5 + 18
- new TestResult(0, 102801066199805834724673169.29m), // 5 + 19
- new TestResult(0, 7081320760.4793287174700927968m), // 5 + 20
- new TestResult(0, 415752273939.87704245656837041m), // 5 + 21
- new TestResult(0, -6389392489892.5362673670820462m), // 5 + 22
- new TestResult(0, 442346282742915.1596416330681m), // 5 + 23
- new TestResult(0, -512833780867323.79020837443764m), // 5 + 24
- new TestResult(0, 608940580690915704.2450897514m), // 5 + 25
- new TestResult(0, -42535053313319986966114.937787m), // 5 + 26
- new TestResult(0, -7808274522591953107485.7812311m), // 5 + 27
- new TestResult(0, 1037807626804273037330059471.8m), // 5 + 28
- new TestResult(0, -4997122966.348652425771563042m), // 5 + 29
- new TestResult(0, 79228162514264337593543950335m), // 6 + 0
- new TestResult(1, 0m), // 6 + 1
- new TestResult(0, 79228162514264337593543950334m), // 6 + 2
- new TestResult(1, 0m), // 6 + 3
- new TestResult(1, 0m), // 6 + 4
- new TestResult(0, 79228162514264337593543950335m), // 6 + 5
- new TestResult(1, 0m), // 6 + 6
- new TestResult(0, 0m), // 6 + 7
- new TestResult(1, 0m), // 6 + 8
- new TestResult(0, 79228162514264337593540746480m), // 6 + 9
- new TestResult(0, 79228114047393893404670153915m), // 6 + 10
- new TestResult(0, 79228162513719143900301145541m), // 6 + 11
- new TestResult(1, 0m), // 6 + 12
- new TestResult(0, 79228162113811277928172554363m), // 6 + 13
- new TestResult(1, 0m), // 6 + 14
- new TestResult(1, 0m), // 6 + 15
- new TestResult(0, 79228162514264337593543529212m), // 6 + 16
- new TestResult(1, 0m), // 6 + 17
- new TestResult(0, 79222839255110501207631252559m), // 6 + 18
- new TestResult(1, 0m), // 6 + 19
- new TestResult(1, 0m), // 6 + 20
- new TestResult(1, 0m), // 6 + 21
- new TestResult(0, 79228162514264331204151460442m), // 6 + 22
- new TestResult(1, 0m), // 6 + 23
- new TestResult(0, 79228162514263824759763083011m), // 6 + 24
- new TestResult(1, 0m), // 6 + 25
- new TestResult(0, 79228119979211024273556984220m), // 6 + 26
- new TestResult(0, 79228154705989815001590842849m), // 6 + 27
- new TestResult(1, 0m), // 6 + 28
- new TestResult(0, 79228162514264337588546827369m), // 6 + 29
- new TestResult(0, -79228162514264337593543950335m), // 7 + 0
- new TestResult(0, -79228162514264337593543950334m), // 7 + 1
- new TestResult(1, 0m), // 7 + 2
- new TestResult(0, -79228162514264337593543950333m), // 7 + 3
- new TestResult(0, -79228162514264337593543950325m), // 7 + 4
- new TestResult(0, -79228162514264337593543950335m), // 7 + 5
- new TestResult(0, 0m), // 7 + 6
- new TestResult(1, 0m), // 7 + 7
- new TestResult(0, -79200459211797245632934618455m), // 7 + 8
- new TestResult(1, 0m), // 7 + 9
- new TestResult(1, 0m), // 7 + 10
- new TestResult(1, 0m), // 7 + 11
- new TestResult(0, -79228162514264337593543950334m), // 7 + 12
- new TestResult(1, 0m), // 7 + 13
- new TestResult(0, -79227939662636552401829760284m), // 7 + 14
- new TestResult(0, -79213916470885133440330288999m), // 7 + 15
- new TestResult(1, 0m), // 7 + 16
- new TestResult(0, -79228162514239874304805650790m), // 7 + 17
- new TestResult(1, 0m), // 7 + 18
- new TestResult(0, -79125361448064531758819277166m), // 7 + 19
- new TestResult(0, -79228162514264337586462629575m), // 7 + 20
- new TestResult(0, -79228162514264337177791676395m), // 7 + 21
- new TestResult(1, 0m), // 7 + 22
- new TestResult(0, -79228162514263895247261207420m), // 7 + 23
- new TestResult(1, 0m), // 7 + 24
- new TestResult(0, -79228162513655397012853034631m), // 7 + 25
- new TestResult(1, 0m), // 7 + 26
- new TestResult(1, 0m), // 7 + 27
- new TestResult(0, -78190354887460064556213890863m), // 7 + 28
- new TestResult(1, 0m), // 7 + 29
- new TestResult(0, 27703302467091960609331879.532m), // 8 + 0
- new TestResult(0, 27703302467091960609331880.532m), // 8 + 1
- new TestResult(0, 27703302467091960609331878.532m), // 8 + 2
- new TestResult(0, 27703302467091960609331881.532m), // 8 + 3
- new TestResult(0, 27703302467091960609331889.532m), // 8 + 4
- new TestResult(0, 27703302467091960609331879.632m), // 8 + 5
- new TestResult(1, 0m), // 8 + 6
- new TestResult(2, -79200459211797245632934618455m), // 8 + 7
- new TestResult(0, 55406604934183921218663759.064m), // 8 + 8
- new TestResult(0, 27703302467091960606128024.576m), // 8 + 9
- new TestResult(0, 27654835596647771735535459.503m), // 8 + 10
- new TestResult(0, 27703301921898267366527085.229m), // 8 + 11
- new TestResult(0, 27703302467091960609331880.295m), // 8 + 12
- new TestResult(0, 27702902014032295237935907.197m), // 8 + 13
- new TestResult(0, 27926154094877152323521930.149m), // 8 + 14
- new TestResult(0, 41949345846296113822993215.116m), // 8 + 15
- new TestResult(0, 27703302467091960608910756.228m), // 8 + 16
- new TestResult(0, 27703302491555249347631424.733m), // 8 + 17
- new TestResult(0, 22380043313255574696634103.531m), // 8 + 18
- new TestResult(2, 130504368666897795334005048.72m), // 8 + 19
- new TestResult(0, 27703302467091967690652639.911m), // 8 + 20
- new TestResult(0, 27703302467092376361605819.309m), // 8 + 21
- new TestResult(0, 27703302467085571216841986.896m), // 8 + 22
- new TestResult(0, 27703302467534306892074794.592m), // 8 + 23
- new TestResult(0, 27703302466579126828464555.642m), // 8 + 24
- new TestResult(0, 27703303076032541300247583.677m), // 8 + 25
- new TestResult(0, 27660767413778640622365764.494m), // 8 + 26
- new TestResult(0, 27695494192569368656224393.651m), // 8 + 27
- new TestResult(2, 1065510929271364997939391351.2m), // 8 + 28
- new TestResult(0, 27703302467091955612208913.083m), // 8 + 29
- new TestResult(0, -3203854.9559968181492513385018m), // 9 + 0
- new TestResult(0, -3203853.9559968181492513385018m), // 9 + 1
- new TestResult(0, -3203855.9559968181492513385018m), // 9 + 2
- new TestResult(0, -3203852.9559968181492513385018m), // 9 + 3
- new TestResult(0, -3203844.9559968181492513385018m), // 9 + 4
- new TestResult(0, -3203854.8559968181492513385018m), // 9 + 5
- new TestResult(2, 79228162514264337593540746480m), // 9 + 6
- new TestResult(1, 0m), // 9 + 7
- new TestResult(2, 27703302467091960606128024.576m), // 9 + 8
- new TestResult(0, -6407709.9119936362985026770036m), // 9 + 9
- new TestResult(2, -48466870444188877000274.984865m), // 9 + 10
- new TestResult(2, -545193693246008649.25931056491m), // 9 + 11
- new TestResult(0, -3203854.1930734128153771575125m), // 9 + 12
- new TestResult(2, -400453059665374599827.29074134m), // 9 + 13
- new TestResult(2, 222851627785191710986195.66076m), // 9 + 14
- new TestResult(2, 14246043379204153210457480.628m), // 9 + 15
- new TestResult(0, -3624978.2604599050636173049837m), // 9 + 16
- new TestResult(2, 24463288735095690.244512080493m), // 9 + 17
- new TestResult(2, -5323259153836385915901630.957m), // 9 + 18
- new TestResult(2, 102801066199805834721469314.23m), // 9 + 19
- new TestResult(2, 7078116905.4233318993208414583m), // 9 + 20
- new TestResult(2, 415749070084.82104563841911907m), // 9 + 21
- new TestResult(2, -6389395693747.5922641852312975m), // 9 + 22
- new TestResult(2, 442346279539060.10364481491885m), // 9 + 23
- new TestResult(2, -512833784071178.84620519258689m), // 9 + 24
- new TestResult(2, 608940580687711849.18909293325m), // 9 + 25
- new TestResult(2, -42535053313319990169969.993784m), // 9 + 26
- new TestResult(2, -7808274522591956311340.8372279m), // 9 + 27
- new TestResult(2, 1037807626804273037326855616.7m), // 9 + 28
- new TestResult(2, -5000326821.4046492439208143805m), // 9 + 29
- new TestResult(0, -48466870444188873796420.028868m), // 10 + 0
- new TestResult(0, -48466870444188873796419.028868m), // 10 + 1
- new TestResult(0, -48466870444188873796421.028868m), // 10 + 2
- new TestResult(0, -48466870444188873796418.028868m), // 10 + 3
- new TestResult(0, -48466870444188873796410.028868m), // 10 + 4
- new TestResult(0, -48466870444188873796419.928868m), // 10 + 5
- new TestResult(2, 79228114047393893404670153915m), // 10 + 6
- new TestResult(1, 0m), // 10 + 7
- new TestResult(2, 27654835596647771735535459.503m), // 10 + 8
- new TestResult(0, -48466870444188877000274.984865m), // 10 + 9
- new TestResult(2, -96933740888377747592840.05774m), // 10 + 10
- new TestResult(0, -48467415637882116601214.332182m), // 10 + 11
- new TestResult(0, -48466870444188873796419.265945m), // 10 + 12
- new TestResult(0, -48867323503854245192392.363613m), // 10 + 13
- new TestResult(2, 174384757341002840393630.58789m), // 10 + 14
- new TestResult(2, 14197576508759964339864915.555m), // 10 + 15
- new TestResult(0, -48466870444188874217543.333331m), // 10 + 16
- new TestResult(0, -48466845980900135496874.828359m), // 10 + 17
- new TestResult(2, -5371726024280574786494196.0299m), // 10 + 18
- new TestResult(2, 102752599329361645850876749.16m), // 10 + 19
- new TestResult(0, -48466870444181792475659.649539m), // 10 + 20
- new TestResult(0, -48466870443773121522480.251826m), // 10 + 21
- new TestResult(0, -48466870450578266286312.665135m), // 10 + 22
- new TestResult(0, -48466870001842591053504.969226m), // 10 + 23
- new TestResult(0, -48466870957022654663743.919076m), // 10 + 24
- new TestResult(0, -48466261503608182880715.883778m), // 10 + 25
- new TestResult(2, -91001923757508860762535.06666m), // 10 + 26
- new TestResult(0, -56275144966780826903905.910099m), // 10 + 27
- new TestResult(2, 1037759159933828848456263051.7m), // 10 + 28
- new TestResult(0, -48466870444193870919386.47752m), // 10 + 29
- new TestResult(0, -545193693242804794.30331374676m), // 11 + 0
- new TestResult(0, -545193693242804793.30331374676m), // 11 + 1
- new TestResult(0, -545193693242804795.30331374676m), // 11 + 2
- new TestResult(0, -545193693242804792.30331374676m), // 11 + 3
- new TestResult(0, -545193693242804784.30331374676m), // 11 + 4
- new TestResult(0, -545193693242804794.20331374676m), // 11 + 5
- new TestResult(2, 79228162513719143900301145541m), // 11 + 6
- new TestResult(1, 0m), // 11 + 7
- new TestResult(2, 27703301921898267366527085.229m), // 11 + 8
- new TestResult(0, -545193693246008649.25931056491m), // 11 + 9
- new TestResult(2, -48467415637882116601214.332182m), // 11 + 10
- new TestResult(2, -1090387386485609588.6066274935m), // 11 + 11
- new TestResult(0, -545193693242804793.54039034143m), // 11 + 12
- new TestResult(2, -400998253358614200766.63805827m), // 11 + 13
- new TestResult(2, 222851082591498471385256.31345m), // 11 + 14
- new TestResult(2, 14246042834010459970856541.281m), // 11 + 15
- new TestResult(0, -545193693243225917.60777683367m), // 11 + 16
- new TestResult(0, -520730404504505249.10280484812m), // 11 + 17
- new TestResult(2, -5323259699030079155502570.3043m), // 11 + 18
- new TestResult(2, 102801065654612141481868374.89m), // 11 + 19
- new TestResult(0, -545193686161484033.92398502929m), // 11 + 20
- new TestResult(0, -545193277490530854.52627129019m), // 11 + 21
- new TestResult(0, -545200082635294686.93958111384m), // 11 + 22
- new TestResult(0, -544751346960061879.24367211369m), // 11 + 23
- new TestResult(0, -545706527023672118.1935221212m), // 11 + 24
- new TestResult(0, 63746887448110909.84177600464m), // 11 + 25
- new TestResult(2, -42535598507013229770909.341101m), // 11 + 26
- new TestResult(2, -7808819716285195912280.1845448m), // 11 + 27
- new TestResult(2, 1037807626259079344087254677.4m), // 11 + 28
- new TestResult(0, -545193698239927760.75196617253m), // 11 + 29
- new TestResult(0, 0.7629234053338741809892531431m), // 12 + 0
- new TestResult(0, 1.7629234053338741809892531431m), // 12 + 1
- new TestResult(0, -0.2370765946661258190107468569m), // 12 + 2
- new TestResult(0, 2.7629234053338741809892531431m), // 12 + 3
- new TestResult(2, 10.762923405333874180989253143m), // 12 + 4
- new TestResult(0, 0.8629234053338741809892531431m), // 12 + 5
- new TestResult(1, 0m), // 12 + 6
- new TestResult(2, -79228162514264337593543950334m), // 12 + 7
- new TestResult(2, 27703302467091960609331880.295m), // 12 + 8
- new TestResult(2, -3203854.1930734128153771575125m), // 12 + 9
- new TestResult(2, -48466870444188873796419.265945m), // 12 + 10
- new TestResult(2, -545193693242804793.54039034143m), // 12 + 11
- new TestResult(0, 1.5258468106677483619785062862m), // 12 + 12
- new TestResult(2, -400453059665371395971.57182111m), // 12 + 13
- new TestResult(2, 222851627785191714190051.37968m), // 12 + 14
- new TestResult(2, 14246043379204153213661336.347m), // 12 + 15
- new TestResult(2, -421122.54153968158049178549261m), // 12 + 16
- new TestResult(2, 24463288738299545.963432303976m), // 12 + 17
- new TestResult(2, -5323259153836385912697775.2381m), // 12 + 18
- new TestResult(2, 102801066199805834724673169.95m), // 12 + 19
- new TestResult(2, 7081320761.1422521228039669778m), // 12 + 20
- new TestResult(2, 415752273940.53996586190224459m), // 12 + 21
- new TestResult(2, -6389392489891.873343961748172m), // 12 + 22
- new TestResult(2, 442346282742915.82256503840197m), // 12 + 23
- new TestResult(2, -512833780867323.12728496910377m), // 12 + 24
- new TestResult(2, 608940580690915704.90801315673m), // 12 + 25
- new TestResult(2, -42535053313319986966114.274864m), // 12 + 26
- new TestResult(2, -7808274522591953107485.1183077m), // 12 + 27
- new TestResult(2, 1037807626804273037330059472.5m), // 12 + 28
- new TestResult(2, -4997122965.685729020437688861m), // 12 + 29
- new TestResult(0, -400453059665371395972.33474452m), // 13 + 0
- new TestResult(0, -400453059665371395971.33474452m), // 13 + 1
- new TestResult(0, -400453059665371395973.33474452m), // 13 + 2
- new TestResult(0, -400453059665371395970.33474452m), // 13 + 3
- new TestResult(0, -400453059665371395962.33474452m), // 13 + 4
- new TestResult(0, -400453059665371395972.23474452m), // 13 + 5
- new TestResult(2, 79228162113811277928172554363m), // 13 + 6
- new TestResult(1, 0m), // 13 + 7
- new TestResult(2, 27702902014032295237935907.197m), // 13 + 8
- new TestResult(0, -400453059665374599827.29074134m), // 13 + 9
- new TestResult(2, -48867323503854245192392.363613m), // 13 + 10
- new TestResult(0, -400998253358614200766.63805827m), // 13 + 11
- new TestResult(0, -400453059665371395971.57182111m), // 13 + 12
- new TestResult(2, -800906119330742791944.669489m), // 13 + 13
- new TestResult(2, 222451174725526342794078.28202m), // 13 + 14
- new TestResult(2, 14245642926144487842265363.249m), // 13 + 15
- new TestResult(0, -400453059665371817095.63920761m), // 13 + 16
- new TestResult(0, -400428596376633096427.13423562m), // 13 + 17
- new TestResult(2, -5323659606896051284093748.3357m), // 13 + 18
- new TestResult(2, 102800665746746169353277196.86m), // 13 + 19
- new TestResult(0, -400453059658290075211.9554158m), // 13 + 20
- new TestResult(0, -400453059249619122032.55770206m), // 13 + 21
- new TestResult(0, -400453066054763885864.97101189m), // 13 + 22
- new TestResult(0, -400452617319088653057.27510289m), // 13 + 23
- new TestResult(0, -400453572499152263296.22495289m), // 13 + 24
- new TestResult(0, -399844119084680480268.18965477m), // 13 + 25
- new TestResult(2, -42935506372985358362087.372532m), // 13 + 26
- new TestResult(2, -8208727582257324503458.215976m), // 13 + 27
- new TestResult(2, 1037807226351213371958663499.4m), // 13 + 28
- new TestResult(0, -400453059670368518938.78339695m), // 13 + 29
- new TestResult(0, 222851627785191714190050.61676m), // 14 + 0
- new TestResult(0, 222851627785191714190051.61676m), // 14 + 1
- new TestResult(0, 222851627785191714190049.61676m), // 14 + 2
- new TestResult(0, 222851627785191714190052.61676m), // 14 + 3
- new TestResult(0, 222851627785191714190060.61676m), // 14 + 4
- new TestResult(0, 222851627785191714190050.71676m), // 14 + 5
- new TestResult(1, 0m), // 14 + 6
- new TestResult(2, -79227939662636552401829760284m), // 14 + 7
- new TestResult(2, 27926154094877152323521930.149m), // 14 + 8
- new TestResult(0, 222851627785191710986195.66076m), // 14 + 9
- new TestResult(0, 174384757341002840393630.58789m), // 14 + 10
- new TestResult(0, 222851082591498471385256.31345m), // 14 + 11
- new TestResult(0, 222851627785191714190051.37968m), // 14 + 12
- new TestResult(0, 222451174725526342794078.28202m), // 14 + 13
- new TestResult(0, 445703255570383428380101.23352m), // 14 + 14
- new TestResult(2, 14468895006989344927851386.201m), // 14 + 15
- new TestResult(0, 222851627785191713768927.3123m), // 14 + 16
- new TestResult(0, 222851652248480452489595.81727m), // 14 + 17
- new TestResult(2, -5100407526051194198507725.3842m), // 14 + 18
- new TestResult(2, 103023917827591026438863219.81m), // 14 + 19
- new TestResult(0, 222851627785198795510810.99609m), // 14 + 20
- new TestResult(0, 222851627785607466463990.3938m), // 14 + 21
- new TestResult(0, 222851627778802321700157.98049m), // 14 + 22
- new TestResult(0, 222851628227537996932965.6764m), // 14 + 23
- new TestResult(0, 222851627272357933322726.72655m), // 14 + 24
- new TestResult(0, 222852236725772405105754.76185m), // 14 + 25
- new TestResult(0, 180316574471871727223935.57897m), // 14 + 26
- new TestResult(0, 215043353262599761082564.73553m), // 14 + 27
- new TestResult(2, 1038030478432058229044249522.3m), // 14 + 28
- new TestResult(0, 222851627785186717067084.16811m), // 14 + 29
- new TestResult(0, 14246043379204153213661335.584m), // 15 + 0
- new TestResult(0, 14246043379204153213661336.584m), // 15 + 1
- new TestResult(0, 14246043379204153213661334.584m), // 15 + 2
- new TestResult(0, 14246043379204153213661337.584m), // 15 + 3
- new TestResult(0, 14246043379204153213661345.584m), // 15 + 4
- new TestResult(0, 14246043379204153213661335.684m), // 15 + 5
- new TestResult(1, 0m), // 15 + 6
- new TestResult(2, -79213916470885133440330288999m), // 15 + 7
- new TestResult(0, 41949345846296113822993215.116m), // 15 + 8
- new TestResult(0, 14246043379204153210457480.628m), // 15 + 9
- new TestResult(0, 14197576508759964339864915.555m), // 15 + 10
- new TestResult(0, 14246042834010459970856541.281m), // 15 + 11
- new TestResult(0, 14246043379204153213661336.347m), // 15 + 12
- new TestResult(0, 14245642926144487842265363.249m), // 15 + 13
- new TestResult(0, 14468895006989344927851386.201m), // 15 + 14
- new TestResult(0, 28492086758408306427322671.168m), // 15 + 15
- new TestResult(0, 14246043379204153213240212.28m), // 15 + 16
- new TestResult(0, 14246043403667441951960880.785m), // 15 + 17
- new TestResult(0, 8922784225367767300963559.583m), // 15 + 18
- new TestResult(2, 117047109579009987938334504.77m), // 15 + 19
- new TestResult(0, 14246043379204160294982095.963m), // 15 + 20
- new TestResult(0, 14246043379204568965935275.361m), // 15 + 21
- new TestResult(0, 14246043379197763821171442.948m), // 15 + 22
- new TestResult(0, 14246043379646499496404250.644m), // 15 + 23
- new TestResult(0, 14246043378691319432794011.694m), // 15 + 24
- new TestResult(0, 14246043988144733904577039.729m), // 15 + 25
- new TestResult(0, 14203508325890833226695220.546m), // 15 + 26
- new TestResult(0, 14238235104681561260553849.703m), // 15 + 27
- new TestResult(2, 1052053670183477190543720807.3m), // 15 + 28
- new TestResult(0, 14246043379204148216538369.135m), // 15 + 29
- new TestResult(0, -421123.30446308691436596648186m), // 16 + 0
- new TestResult(0, -421122.30446308691436596648186m), // 16 + 1
- new TestResult(0, -421124.30446308691436596648186m), // 16 + 2
- new TestResult(0, -421121.30446308691436596648186m), // 16 + 3
- new TestResult(0, -421113.30446308691436596648186m), // 16 + 4
- new TestResult(0, -421123.20446308691436596648186m), // 16 + 5
- new TestResult(2, 79228162514264337593543529212m), // 16 + 6
- new TestResult(1, 0m), // 16 + 7
- new TestResult(2, 27703302467091960608910756.228m), // 16 + 8
- new TestResult(2, -3624978.2604599050636173049837m), // 16 + 9
- new TestResult(2, -48466870444188874217543.333331m), // 16 + 10
- new TestResult(2, -545193693243225917.60777683367m), // 16 + 11
- new TestResult(0, -421122.54153968158049178549261m), // 16 + 12
- new TestResult(2, -400453059665371817095.63920761m), // 16 + 13
- new TestResult(2, 222851627785191713768927.3123m), // 16 + 14
- new TestResult(2, 14246043379204153213240212.28m), // 16 + 15
- new TestResult(2, -842246.6089261738287319329637m), // 16 + 16
- new TestResult(2, 24463288737878421.896045811728m), // 16 + 17
- new TestResult(2, -5323259153836385913118899.3055m), // 16 + 18
- new TestResult(2, 102801066199805834724252045.89m), // 16 + 19
- new TestResult(2, 7080899637.0748656305557268303m), // 16 + 20
- new TestResult(2, 415751852816.47257936965400444m), // 16 + 21
- new TestResult(2, -6389392911015.9407304539964122m), // 16 + 22
- new TestResult(2, 442346282321791.75517854615373m), // 16 + 23
- new TestResult(2, -512833781288447.19467146135201m), // 16 + 24
- new TestResult(2, 608940580690494580.84062666449m), // 16 + 25
- new TestResult(2, -42535053313319987387238.34225m), // 16 + 26
- new TestResult(2, -7808274522591953528609.1856942m), // 16 + 27
- new TestResult(2, 1037807626804273037329638348.4m), // 16 + 28
- new TestResult(2, -4997544089.7531155126859290085m), // 16 + 29
- new TestResult(0, 24463288738299545.200508898642m), // 17 + 0
- new TestResult(0, 24463288738299546.200508898642m), // 17 + 1
- new TestResult(0, 24463288738299544.200508898642m), // 17 + 2
- new TestResult(0, 24463288738299547.200508898642m), // 17 + 3
- new TestResult(0, 24463288738299555.200508898642m), // 17 + 4
- new TestResult(0, 24463288738299545.300508898642m), // 17 + 5
- new TestResult(1, 0m), // 17 + 6
- new TestResult(2, -79228162514239874304805650790m), // 17 + 7
- new TestResult(2, 27703302491555249347631424.733m), // 17 + 8
- new TestResult(0, 24463288735095690.244512080493m), // 17 + 9
- new TestResult(2, -48466845980900135496874.828359m), // 17 + 10
- new TestResult(2, -520730404504505249.10280484812m), // 17 + 11
- new TestResult(0, 24463288738299545.963432303976m), // 17 + 12
- new TestResult(2, -400428596376633096427.13423562m), // 17 + 13
- new TestResult(2, 222851652248480452489595.81727m), // 17 + 14
- new TestResult(2, 14246043403667441951960880.785m), // 17 + 15
- new TestResult(0, 24463288737878421.896045811728m), // 17 + 16
- new TestResult(0, 48926577476599090.401017797284m), // 17 + 17
- new TestResult(2, -5323259129373097174398230.8005m), // 17 + 18
- new TestResult(2, 102801066224269123462972714.39m), // 17 + 19
- new TestResult(0, 24463295819620305.579837616112m), // 17 + 20
- new TestResult(0, 24463704490573484.97755135521m), // 17 + 21
- new TestResult(0, 24456899345809652.56424153156m), // 17 + 22
- new TestResult(0, 24905635021042460.26015053171m), // 17 + 23
- new TestResult(0, 23950454957432221.310300524204m), // 17 + 24
- new TestResult(2, 633403869429215249.34559865004m), // 17 + 25
- new TestResult(2, -42535028850031248666569.837278m), // 17 + 26
- new TestResult(2, -7808250059303214807940.6807222m), // 17 + 27
- new TestResult(2, 1037807626828736326068359016.9m), // 17 + 28
- new TestResult(0, 24463283741176578.75185647287m), // 17 + 29
- new TestResult(0, -5323259153836385912697776.001m), // 18 + 0
- new TestResult(0, -5323259153836385912697775.001m), // 18 + 1
- new TestResult(0, -5323259153836385912697777.001m), // 18 + 2
- new TestResult(0, -5323259153836385912697774.001m), // 18 + 3
- new TestResult(0, -5323259153836385912697766.001m), // 18 + 4
- new TestResult(0, -5323259153836385912697775.901m), // 18 + 5
- new TestResult(2, 79222839255110501207631252559m), // 18 + 6
- new TestResult(1, 0m), // 18 + 7
- new TestResult(0, 22380043313255574696634103.531m), // 18 + 8
- new TestResult(0, -5323259153836385915901630.957m), // 18 + 9
- new TestResult(0, -5371726024280574786494196.0299m), // 18 + 10
- new TestResult(0, -5323259699030079155502570.3043m), // 18 + 11
- new TestResult(0, -5323259153836385912697775.2381m), // 18 + 12
- new TestResult(0, -5323659606896051284093748.3357m), // 18 + 13
- new TestResult(0, -5100407526051194198507725.3842m), // 18 + 14
- new TestResult(0, 8922784225367767300963559.583m), // 18 + 15
- new TestResult(0, -5323259153836385913118899.3055m), // 18 + 16
- new TestResult(0, -5323259129373097174398230.8005m), // 18 + 17
- new TestResult(0, -10646518307672771825395552.002m), // 18 + 18
- new TestResult(2, 97477807045969448811975393.19m), // 18 + 19
- new TestResult(0, -5323259153836378831377015.6217m), // 18 + 20
- new TestResult(0, -5323259153835970160423836.224m), // 18 + 21
- new TestResult(0, -5323259153842775305187668.6373m), // 18 + 22
- new TestResult(0, -5323259153394039629954860.9414m), // 18 + 23
- new TestResult(0, -5323259154349219693565099.8912m), // 18 + 24
- new TestResult(0, -5323258544895805221782071.8559m), // 18 + 25
- new TestResult(0, -5365794207149705899663891.0388m), // 18 + 26
- new TestResult(0, -5331067428358977865805261.8822m), // 18 + 27
- new TestResult(2, 1032484367650436651417361695.7m), // 18 + 28
- new TestResult(0, -5323259153836390909820742.4497m), // 18 + 29
- new TestResult(0, 102801066199805834724673169.19m), // 19 + 0
- new TestResult(0, 102801066199805834724673170.19m), // 19 + 1
- new TestResult(0, 102801066199805834724673168.19m), // 19 + 2
- new TestResult(0, 102801066199805834724673171.19m), // 19 + 3
- new TestResult(0, 102801066199805834724673179.19m), // 19 + 4
- new TestResult(0, 102801066199805834724673169.29m), // 19 + 5
- new TestResult(1, 0m), // 19 + 6
- new TestResult(2, -79125361448064531758819277166m), // 19 + 7
- new TestResult(0, 130504368666897795334005048.72m), // 19 + 8
- new TestResult(0, 102801066199805834721469314.23m), // 19 + 9
- new TestResult(0, 102752599329361645850876749.16m), // 19 + 10
- new TestResult(0, 102801065654612141481868374.89m), // 19 + 11
- new TestResult(0, 102801066199805834724673169.95m), // 19 + 12
- new TestResult(0, 102800665746746169353277196.86m), // 19 + 13
- new TestResult(0, 103023917827591026438863219.81m), // 19 + 14
- new TestResult(0, 117047109579009987938334504.77m), // 19 + 15
- new TestResult(0, 102801066199805834724252045.89m), // 19 + 16
- new TestResult(0, 102801066224269123462972714.39m), // 19 + 17
- new TestResult(0, 97477807045969448811975393.19m), // 19 + 18
- new TestResult(0, 205602132399611669449346338.38m), // 19 + 19
- new TestResult(0, 102801066199805841805993929.57m), // 19 + 20
- new TestResult(0, 102801066199806250476947108.97m), // 19 + 21
- new TestResult(0, 102801066199799445332183276.55m), // 19 + 22
- new TestResult(0, 102801066200248181007416084.25m), // 19 + 23
- new TestResult(0, 102801066199293000943805845.3m), // 19 + 24
- new TestResult(0, 102801066808746415415588873.34m), // 19 + 25
- new TestResult(0, 102758531146492514737707054.15m), // 19 + 26
- new TestResult(0, 102793257925283242771565683.31m), // 19 + 27
- new TestResult(2, 1140608693004078872054732640.9m), // 19 + 28
- new TestResult(0, 102801066199805829727550202.74m), // 19 + 29
- new TestResult(0, 7081320760.3793287174700927968m), // 20 + 0
- new TestResult(0, 7081320761.3793287174700927968m), // 20 + 1
- new TestResult(0, 7081320759.3793287174700927968m), // 20 + 2
- new TestResult(0, 7081320762.3793287174700927968m), // 20 + 3
- new TestResult(0, 7081320770.3793287174700927968m), // 20 + 4
- new TestResult(0, 7081320760.4793287174700927968m), // 20 + 5
- new TestResult(1, 0m), // 20 + 6
- new TestResult(2, -79228162514264337586462629575m), // 20 + 7
- new TestResult(2, 27703302467091967690652639.911m), // 20 + 8
- new TestResult(0, 7078116905.4233318993208414583m), // 20 + 9
- new TestResult(2, -48466870444181792475659.649539m), // 20 + 10
- new TestResult(2, -545193686161484033.92398502929m), // 20 + 11
- new TestResult(0, 7081320761.1422521228039669778m), // 20 + 12
- new TestResult(2, -400453059658290075211.9554158m), // 20 + 13
- new TestResult(2, 222851627785198795510810.99609m), // 20 + 14
- new TestResult(2, 14246043379204160294982095.963m), // 20 + 15
- new TestResult(0, 7080899637.0748656305557268303m), // 20 + 16
- new TestResult(2, 24463295819620305.579837616112m), // 20 + 17
- new TestResult(2, -5323259153836378831377015.6217m), // 20 + 18
- new TestResult(2, 102801066199805841805993929.57m), // 20 + 19
- new TestResult(2, 14162641520.758657434940185594m), // 20 + 20
- new TestResult(2, 422833594700.15637117403846321m), // 20 + 21
- new TestResult(2, -6382311169132.2569386496119534m), // 20 + 22
- new TestResult(2, 442353364063675.43897035053819m), // 20 + 23
- new TestResult(2, -512826699546563.51087965696755m), // 20 + 24
- new TestResult(2, 608940587772236464.52441846887m), // 20 + 25
- new TestResult(2, -42535053313312905645354.658458m), // 20 + 26
- new TestResult(2, -7808274522584871786725.5019024m), // 20 + 27
- new TestResult(2, 1037807626804273044411380232.1m), // 20 + 28
- new TestResult(0, 2084197793.9306762916985297548m), // 20 + 29
- new TestResult(0, 415752273939.77704245656837041m), // 21 + 0
- new TestResult(0, 415752273940.77704245656837041m), // 21 + 1
- new TestResult(0, 415752273938.77704245656837041m), // 21 + 2
- new TestResult(0, 415752273941.77704245656837041m), // 21 + 3
- new TestResult(0, 415752273949.77704245656837041m), // 21 + 4
- new TestResult(0, 415752273939.87704245656837041m), // 21 + 5
- new TestResult(1, 0m), // 21 + 6
- new TestResult(2, -79228162514264337177791676395m), // 21 + 7
- new TestResult(2, 27703302467092376361605819.309m), // 21 + 8
- new TestResult(0, 415749070084.82104563841911907m), // 21 + 9
- new TestResult(2, -48466870443773121522480.251826m), // 21 + 10
- new TestResult(2, -545193277490530854.52627129019m), // 21 + 11
- new TestResult(0, 415752273940.53996586190224459m), // 21 + 12
- new TestResult(2, -400453059249619122032.55770206m), // 21 + 13
- new TestResult(2, 222851627785607466463990.3938m), // 21 + 14
- new TestResult(2, 14246043379204568965935275.361m), // 21 + 15
- new TestResult(0, 415751852816.47257936965400444m), // 21 + 16
- new TestResult(2, 24463704490573484.97755135521m), // 21 + 17
- new TestResult(2, -5323259153835970160423836.224m), // 21 + 18
- new TestResult(2, 102801066199806250476947108.97m), // 21 + 19
- new TestResult(0, 422833594700.15637117403846321m), // 21 + 20
- new TestResult(2, 831504547879.5540849131367408m), // 21 + 21
- new TestResult(2, -5973640215952.8592249105136758m), // 21 + 22
- new TestResult(2, 442762035016854.83668408963647m), // 21 + 23
- new TestResult(2, -512418028593384.11316591786927m), // 21 + 24
- new TestResult(2, 608940996443189643.92213220797m), // 21 + 25
- new TestResult(2, -42535053312904234692175.260745m), // 21 + 26
- new TestResult(2, -7808274522176200833546.1041886m), // 21 + 27
- new TestResult(2, 1037807626804273453082333411.5m), // 21 + 28
- new TestResult(0, 410755150973.32839003079680737m), // 21 + 29
- new TestResult(0, -6389392489892.6362673670820462m), // 22 + 0
- new TestResult(0, -6389392489891.6362673670820462m), // 22 + 1
- new TestResult(0, -6389392489893.6362673670820462m), // 22 + 2
- new TestResult(0, -6389392489890.6362673670820462m), // 22 + 3
- new TestResult(0, -6389392489882.6362673670820462m), // 22 + 4
- new TestResult(0, -6389392489892.5362673670820462m), // 22 + 5
- new TestResult(2, 79228162514264331204151460442m), // 22 + 6
- new TestResult(1, 0m), // 22 + 7
- new TestResult(2, 27703302467085571216841986.896m), // 22 + 8
- new TestResult(0, -6389395693747.5922641852312975m), // 22 + 9
- new TestResult(2, -48466870450578266286312.665135m), // 22 + 10
- new TestResult(2, -545200082635294686.93958111384m), // 22 + 11
- new TestResult(0, -6389392489891.873343961748172m), // 22 + 12
- new TestResult(2, -400453066054763885864.97101189m), // 22 + 13
- new TestResult(2, 222851627778802321700157.98049m), // 22 + 14
- new TestResult(2, 14246043379197763821171442.948m), // 22 + 15
- new TestResult(0, -6389392911015.9407304539964122m), // 22 + 16
- new TestResult(2, 24456899345809652.56424153156m), // 22 + 17
- new TestResult(2, -5323259153842775305187668.6373m), // 22 + 18
- new TestResult(2, 102801066199799445332183276.55m), // 22 + 19
- new TestResult(0, -6382311169132.2569386496119534m), // 22 + 20
- new TestResult(0, -5973640215952.8592249105136758m), // 22 + 21
- new TestResult(2, -12778784979785.272534734164092m), // 22 + 22
- new TestResult(2, 435956890253022.42337426598605m), // 22 + 23
- new TestResult(2, -519223173357216.52647574151969m), // 22 + 24
- new TestResult(2, 608934191298425811.50882238432m), // 22 + 25
- new TestResult(2, -42535053319709379456007.674054m), // 22 + 26
- new TestResult(2, -7808274528981345597378.5174985m), // 22 + 27
- new TestResult(2, 1037807626804266647937569579.1m), // 22 + 28
- new TestResult(0, -6394389612859.0849197928536092m), // 22 + 29
- new TestResult(0, 442346282742915.0596416330681m), // 23 + 0
- new TestResult(0, 442346282742916.0596416330681m), // 23 + 1
- new TestResult(0, 442346282742914.0596416330681m), // 23 + 2
- new TestResult(0, 442346282742917.0596416330681m), // 23 + 3
- new TestResult(0, 442346282742925.0596416330681m), // 23 + 4
- new TestResult(0, 442346282742915.1596416330681m), // 23 + 5
- new TestResult(1, 0m), // 23 + 6
- new TestResult(2, -79228162514263895247261207420m), // 23 + 7
- new TestResult(2, 27703302467534306892074794.592m), // 23 + 8
- new TestResult(0, 442346279539060.10364481491885m), // 23 + 9
- new TestResult(2, -48466870001842591053504.969226m), // 23 + 10
- new TestResult(2, -544751346960061879.24367211369m), // 23 + 11
- new TestResult(0, 442346282742915.82256503840197m), // 23 + 12
- new TestResult(2, -400452617319088653057.27510289m), // 23 + 13
- new TestResult(2, 222851628227537996932965.6764m), // 23 + 14
- new TestResult(2, 14246043379646499496404250.644m), // 23 + 15
- new TestResult(0, 442346282321791.75517854615373m), // 23 + 16
- new TestResult(2, 24905635021042460.26015053171m), // 23 + 17
- new TestResult(2, -5323259153394039629954860.9414m), // 23 + 18
- new TestResult(2, 102801066200248181007416084.25m), // 23 + 19
- new TestResult(0, 442353364063675.43897035053819m), // 23 + 20
- new TestResult(0, 442762035016854.83668408963647m), // 23 + 21
- new TestResult(0, 435956890253022.42337426598605m), // 23 + 22
- new TestResult(0, 884692565485830.1192832661362m), // 23 + 23
- new TestResult(0, -70487498124408.83056674136954m), // 23 + 24
- new TestResult(2, 609382926973658619.20473138447m), // 23 + 25
- new TestResult(2, -42535052870973704223199.978145m), // 23 + 26
- new TestResult(2, -7808274080245670364570.8215895m), // 23 + 27
- new TestResult(2, 1037807626804715383612802386.8m), // 23 + 28
- new TestResult(0, 442341285619948.61098920729654m), // 23 + 29
- new TestResult(0, -512833780867323.89020837443764m), // 24 + 0
- new TestResult(0, -512833780867322.89020837443764m), // 24 + 1
- new TestResult(0, -512833780867324.89020837443764m), // 24 + 2
- new TestResult(0, -512833780867321.89020837443764m), // 24 + 3
- new TestResult(0, -512833780867313.89020837443764m), // 24 + 4
- new TestResult(0, -512833780867323.79020837443764m), // 24 + 5
- new TestResult(2, 79228162514263824759763083011m), // 24 + 6
- new TestResult(1, 0m), // 24 + 7
- new TestResult(2, 27703302466579126828464555.642m), // 24 + 8
- new TestResult(0, -512833784071178.84620519258689m), // 24 + 9
- new TestResult(2, -48466870957022654663743.919076m), // 24 + 10
- new TestResult(2, -545706527023672118.1935221212m), // 24 + 11
- new TestResult(0, -512833780867323.12728496910377m), // 24 + 12
- new TestResult(2, -400453572499152263296.22495289m), // 24 + 13
- new TestResult(2, 222851627272357933322726.72655m), // 24 + 14
- new TestResult(2, 14246043378691319432794011.694m), // 24 + 15
- new TestResult(0, -512833781288447.19467146135201m), // 24 + 16
- new TestResult(2, 23950454957432221.310300524204m), // 24 + 17
- new TestResult(2, -5323259154349219693565099.8912m), // 24 + 18
- new TestResult(2, 102801066199293000943805845.3m), // 24 + 19
- new TestResult(0, -512826699546563.51087965696755m), // 24 + 20
- new TestResult(0, -512418028593384.11316591786927m), // 24 + 21
- new TestResult(0, -519223173357216.52647574151969m), // 24 + 22
- new TestResult(0, -70487498124408.83056674136954m), // 24 + 23
- new TestResult(2, -1025667561734647.7804167488753m), // 24 + 24
- new TestResult(2, 608427746910048380.25488137696m), // 24 + 25
- new TestResult(2, -42535053826153767833438.927995m), // 24 + 26
- new TestResult(2, -7808275035425733974809.7714395m), // 24 + 27
- new TestResult(2, 1037807626803760203549192147.8m), // 24 + 28
- new TestResult(0, -512838777990290.3388608002092m), // 24 + 29
- new TestResult(0, 608940580690915704.1450897514m), // 25 + 0
- new TestResult(0, 608940580690915705.1450897514m), // 25 + 1
- new TestResult(0, 608940580690915703.1450897514m), // 25 + 2
- new TestResult(0, 608940580690915706.1450897514m), // 25 + 3
- new TestResult(0, 608940580690915714.1450897514m), // 25 + 4
- new TestResult(0, 608940580690915704.2450897514m), // 25 + 5
- new TestResult(1, 0m), // 25 + 6
- new TestResult(2, -79228162513655397012853034631m), // 25 + 7
- new TestResult(2, 27703303076032541300247583.677m), // 25 + 8
- new TestResult(0, 608940580687711849.18909293325m), // 25 + 9
- new TestResult(2, -48466261503608182880715.883778m), // 25 + 10
- new TestResult(0, 63746887448110909.84177600464m), // 25 + 11
- new TestResult(0, 608940580690915704.90801315673m), // 25 + 12
- new TestResult(2, -399844119084680480268.18965477m), // 25 + 13
- new TestResult(2, 222852236725772405105754.76185m), // 25 + 14
- new TestResult(2, 14246043988144733904577039.729m), // 25 + 15
- new TestResult(0, 608940580690494580.84062666449m), // 25 + 16
- new TestResult(0, 633403869429215249.34559865004m), // 25 + 17
- new TestResult(2, -5323258544895805221782071.8559m), // 25 + 18
- new TestResult(2, 102801066808746415415588873.34m), // 25 + 19
- new TestResult(0, 608940587772236464.52441846887m), // 25 + 20
- new TestResult(0, 608940996443189643.92213220797m), // 25 + 21
- new TestResult(0, 608934191298425811.50882238432m), // 25 + 22
- new TestResult(0, 609382926973658619.20473138447m), // 25 + 23
- new TestResult(0, 608427746910048380.25488137696m), // 25 + 24
- new TestResult(0, 1217881161381831408.2901795028m), // 25 + 25
- new TestResult(2, -42534444372739296050410.892697m), // 25 + 26
- new TestResult(2, -7807665582011262191781.7361413m), // 25 + 27
- new TestResult(2, 1037807627413213618020975175.8m), // 25 + 28
- new TestResult(0, 608940575693792737.69643732563m), // 25 + 29
- new TestResult(0, -42535053313319986966115.037787m), // 26 + 0
- new TestResult(0, -42535053313319986966114.037787m), // 26 + 1
- new TestResult(0, -42535053313319986966116.037787m), // 26 + 2
- new TestResult(0, -42535053313319986966113.037787m), // 26 + 3
- new TestResult(0, -42535053313319986966105.037787m), // 26 + 4
- new TestResult(0, -42535053313319986966114.937787m), // 26 + 5
- new TestResult(2, 79228119979211024273556984220m), // 26 + 6
- new TestResult(1, 0m), // 26 + 7
- new TestResult(2, 27660767413778640622365764.494m), // 26 + 8
- new TestResult(0, -42535053313319990169969.993784m), // 26 + 9
- new TestResult(2, -91001923757508860762535.06666m), // 26 + 10
- new TestResult(0, -42535598507013229770909.341101m), // 26 + 11
- new TestResult(0, -42535053313319986966114.274864m), // 26 + 12
- new TestResult(0, -42935506372985358362087.372532m), // 26 + 13
- new TestResult(2, 180316574471871727223935.57897m), // 26 + 14
- new TestResult(2, 14203508325890833226695220.546m), // 26 + 15
- new TestResult(0, -42535053313319987387238.34225m), // 26 + 16
- new TestResult(0, -42535028850031248666569.837278m), // 26 + 17
- new TestResult(2, -5365794207149705899663891.0388m), // 26 + 18
- new TestResult(2, 102758531146492514737707054.15m), // 26 + 19
- new TestResult(0, -42535053313312905645354.658458m), // 26 + 20
- new TestResult(0, -42535053312904234692175.260745m), // 26 + 21
- new TestResult(0, -42535053319709379456007.674054m), // 26 + 22
- new TestResult(0, -42535052870973704223199.978145m), // 26 + 23
- new TestResult(0, -42535053826153767833438.927995m), // 26 + 24
- new TestResult(0, -42534444372739296050410.892697m), // 26 + 25
- new TestResult(2, -85070106626639973932230.07557m), // 26 + 26
- new TestResult(0, -50343327835911940073600.919018m), // 26 + 27
- new TestResult(2, 1037765091750959717343093356.7m), // 26 + 28
- new TestResult(0, -42535053313324984089081.486439m), // 26 + 29
- new TestResult(0, -7808274522591953107485.8812311m), // 27 + 0
- new TestResult(0, -7808274522591953107484.8812311m), // 27 + 1
- new TestResult(0, -7808274522591953107486.8812311m), // 27 + 2
- new TestResult(0, -7808274522591953107483.8812311m), // 27 + 3
- new TestResult(0, -7808274522591953107475.8812311m), // 27 + 4
- new TestResult(0, -7808274522591953107485.7812311m), // 27 + 5
- new TestResult(2, 79228154705989815001590842849m), // 27 + 6
- new TestResult(1, 0m), // 27 + 7
- new TestResult(2, 27695494192569368656224393.651m), // 27 + 8
- new TestResult(0, -7808274522591956311340.8372279m), // 27 + 9
- new TestResult(2, -56275144966780826903905.910099m), // 27 + 10
- new TestResult(0, -7808819716285195912280.1845448m), // 27 + 11
- new TestResult(0, -7808274522591953107485.1183077m), // 27 + 12
- new TestResult(2, -8208727582257324503458.215976m), // 27 + 13
- new TestResult(2, 215043353262599761082564.73553m), // 27 + 14
- new TestResult(2, 14238235104681561260553849.703m), // 27 + 15
- new TestResult(0, -7808274522591953528609.1856942m), // 27 + 16
- new TestResult(0, -7808250059303214807940.6807222m), // 27 + 17
- new TestResult(2, -5331067428358977865805261.8822m), // 27 + 18
- new TestResult(2, 102793257925283242771565683.31m), // 27 + 19
- new TestResult(0, -7808274522584871786725.5019024m), // 27 + 20
- new TestResult(0, -7808274522176200833546.1041886m), // 27 + 21
- new TestResult(0, -7808274528981345597378.5174985m), // 27 + 22
- new TestResult(0, -7808274080245670364570.8215895m), // 27 + 23
- new TestResult(0, -7808275035425733974809.7714395m), // 27 + 24
- new TestResult(0, -7807665582011262191781.7361413m), // 27 + 25
- new TestResult(2, -50343327835911940073600.919018m), // 27 + 26
- new TestResult(2, -15616549045183906214971.762462m), // 27 + 27
- new TestResult(2, 1037799818529750445376951985.8m), // 27 + 28
- new TestResult(0, -7808274522596950230452.3298835m), // 27 + 29
- new TestResult(0, 1037807626804273037330059471.7m), // 28 + 0
- new TestResult(0, 1037807626804273037330059472.7m), // 28 + 1
- new TestResult(0, 1037807626804273037330059470.7m), // 28 + 2
- new TestResult(0, 1037807626804273037330059473.7m), // 28 + 3
- new TestResult(0, 1037807626804273037330059481.7m), // 28 + 4
- new TestResult(0, 1037807626804273037330059471.8m), // 28 + 5
- new TestResult(1, 0m), // 28 + 6
- new TestResult(2, -78190354887460064556213890863m), // 28 + 7
- new TestResult(0, 1065510929271364997939391351.2m), // 28 + 8
- new TestResult(0, 1037807626804273037326855616.7m), // 28 + 9
- new TestResult(0, 1037759159933828848456263051.7m), // 28 + 10
- new TestResult(0, 1037807626259079344087254677.4m), // 28 + 11
- new TestResult(0, 1037807626804273037330059472.5m), // 28 + 12
- new TestResult(0, 1037807226351213371958663499.4m), // 28 + 13
- new TestResult(0, 1038030478432058229044249522.3m), // 28 + 14
- new TestResult(0, 1052053670183477190543720807.3m), // 28 + 15
- new TestResult(0, 1037807626804273037329638348.4m), // 28 + 16
- new TestResult(0, 1037807626828736326068359016.9m), // 28 + 17
- new TestResult(0, 1032484367650436651417361695.7m), // 28 + 18
- new TestResult(0, 1140608693004078872054732640.9m), // 28 + 19
- new TestResult(0, 1037807626804273044411380232.1m), // 28 + 20
- new TestResult(0, 1037807626804273453082333411.5m), // 28 + 21
- new TestResult(0, 1037807626804266647937569579.1m), // 28 + 22
- new TestResult(0, 1037807626804715383612802386.8m), // 28 + 23
- new TestResult(0, 1037807626803760203549192147.8m), // 28 + 24
- new TestResult(0, 1037807627413213618020975175.8m), // 28 + 25
- new TestResult(0, 1037765091750959717343093356.7m), // 28 + 26
- new TestResult(0, 1037799818529750445376951985.8m), // 28 + 27
- new TestResult(0, 2075615253608546074660118943.4m), // 28 + 28
- new TestResult(0, 1037807626804273032332936505.3m), // 28 + 29
- new TestResult(0, -4997122966.448652425771563042m), // 29 + 0
- new TestResult(0, -4997122965.448652425771563042m), // 29 + 1
- new TestResult(0, -4997122967.448652425771563042m), // 29 + 2
- new TestResult(0, -4997122964.448652425771563042m), // 29 + 3
- new TestResult(0, -4997122956.448652425771563042m), // 29 + 4
- new TestResult(0, -4997122966.348652425771563042m), // 29 + 5
- new TestResult(2, 79228162514264337588546827369m), // 29 + 6
- new TestResult(1, 0m), // 29 + 7
- new TestResult(2, 27703302467091955612208913.083m), // 29 + 8
- new TestResult(0, -5000326821.4046492439208143805m), // 29 + 9
- new TestResult(2, -48466870444193870919386.47752m), // 29 + 10
- new TestResult(2, -545193698239927760.75196617253m), // 29 + 11
- new TestResult(0, -4997122965.685729020437688861m), // 29 + 12
- new TestResult(2, -400453059670368518938.78339695m), // 29 + 13
- new TestResult(2, 222851627785186717067084.16811m), // 29 + 14
- new TestResult(2, 14246043379204148216538369.135m), // 29 + 15
- new TestResult(0, -4997544089.7531155126859290085m), // 29 + 16
- new TestResult(2, 24463283741176578.75185647287m), // 29 + 17
- new TestResult(2, -5323259153836390909820742.4497m), // 29 + 18
- new TestResult(2, 102801066199805829727550202.74m), // 29 + 19
- new TestResult(0, 2084197793.9306762916985297548m), // 29 + 20
- new TestResult(2, 410755150973.32839003079680737m), // 29 + 21
- new TestResult(2, -6394389612859.0849197928536092m), // 29 + 22
- new TestResult(2, 442341285619948.61098920729654m), // 29 + 23
- new TestResult(2, -512838777990290.3388608002092m), // 29 + 24
- new TestResult(2, 608940575693792737.69643732563m), // 29 + 25
- new TestResult(2, -42535053313324984089081.486439m), // 29 + 26
- new TestResult(2, -7808274522596950230452.3298835m), // 29 + 27
- new TestResult(2, 1037807626804273032332936505.3m), // 29 + 28
- new TestResult(0, -9994245932.897304851543126084m), // 29 + 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Mult_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 * 0
- new TestResult(0, 0m), // 0 * 1
- new TestResult(0, 0m), // 0 * 2
- new TestResult(0, 0m), // 0 * 3
- new TestResult(0, 0m), // 0 * 4
- new TestResult(0, 0m), // 0 * 5
- new TestResult(0, 0m), // 0 * 6
- new TestResult(0, 0m), // 0 * 7
- new TestResult(0, 0m), // 0 * 8
- new TestResult(0, 0m), // 0 * 9
- new TestResult(0, 0m), // 0 * 10
- new TestResult(0, 0m), // 0 * 11
- new TestResult(0, 0m), // 0 * 12
- new TestResult(0, 0m), // 0 * 13
- new TestResult(0, 0m), // 0 * 14
- new TestResult(0, 0m), // 0 * 15
- new TestResult(0, 0m), // 0 * 16
- new TestResult(0, 0m), // 0 * 17
- new TestResult(0, 0m), // 0 * 18
- new TestResult(0, 0m), // 0 * 19
- new TestResult(0, 0m), // 0 * 20
- new TestResult(0, 0m), // 0 * 21
- new TestResult(0, 0m), // 0 * 22
- new TestResult(0, 0m), // 0 * 23
- new TestResult(0, 0m), // 0 * 24
- new TestResult(0, 0m), // 0 * 25
- new TestResult(0, 0m), // 0 * 26
- new TestResult(0, 0m), // 0 * 27
- new TestResult(0, 0m), // 0 * 28
- new TestResult(0, 0m), // 0 * 29
- new TestResult(0, 0m), // 1 * 0
- new TestResult(0, 1m), // 1 * 1
- new TestResult(0, -1m), // 1 * 2
- new TestResult(0, 2m), // 1 * 3
- new TestResult(0, 10m), // 1 * 4
- new TestResult(0, 0.1m), // 1 * 5
- new TestResult(0, 79228162514264337593543950335m), // 1 * 6
- new TestResult(0, -79228162514264337593543950335m), // 1 * 7
- new TestResult(0, 27703302467091960609331879.532m), // 1 * 8
- new TestResult(0, -3203854.9559968181492513385018m), // 1 * 9
- new TestResult(0, -48466870444188873796420.028868m), // 1 * 10
- new TestResult(0, -545193693242804794.30331374676m), // 1 * 11
- new TestResult(0, 0.7629234053338741809892531431m), // 1 * 12
- new TestResult(0, -400453059665371395972.33474452m), // 1 * 13
- new TestResult(0, 222851627785191714190050.61676m), // 1 * 14
- new TestResult(0, 14246043379204153213661335.584m), // 1 * 15
- new TestResult(0, -421123.30446308691436596648186m), // 1 * 16
- new TestResult(0, 24463288738299545.200508898642m), // 1 * 17
- new TestResult(0, -5323259153836385912697776.001m), // 1 * 18
- new TestResult(0, 102801066199805834724673169.19m), // 1 * 19
- new TestResult(0, 7081320760.3793287174700927968m), // 1 * 20
- new TestResult(0, 415752273939.77704245656837041m), // 1 * 21
- new TestResult(0, -6389392489892.6362673670820462m), // 1 * 22
- new TestResult(0, 442346282742915.0596416330681m), // 1 * 23
- new TestResult(0, -512833780867323.89020837443764m), // 1 * 24
- new TestResult(0, 608940580690915704.1450897514m), // 1 * 25
- new TestResult(0, -42535053313319986966115.037787m), // 1 * 26
- new TestResult(0, -7808274522591953107485.8812311m), // 1 * 27
- new TestResult(0, 1037807626804273037330059471.7m), // 1 * 28
- new TestResult(0, -4997122966.448652425771563042m), // 1 * 29
- new TestResult(0, 0m), // 2 * 0
- new TestResult(0, -1m), // 2 * 1
- new TestResult(0, 1m), // 2 * 2
- new TestResult(0, -2m), // 2 * 3
- new TestResult(0, -10m), // 2 * 4
- new TestResult(0, -0.1m), // 2 * 5
- new TestResult(0, -79228162514264337593543950335m), // 2 * 6
- new TestResult(0, 79228162514264337593543950335m), // 2 * 7
- new TestResult(0, -27703302467091960609331879.532m), // 2 * 8
- new TestResult(0, 3203854.9559968181492513385018m), // 2 * 9
- new TestResult(0, 48466870444188873796420.028868m), // 2 * 10
- new TestResult(0, 545193693242804794.30331374676m), // 2 * 11
- new TestResult(0, -0.7629234053338741809892531431m), // 2 * 12
- new TestResult(0, 400453059665371395972.33474452m), // 2 * 13
- new TestResult(0, -222851627785191714190050.61676m), // 2 * 14
- new TestResult(0, -14246043379204153213661335.584m), // 2 * 15
- new TestResult(0, 421123.30446308691436596648186m), // 2 * 16
- new TestResult(0, -24463288738299545.200508898642m), // 2 * 17
- new TestResult(0, 5323259153836385912697776.001m), // 2 * 18
- new TestResult(0, -102801066199805834724673169.19m), // 2 * 19
- new TestResult(0, -7081320760.3793287174700927968m), // 2 * 20
- new TestResult(0, -415752273939.77704245656837041m), // 2 * 21
- new TestResult(0, 6389392489892.6362673670820462m), // 2 * 22
- new TestResult(0, -442346282742915.0596416330681m), // 2 * 23
- new TestResult(0, 512833780867323.89020837443764m), // 2 * 24
- new TestResult(0, -608940580690915704.1450897514m), // 2 * 25
- new TestResult(0, 42535053313319986966115.037787m), // 2 * 26
- new TestResult(0, 7808274522591953107485.8812311m), // 2 * 27
- new TestResult(0, -1037807626804273037330059471.7m), // 2 * 28
- new TestResult(0, 4997122966.448652425771563042m), // 2 * 29
- new TestResult(0, 0m), // 3 * 0
- new TestResult(0, 2m), // 3 * 1
- new TestResult(0, -2m), // 3 * 2
- new TestResult(0, 4m), // 3 * 3
- new TestResult(0, 20m), // 3 * 4
- new TestResult(0, 0.2m), // 3 * 5
- new TestResult(1, 0m), // 3 * 6
- new TestResult(1, 0m), // 3 * 7
- new TestResult(0, 55406604934183921218663759.064m), // 3 * 8
- new TestResult(0, -6407709.9119936362985026770036m), // 3 * 9
- new TestResult(2, -96933740888377747592840.05774m), // 3 * 10
- new TestResult(0, -1090387386485609588.6066274935m), // 3 * 11
- new TestResult(0, 1.5258468106677483619785062862m), // 3 * 12
- new TestResult(2, -800906119330742791944.669489m), // 3 * 13
- new TestResult(0, 445703255570383428380101.23352m), // 3 * 14
- new TestResult(0, 28492086758408306427322671.168m), // 3 * 15
- new TestResult(0, -842246.6089261738287319329637m), // 3 * 16
- new TestResult(0, 48926577476599090.401017797284m), // 3 * 17
- new TestResult(0, -10646518307672771825395552.002m), // 3 * 18
- new TestResult(0, 205602132399611669449346338.38m), // 3 * 19
- new TestResult(2, 14162641520.758657434940185594m), // 3 * 20
- new TestResult(0, 831504547879.5540849131367408m), // 3 * 21
- new TestResult(2, -12778784979785.272534734164092m), // 3 * 22
- new TestResult(0, 884692565485830.1192832661362m), // 3 * 23
- new TestResult(0, -1025667561734647.7804167488753m), // 3 * 24
- new TestResult(0, 1217881161381831408.2901795028m), // 3 * 25
- new TestResult(2, -85070106626639973932230.07557m), // 3 * 26
- new TestResult(0, -15616549045183906214971.762462m), // 3 * 27
- new TestResult(0, 2075615253608546074660118943.4m), // 3 * 28
- new TestResult(0, -9994245932.897304851543126084m), // 3 * 29
- new TestResult(0, 0m), // 4 * 0
- new TestResult(0, 10m), // 4 * 1
- new TestResult(0, -10m), // 4 * 2
- new TestResult(0, 20m), // 4 * 3
- new TestResult(0, 100m), // 4 * 4
- new TestResult(0, 1m), // 4 * 5
- new TestResult(1, 0m), // 4 * 6
- new TestResult(1, 0m), // 4 * 7
- new TestResult(0, 277033024670919606093318795.32m), // 4 * 8
- new TestResult(0, -32038549.559968181492513385018m), // 4 * 9
- new TestResult(0, -484668704441888737964200.28868m), // 4 * 10
- new TestResult(0, -5451936932428047943.0331374676m), // 4 * 11
- new TestResult(0, 7.629234053338741809892531431m), // 4 * 12
- new TestResult(0, -4004530596653713959723.3474452m), // 4 * 13
- new TestResult(0, 2228516277851917141900506.1676m), // 4 * 14
- new TestResult(0, 142460433792041532136613355.84m), // 4 * 15
- new TestResult(0, -4211233.0446308691436596648186m), // 4 * 16
- new TestResult(0, 244632887382995452.00508898642m), // 4 * 17
- new TestResult(0, -53232591538363859126977760.01m), // 4 * 18
- new TestResult(0, 1028010661998058347246731691.9m), // 4 * 19
- new TestResult(0, 70813207603.793287174700927968m), // 4 * 20
- new TestResult(0, 4157522739397.7704245656837041m), // 4 * 21
- new TestResult(0, -63893924898926.362673670820462m), // 4 * 22
- new TestResult(0, 4423462827429150.596416330681m), // 4 * 23
- new TestResult(0, -5128337808673238.9020837443764m), // 4 * 24
- new TestResult(0, 6089405806909157041.450897514m), // 4 * 25
- new TestResult(0, -425350533133199869661150.37787m), // 4 * 26
- new TestResult(0, -78082745225919531074858.812311m), // 4 * 27
- new TestResult(0, 10378076268042730373300594717m), // 4 * 28
- new TestResult(0, -49971229664.48652425771563042m), // 4 * 29
- new TestResult(0, 0m), // 5 * 0
- new TestResult(0, 0.1m), // 5 * 1
- new TestResult(0, -0.1m), // 5 * 2
- new TestResult(0, 0.2m), // 5 * 3
- new TestResult(0, 1m), // 5 * 4
- new TestResult(0, 0.01m), // 5 * 5
- new TestResult(0, 7922816251426433759354395033.5m), // 5 * 6
- new TestResult(0, -7922816251426433759354395033.5m), // 5 * 7
- new TestResult(0, 2770330246709196060933187.9532m), // 5 * 8
- new TestResult(0, -320385.49559968181492513385018m), // 5 * 9
- new TestResult(0, -4846687044418887379642.0028868m), // 5 * 10
- new TestResult(0, -54519369324280479.430331374676m), // 5 * 11
- new TestResult(0, 0.0762923405333874180989253143m), // 5 * 12
- new TestResult(0, -40045305966537139597.233474452m), // 5 * 13
- new TestResult(0, 22285162778519171419005.061676m), // 5 * 14
- new TestResult(0, 1424604337920415321366133.5584m), // 5 * 15
- new TestResult(0, -42112.330446308691436596648186m), // 5 * 16
- new TestResult(0, 2446328873829954.5200508898642m), // 5 * 17
- new TestResult(0, -532325915383638591269777.6001m), // 5 * 18
- new TestResult(0, 10280106619980583472467316.919m), // 5 * 19
- new TestResult(0, 708132076.03793287174700927968m), // 5 * 20
- new TestResult(0, 41575227393.977704245656837041m), // 5 * 21
- new TestResult(0, -638939248989.26362673670820462m), // 5 * 22
- new TestResult(0, 44234628274291.50596416330681m), // 5 * 23
- new TestResult(0, -51283378086732.389020837443764m), // 5 * 24
- new TestResult(0, 60894058069091570.41450897514m), // 5 * 25
- new TestResult(0, -4253505331331998696611.5037787m), // 5 * 26
- new TestResult(0, -780827452259195310748.58812311m), // 5 * 27
- new TestResult(0, 103780762680427303733005947.17m), // 5 * 28
- new TestResult(0, -499712296.6448652425771563042m), // 5 * 29
- new TestResult(0, 0m), // 6 * 0
- new TestResult(0, 79228162514264337593543950335m), // 6 * 1
- new TestResult(0, -79228162514264337593543950335m), // 6 * 2
- new TestResult(1, 0m), // 6 * 3
- new TestResult(1, 0m), // 6 * 4
- new TestResult(0, 7922816251426433759354395033.5m), // 6 * 5
- new TestResult(1, 0m), // 6 * 6
- new TestResult(1, 0m), // 6 * 7
- new TestResult(1, 0m), // 6 * 8
- new TestResult(1, 0m), // 6 * 9
- new TestResult(1, 0m), // 6 * 10
- new TestResult(1, 0m), // 6 * 11
- new TestResult(4, 60445019543728147377669509413m), // 6 * 12
- new TestResult(1, 0m), // 6 * 13
- new TestResult(1, 0m), // 6 * 14
- new TestResult(1, 0m), // 6 * 15
- new TestResult(1, 0m), // 6 * 16
- new TestResult(1, 0m), // 6 * 17
- new TestResult(1, 0m), // 6 * 18
- new TestResult(1, 0m), // 6 * 19
- new TestResult(1, 0m), // 6 * 20
- new TestResult(1, 0m), // 6 * 21
- new TestResult(1, 0m), // 6 * 22
- new TestResult(1, 0m), // 6 * 23
- new TestResult(1, 0m), // 6 * 24
- new TestResult(1, 0m), // 6 * 25
- new TestResult(1, 0m), // 6 * 26
- new TestResult(1, 0m), // 6 * 27
- new TestResult(1, 0m), // 6 * 28
- new TestResult(1, 0m), // 6 * 29
- new TestResult(0, 0m), // 7 * 0
- new TestResult(0, -79228162514264337593543950335m), // 7 * 1
- new TestResult(0, 79228162514264337593543950335m), // 7 * 2
- new TestResult(1, 0m), // 7 * 3
- new TestResult(1, 0m), // 7 * 4
- new TestResult(0, -7922816251426433759354395033.5m), // 7 * 5
- new TestResult(1, 0m), // 7 * 6
- new TestResult(1, 0m), // 7 * 7
- new TestResult(1, 0m), // 7 * 8
- new TestResult(1, 0m), // 7 * 9
- new TestResult(1, 0m), // 7 * 10
- new TestResult(1, 0m), // 7 * 11
- new TestResult(4, -60445019543728147377669509413m), // 7 * 12
- new TestResult(1, 0m), // 7 * 13
- new TestResult(1, 0m), // 7 * 14
- new TestResult(1, 0m), // 7 * 15
- new TestResult(1, 0m), // 7 * 16
- new TestResult(1, 0m), // 7 * 17
- new TestResult(1, 0m), // 7 * 18
- new TestResult(1, 0m), // 7 * 19
- new TestResult(1, 0m), // 7 * 20
- new TestResult(1, 0m), // 7 * 21
- new TestResult(1, 0m), // 7 * 22
- new TestResult(1, 0m), // 7 * 23
- new TestResult(1, 0m), // 7 * 24
- new TestResult(1, 0m), // 7 * 25
- new TestResult(1, 0m), // 7 * 26
- new TestResult(1, 0m), // 7 * 27
- new TestResult(1, 0m), // 7 * 28
- new TestResult(1, 0m), // 7 * 29
- new TestResult(0, 0m), // 8 * 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 * 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 * 2
- new TestResult(0, 55406604934183921218663759.064m), // 8 * 3
- new TestResult(0, 277033024670919606093318795.32m), // 8 * 4
- new TestResult(0, 2770330246709196060933187.9532m), // 8 * 5
- new TestResult(1, 0m), // 8 * 6
- new TestResult(1, 0m), // 8 * 7
- new TestResult(1, 0m), // 8 * 8
- new TestResult(1, 0m), // 8 * 9
- new TestResult(1, 0m), // 8 * 10
- new TestResult(1, 0m), // 8 * 11
- new TestResult(2, 21135497857188116458095236.68m), // 8 * 12
- new TestResult(1, 0m), // 8 * 13
- new TestResult(1, 0m), // 8 * 14
- new TestResult(1, 0m), // 8 * 15
- new TestResult(1, 0m), // 8 * 16
- new TestResult(1, 0m), // 8 * 17
- new TestResult(1, 0m), // 8 * 18
- new TestResult(1, 0m), // 8 * 19
- new TestResult(1, 0m), // 8 * 20
- new TestResult(1, 0m), // 8 * 21
- new TestResult(1, 0m), // 8 * 22
- new TestResult(1, 0m), // 8 * 23
- new TestResult(1, 0m), // 8 * 24
- new TestResult(1, 0m), // 8 * 25
- new TestResult(1, 0m), // 8 * 26
- new TestResult(1, 0m), // 8 * 27
- new TestResult(1, 0m), // 8 * 28
- new TestResult(1, 0m), // 8 * 29
- new TestResult(0, 0m), // 9 * 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 * 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 * 2
- new TestResult(0, -6407709.9119936362985026770036m), // 9 * 3
- new TestResult(0, -32038549.559968181492513385018m), // 9 * 4
- new TestResult(0, -320385.49559968181492513385018m), // 9 * 5
- new TestResult(1, 0m), // 9 * 6
- new TestResult(1, 0m), // 9 * 7
- new TestResult(1, 0m), // 9 * 8
- new TestResult(2, 10264686579065.373559419307221m), // 9 * 9
- new TestResult(1, 0m), // 9 * 10
- new TestResult(2, 1746721516074169126608222.1692m), // 9 * 11
- new TestResult(2, -2444295.933224902121034426698m), // 9 * 12
- new TestResult(2, 1282993519852989666698903060.5m), // 9 * 13
- new TestResult(1, 0m), // 9 * 14
- new TestResult(1, 0m), // 9 * 15
- new TestResult(0, 1349217986089.8179781485646335m), // 9 * 16
- new TestResult(0, -78376828864182146369609.767831m), // 9 * 17
- new TestResult(1, 0m), // 9 * 18
- new TestResult(1, 0m), // 9 * 19
- new TestResult(0, -22687524613144469.045656755412m), // 9 * 20
- new TestResult(0, -1332009983328901461.3254059884m), // 9 * 21
- new TestResult(0, 20470686794551372519.831909846m), // 9 * 22
- new TestResult(0, -1417213330232658207868.9685141m), // 9 * 23
- new TestResult(0, 1643045050434361863551.7087135m), // 9 * 24
- new TestResult(0, -1950957297354170624860913.7855m), // 9 * 25
- new TestResult(1, 0m), // 9 * 26
- new TestResult(0, 25016579026989918165002777574m), // 9 * 27
- new TestResult(1, 0m), // 9 * 28
- new TestResult(2, 16010057181782036.694377696165m), // 9 * 29
- new TestResult(0, 0m), // 10 * 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 * 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 * 2
- new TestResult(2, -96933740888377747592840.05774m), // 10 * 3
- new TestResult(0, -484668704441888737964200.28868m), // 10 * 4
- new TestResult(0, -4846687044418887379642.0028868m), // 10 * 5
- new TestResult(1, 0m), // 10 * 6
- new TestResult(1, 0m), // 10 * 7
- new TestResult(1, 0m), // 10 * 8
- new TestResult(1, 0m), // 10 * 9
- new TestResult(1, 0m), // 10 * 10
- new TestResult(1, 0m), // 10 * 11
- new TestResult(0, -36976509845156274734545.845161m), // 10 * 12
- new TestResult(1, 0m), // 10 * 13
- new TestResult(1, 0m), // 10 * 14
- new TestResult(1, 0m), // 10 * 15
- new TestResult(2, 20410528638441139616161910791m), // 10 * 16
- new TestResult(1, 0m), // 10 * 17
- new TestResult(1, 0m), // 10 * 18
- new TestResult(1, 0m), // 10 * 19
- new TestResult(1, 0m), // 10 * 20
- new TestResult(1, 0m), // 10 * 21
- new TestResult(1, 0m), // 10 * 22
- new TestResult(1, 0m), // 10 * 23
- new TestResult(1, 0m), // 10 * 24
- new TestResult(1, 0m), // 10 * 25
- new TestResult(1, 0m), // 10 * 26
- new TestResult(1, 0m), // 10 * 27
- new TestResult(1, 0m), // 10 * 28
- new TestResult(1, 0m), // 10 * 29
- new TestResult(0, 0m), // 11 * 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 * 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 * 2
- new TestResult(2, -1090387386485609588.6066274935m), // 11 * 3
- new TestResult(0, -5451936932428047943.0331374676m), // 11 * 4
- new TestResult(0, -54519369324280479.430331374676m), // 11 * 5
- new TestResult(1, 0m), // 11 * 6
- new TestResult(1, 0m), // 11 * 7
- new TestResult(1, 0m), // 11 * 8
- new TestResult(2, 1746721516074169126608222.1692m), // 11 * 9
- new TestResult(1, 0m), // 11 * 10
- new TestResult(1, 0m), // 11 * 11
- new TestResult(0, -415941029015352223.2321562927m), // 11 * 12
- new TestResult(1, 0m), // 11 * 13
- new TestResult(1, 0m), // 11 * 14
- new TestResult(1, 0m), // 11 * 15
- new TestResult(0, 229593769670844494339647.60593m), // 11 * 16
- new TestResult(1, 0m), // 11 * 17
- new TestResult(1, 0m), // 11 * 18
- new TestResult(1, 0m), // 11 * 19
- new TestResult(0, -3860691418388152934958161711.9m), // 11 * 20
- new TestResult(1, 0m), // 11 * 21
- new TestResult(1, 0m), // 11 * 22
- new TestResult(1, 0m), // 11 * 23
- new TestResult(1, 0m), // 11 * 24
- new TestResult(1, 0m), // 11 * 25
- new TestResult(1, 0m), // 11 * 26
- new TestResult(1, 0m), // 11 * 27
- new TestResult(1, 0m), // 11 * 28
- new TestResult(2, 2724399925666581324856736883m), // 11 * 29
- new TestResult(0, 0m), // 12 * 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 * 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 * 2
- new TestResult(0, 1.5258468106677483619785062862m), // 12 * 3
- new TestResult(0, 7.629234053338741809892531431m), // 12 * 4
- new TestResult(2, 0.0762923405333874180989253143m), // 12 * 5
- new TestResult(0, 60445019543728147377669509413m), // 12 * 6
- new TestResult(0, -60445019543728147377669509413m), // 12 * 7
- new TestResult(0, 21135497857188116458095236.68m), // 12 * 8
- new TestResult(0, -2444295.933224902121034426698m), // 12 * 9
- new TestResult(0, -36976509845156274734545.845161m), // 12 * 10
- new TestResult(0, -415941029015352223.2321562927m), // 12 * 11
- new TestResult(0, 0.5820521224062348791152865214m), // 12 * 12
- new TestResult(0, -305515011956274243325.23330625m), // 12 * 13
- new TestResult(0, 170018722754075475876563.00661m), // 12 * 14
- new TestResult(0, 10868639927396524825477357.557m), // 12 * 15
- new TestResult(0, -321284.82550643216389212760083m), // 12 * 16
- new TestResult(0, 18663615549889303.426127037208m), // 12 * 17
- new TestResult(0, -4061239001119573143590088.0528m), // 12 * 18
- new TestResult(0, 78429339497108899549297058.831m), // 12 * 19
- new TestResult(0, 5402505348.7700567259404098662m), // 12 * 20
- new TestResult(0, 317187140609.43641612785737895m), // 12 * 21
- new TestResult(0, -4874617076403.5713301079734445m), // 12 * 22
- new TestResult(0, 337476332367005.49979200414696m), // 12 * 23
- new TestResult(0, -391252894469544.55412631906773m), // 12 * 24
- new TestResult(0, 464575021466700199.22364418475m), // 12 * 25
- new TestResult(0, -32450987719855972399063.033158m), // 12 * 26
- new TestResult(0, -5957115388557583551533.0994303m), // 12 * 27
- new TestResult(0, 791767728722982425613218218.59m), // 12 * 28
- new TestResult(0, -3812422070.43511700405678157m), // 12 * 29
- new TestResult(0, 0m), // 13 * 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 * 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 * 2
- new TestResult(2, -800906119330742791944.669489m), // 13 * 3
- new TestResult(0, -4004530596653713959723.3474452m), // 13 * 4
- new TestResult(0, -40045305966537139597.233474452m), // 13 * 5
- new TestResult(1, 0m), // 13 * 6
- new TestResult(1, 0m), // 13 * 7
- new TestResult(1, 0m), // 13 * 8
- new TestResult(2, 1282993519852989666698903060.5m), // 13 * 9
- new TestResult(1, 0m), // 13 * 10
- new TestResult(1, 0m), // 13 * 11
- new TestResult(0, -305515011956274243325.23330625m), // 13 * 12
- new TestResult(1, 0m), // 13 * 13
- new TestResult(1, 0m), // 13 * 14
- new TestResult(1, 0m), // 13 * 15
- new TestResult(2, 168640115768634908407809010.03m), // 13 * 16
- new TestResult(1, 0m), // 13 * 17
- new TestResult(1, 0m), // 13 * 18
- new TestResult(1, 0m), // 13 * 19
- new TestResult(1, 0m), // 13 * 20
- new TestResult(1, 0m), // 13 * 21
- new TestResult(1, 0m), // 13 * 22
- new TestResult(1, 0m), // 13 * 23
- new TestResult(1, 0m), // 13 * 24
- new TestResult(1, 0m), // 13 * 25
- new TestResult(1, 0m), // 13 * 26
- new TestResult(1, 0m), // 13 * 27
- new TestResult(1, 0m), // 13 * 28
- new TestResult(1, 0m), // 13 * 29
- new TestResult(0, 0m), // 14 * 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 * 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 * 2
- new TestResult(0, 445703255570383428380101.23352m), // 14 * 3
- new TestResult(0, 2228516277851917141900506.1676m), // 14 * 4
- new TestResult(0, 22285162778519171419005.061676m), // 14 * 5
- new TestResult(1, 0m), // 14 * 6
- new TestResult(1, 0m), // 14 * 7
- new TestResult(1, 0m), // 14 * 8
- new TestResult(1, 0m), // 14 * 9
- new TestResult(1, 0m), // 14 * 10
- new TestResult(1, 0m), // 14 * 11
- new TestResult(0, 170018722754075475876563.00661m), // 14 * 12
- new TestResult(1, 0m), // 14 * 13
- new TestResult(1, 0m), // 14 * 14
- new TestResult(1, 0m), // 14 * 15
- new TestResult(1, 0m), // 14 * 16
- new TestResult(1, 0m), // 14 * 17
- new TestResult(1, 0m), // 14 * 18
- new TestResult(1, 0m), // 14 * 19
- new TestResult(1, 0m), // 14 * 20
- new TestResult(1, 0m), // 14 * 21
- new TestResult(1, 0m), // 14 * 22
- new TestResult(1, 0m), // 14 * 23
- new TestResult(1, 0m), // 14 * 24
- new TestResult(1, 0m), // 14 * 25
- new TestResult(1, 0m), // 14 * 26
- new TestResult(1, 0m), // 14 * 27
- new TestResult(1, 0m), // 14 * 28
- new TestResult(1, 0m), // 14 * 29
- new TestResult(0, 0m), // 15 * 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 * 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 * 2
- new TestResult(0, 28492086758408306427322671.168m), // 15 * 3
- new TestResult(0, 142460433792041532136613355.84m), // 15 * 4
- new TestResult(0, 1424604337920415321366133.5584m), // 15 * 5
- new TestResult(1, 0m), // 15 * 6
- new TestResult(1, 0m), // 15 * 7
- new TestResult(1, 0m), // 15 * 8
- new TestResult(1, 0m), // 15 * 9
- new TestResult(1, 0m), // 15 * 10
- new TestResult(1, 0m), // 15 * 11
- new TestResult(0, 10868639927396524825477357.557m), // 15 * 12
- new TestResult(1, 0m), // 15 * 13
- new TestResult(1, 0m), // 15 * 14
- new TestResult(1, 0m), // 15 * 15
- new TestResult(1, 0m), // 15 * 16
- new TestResult(1, 0m), // 15 * 17
- new TestResult(1, 0m), // 15 * 18
- new TestResult(1, 0m), // 15 * 19
- new TestResult(1, 0m), // 15 * 20
- new TestResult(1, 0m), // 15 * 21
- new TestResult(1, 0m), // 15 * 22
- new TestResult(1, 0m), // 15 * 23
- new TestResult(1, 0m), // 15 * 24
- new TestResult(1, 0m), // 15 * 25
- new TestResult(1, 0m), // 15 * 26
- new TestResult(1, 0m), // 15 * 27
- new TestResult(1, 0m), // 15 * 28
- new TestResult(1, 0m), // 15 * 29
- new TestResult(0, 0m), // 16 * 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 * 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 * 2
- new TestResult(2, -842246.6089261738287319329637m), // 16 * 3
- new TestResult(0, -4211233.0446308691436596648186m), // 16 * 4
- new TestResult(0, -42112.330446308691436596648186m), // 16 * 5
- new TestResult(1, 0m), // 16 * 6
- new TestResult(1, 0m), // 16 * 7
- new TestResult(1, 0m), // 16 * 8
- new TestResult(0, 1349217986089.8179781485646335m), // 16 * 9
- new TestResult(2, 20410528638441139616161910791m), // 16 * 10
- new TestResult(0, 229593769670844494339647.60593m), // 16 * 11
- new TestResult(0, -321284.82550643216389212760083m), // 16 * 12
- new TestResult(2, 168640115768634908407809010.03m), // 16 * 13
- new TestResult(1, 0m), // 16 * 14
- new TestResult(1, 0m), // 16 * 15
- new TestResult(2, 177344837561.90979904837123025m), // 16 * 16
- new TestResult(2, -10302060991507324713598.483586m), // 16 * 17
- new TestResult(1, 0m), // 16 * 18
- new TestResult(1, 0m), // 16 * 19
- new TestResult(2, -2982109198574002.1833628108505m), // 16 * 20
- new TestResult(2, -175082971439561442.82206371811m), // 16 * 21
- new TestResult(2, 2690722078855217643.0013135833m), // 16 * 22
- new TestResult(2, -186282328305659347664.31347679m), // 16 * 23
- new TestResult(2, 215966256439146035447.16512997m), // 16 * 24
- new TestResult(0, -256439069562229438659442.67473m), // 16 * 25
- new TestResult(2, 17912502206818886711664532432m), // 16 * 26
- new TestResult(0, 3288246369108855691627019039.6m), // 16 * 27
- new TestResult(1, 0m), // 16 * 28
- new TestResult(2, 2104404936439239.9111285468803m), // 16 * 29
- new TestResult(0, 0m), // 17 * 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 * 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 * 2
- new TestResult(0, 48926577476599090.401017797284m), // 17 * 3
- new TestResult(0, 244632887382995452.00508898642m), // 17 * 4
- new TestResult(0, 2446328873829954.5200508898642m), // 17 * 5
- new TestResult(1, 0m), // 17 * 6
- new TestResult(1, 0m), // 17 * 7
- new TestResult(1, 0m), // 17 * 8
- new TestResult(0, -78376828864182146369609.767831m), // 17 * 9
- new TestResult(1, 0m), // 17 * 10
- new TestResult(1, 0m), // 17 * 11
- new TestResult(0, 18663615549889303.426127037208m), // 17 * 12
- new TestResult(1, 0m), // 17 * 13
- new TestResult(1, 0m), // 17 * 14
- new TestResult(1, 0m), // 17 * 15
- new TestResult(2, -10302060991507324713598.483586m), // 17 * 16
- new TestResult(1, 0m), // 17 * 17
- new TestResult(1, 0m), // 17 * 18
- new TestResult(1, 0m), // 17 * 19
- new TestResult(0, 173232394409674404469121757.58m), // 17 * 20
- new TestResult(2, 10170667920993375211218037940m), // 17 * 21
- new TestResult(1, 0m), // 17 * 22
- new TestResult(1, 0m), // 17 * 23
- new TestResult(1, 0m), // 17 * 24
- new TestResult(1, 0m), // 17 * 25
- new TestResult(1, 0m), // 17 * 26
- new TestResult(1, 0m), // 17 * 27
- new TestResult(1, 0m), // 17 * 28
- new TestResult(0, -122246061989021334943606343.1m), // 17 * 29
- new TestResult(0, 0m), // 18 * 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 * 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 * 2
- new TestResult(0, -10646518307672771825395552.002m), // 18 * 3
- new TestResult(0, -53232591538363859126977760.01m), // 18 * 4
- new TestResult(0, -532325915383638591269777.6001m), // 18 * 5
- new TestResult(1, 0m), // 18 * 6
- new TestResult(1, 0m), // 18 * 7
- new TestResult(1, 0m), // 18 * 8
- new TestResult(1, 0m), // 18 * 9
- new TestResult(1, 0m), // 18 * 10
- new TestResult(1, 0m), // 18 * 11
- new TestResult(2, -4061239001119573143590088.0528m), // 18 * 12
- new TestResult(1, 0m), // 18 * 13
- new TestResult(1, 0m), // 18 * 14
- new TestResult(1, 0m), // 18 * 15
- new TestResult(1, 0m), // 18 * 16
- new TestResult(1, 0m), // 18 * 17
- new TestResult(1, 0m), // 18 * 18
- new TestResult(1, 0m), // 18 * 19
- new TestResult(1, 0m), // 18 * 20
- new TestResult(1, 0m), // 18 * 21
- new TestResult(1, 0m), // 18 * 22
- new TestResult(1, 0m), // 18 * 23
- new TestResult(1, 0m), // 18 * 24
- new TestResult(1, 0m), // 18 * 25
- new TestResult(1, 0m), // 18 * 26
- new TestResult(1, 0m), // 18 * 27
- new TestResult(1, 0m), // 18 * 28
- new TestResult(1, 0m), // 18 * 29
- new TestResult(0, 0m), // 19 * 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 * 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 * 2
- new TestResult(0, 205602132399611669449346338.38m), // 19 * 3
- new TestResult(0, 1028010661998058347246731691.9m), // 19 * 4
- new TestResult(0, 10280106619980583472467316.919m), // 19 * 5
- new TestResult(1, 0m), // 19 * 6
- new TestResult(1, 0m), // 19 * 7
- new TestResult(1, 0m), // 19 * 8
- new TestResult(1, 0m), // 19 * 9
- new TestResult(1, 0m), // 19 * 10
- new TestResult(1, 0m), // 19 * 11
- new TestResult(0, 78429339497108899549297058.831m), // 19 * 12
- new TestResult(1, 0m), // 19 * 13
- new TestResult(1, 0m), // 19 * 14
- new TestResult(1, 0m), // 19 * 15
- new TestResult(1, 0m), // 19 * 16
- new TestResult(1, 0m), // 19 * 17
- new TestResult(1, 0m), // 19 * 18
- new TestResult(1, 0m), // 19 * 19
- new TestResult(1, 0m), // 19 * 20
- new TestResult(1, 0m), // 19 * 21
- new TestResult(1, 0m), // 19 * 22
- new TestResult(1, 0m), // 19 * 23
- new TestResult(1, 0m), // 19 * 24
- new TestResult(1, 0m), // 19 * 25
- new TestResult(1, 0m), // 19 * 26
- new TestResult(1, 0m), // 19 * 27
- new TestResult(1, 0m), // 19 * 28
- new TestResult(1, 0m), // 19 * 29
- new TestResult(0, 0m), // 20 * 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 * 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 * 2
- new TestResult(2, 14162641520.758657434940185594m), // 20 * 3
- new TestResult(0, 70813207603.793287174700927968m), // 20 * 4
- new TestResult(0, 708132076.03793287174700927968m), // 20 * 5
- new TestResult(1, 0m), // 20 * 6
- new TestResult(1, 0m), // 20 * 7
- new TestResult(1, 0m), // 20 * 8
- new TestResult(0, -22687524613144469.045656755412m), // 20 * 9
- new TestResult(1, 0m), // 20 * 10
- new TestResult(0, -3860691418388152934958161711.9m), // 20 * 11
- new TestResult(0, 5402505348.7700567259404098662m), // 20 * 12
- new TestResult(1, 0m), // 20 * 13
- new TestResult(1, 0m), // 20 * 14
- new TestResult(1, 0m), // 20 * 15
- new TestResult(2, -2982109198574002.1833628108505m), // 20 * 16
- new TestResult(2, 173232394409674404469121757.58m), // 20 * 17
- new TestResult(1, 0m), // 20 * 18
- new TestResult(1, 0m), // 20 * 19
- new TestResult(0, 50145103711379274243.914175878m), // 20 * 20
- new TestResult(2, 2944075208624656937377.9493098m), // 20 * 21
- new TestResult(0, -45245337684888495429839.445203m), // 20 * 22
- new TestResult(2, 3132395915264028802867467.4171m), // 20 * 23
- new TestResult(2, -3631540499079604049748263.216m), // 20 * 24
- new TestResult(0, 4312103575884025168661620716.9m), // 20 * 25
- new TestResult(1, 0m), // 20 * 26
- new TestResult(1, 0m), // 20 * 27
- new TestResult(1, 0m), // 20 * 28
- new TestResult(2, -35386230604481178142.543841269m), // 20 * 29
- new TestResult(0, 0m), // 21 * 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 * 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 * 2
- new TestResult(2, 831504547879.5540849131367408m), // 21 * 3
- new TestResult(0, 4157522739397.7704245656837041m), // 21 * 4
- new TestResult(0, 41575227393.977704245656837041m), // 21 * 5
- new TestResult(1, 0m), // 21 * 6
- new TestResult(1, 0m), // 21 * 7
- new TestResult(1, 0m), // 21 * 8
- new TestResult(2, -1332009983328901461.3254059884m), // 21 * 9
- new TestResult(1, 0m), // 21 * 10
- new TestResult(1, 0m), // 21 * 11
- new TestResult(0, 317187140609.43641612785737895m), // 21 * 12
- new TestResult(1, 0m), // 21 * 13
- new TestResult(1, 0m), // 21 * 14
- new TestResult(1, 0m), // 21 * 15
- new TestResult(2, -175082971439561442.82206371811m), // 21 * 16
- new TestResult(2, 10170667920993375211218037940m), // 21 * 17
- new TestResult(1, 0m), // 21 * 18
- new TestResult(1, 0m), // 21 * 19
- new TestResult(2, 2944075208624656937377.9493098m), // 21 * 20
- new TestResult(2, 172849953286095412912252.49708m), // 21 * 21
- new TestResult(2, -2656404456766597431365611.212m), // 21 * 22
- new TestResult(0, 183906472919174492029733196.17m), // 21 * 23
- new TestResult(0, -213211810548723232636647639.7m), // 21 * 24
- new TestResult(1, 0m), // 21 * 25
- new TestResult(1, 0m), // 21 * 26
- new TestResult(1, 0m), // 21 * 27
- new TestResult(1, 0m), // 21 * 28
- new TestResult(0, -2077565236457711426002.3992246m), // 21 * 29
- new TestResult(0, 0m), // 22 * 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 * 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 * 2
- new TestResult(2, -12778784979785.272534734164092m), // 22 * 3
- new TestResult(0, -63893924898926.362673670820462m), // 22 * 4
- new TestResult(0, -638939248989.26362673670820462m), // 22 * 5
- new TestResult(1, 0m), // 22 * 6
- new TestResult(1, 0m), // 22 * 7
- new TestResult(1, 0m), // 22 * 8
- new TestResult(2, 20470686794551372519.831909846m), // 22 * 9
- new TestResult(1, 0m), // 22 * 10
- new TestResult(1, 0m), // 22 * 11
- new TestResult(0, -4874617076403.5713301079734445m), // 22 * 12
- new TestResult(1, 0m), // 22 * 13
- new TestResult(1, 0m), // 22 * 14
- new TestResult(1, 0m), // 22 * 15
- new TestResult(2, 2690722078855217643.0013135833m), // 22 * 16
- new TestResult(1, 0m), // 22 * 17
- new TestResult(1, 0m), // 22 * 18
- new TestResult(1, 0m), // 22 * 19
- new TestResult(0, -45245337684888495429839.445203m), // 22 * 20
- new TestResult(2, -2656404456766597431365611.212m), // 22 * 21
- new TestResult(2, 40824336389896422046045259.169m), // 22 * 22
- new TestResult(2, -2826324016889506134750576955.1m), // 22 * 23
- new TestResult(2, 3276696308036925201560804370m), // 22 * 24
- new TestResult(1, 0m), // 22 * 25
- new TestResult(1, 0m), // 22 * 26
- new TestResult(1, 0m), // 22 * 27
- new TestResult(1, 0m), // 22 * 28
- new TestResult(2, 31928579952897032005741.500403m), // 22 * 29
- new TestResult(0, 0m), // 23 * 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 * 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 * 2
- new TestResult(0, 884692565485830.1192832661362m), // 23 * 3
- new TestResult(0, 4423462827429150.596416330681m), // 23 * 4
- new TestResult(0, 44234628274291.50596416330681m), // 23 * 5
- new TestResult(1, 0m), // 23 * 6
- new TestResult(1, 0m), // 23 * 7
- new TestResult(1, 0m), // 23 * 8
- new TestResult(2, -1417213330232658207868.9685141m), // 23 * 9
- new TestResult(1, 0m), // 23 * 10
- new TestResult(1, 0m), // 23 * 11
- new TestResult(2, 337476332367005.49979200414696m), // 23 * 12
- new TestResult(1, 0m), // 23 * 13
- new TestResult(1, 0m), // 23 * 14
- new TestResult(1, 0m), // 23 * 15
- new TestResult(2, -186282328305659347664.31347679m), // 23 * 16
- new TestResult(1, 0m), // 23 * 17
- new TestResult(1, 0m), // 23 * 18
- new TestResult(1, 0m), // 23 * 19
- new TestResult(2, 3132395915264028802867467.4171m), // 23 * 20
- new TestResult(0, 183906472919174492029733196.17m), // 23 * 21
- new TestResult(2, -2826324016889506134750576955.1m), // 23 * 22
- new TestResult(1, 0m), // 23 * 23
- new TestResult(1, 0m), // 23 * 24
- new TestResult(1, 0m), // 23 * 25
- new TestResult(1, 0m), // 23 * 26
- new TestResult(1, 0m), // 23 * 27
- new TestResult(1, 0m), // 23 * 28
- new TestResult(2, -2210458768617810051106106.871m), // 23 * 29
- new TestResult(0, 0m), // 24 * 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 * 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 * 2
- new TestResult(2, -1025667561734647.7804167488753m), // 24 * 3
- new TestResult(0, -5128337808673238.9020837443764m), // 24 * 4
- new TestResult(0, -51283378086732.389020837443764m), // 24 * 5
- new TestResult(1, 0m), // 24 * 6
- new TestResult(1, 0m), // 24 * 7
- new TestResult(1, 0m), // 24 * 8
- new TestResult(0, 1643045050434361863551.7087135m), // 24 * 9
- new TestResult(1, 0m), // 24 * 10
- new TestResult(1, 0m), // 24 * 11
- new TestResult(0, -391252894469544.55412631906773m), // 24 * 12
- new TestResult(1, 0m), // 24 * 13
- new TestResult(1, 0m), // 24 * 14
- new TestResult(1, 0m), // 24 * 15
- new TestResult(2, 215966256439146035447.16512997m), // 24 * 16
- new TestResult(1, 0m), // 24 * 17
- new TestResult(1, 0m), // 24 * 18
- new TestResult(1, 0m), // 24 * 19
- new TestResult(2, -3631540499079604049748263.216m), // 24 * 20
- new TestResult(0, -213211810548723232636647639.7m), // 24 * 21
- new TestResult(2, 3276696308036925201560804370m), // 24 * 22
- new TestResult(1, 0m), // 24 * 23
- new TestResult(1, 0m), // 24 * 24
- new TestResult(1, 0m), // 24 * 25
- new TestResult(1, 0m), // 24 * 26
- new TestResult(1, 0m), // 24 * 27
- new TestResult(1, 0m), // 24 * 28
- new TestResult(2, 2562693464342799730524457.4865m), // 24 * 29
- new TestResult(0, 0m), // 25 * 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 * 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 * 2
- new TestResult(0, 1217881161381831408.2901795028m), // 25 * 3
- new TestResult(0, 6089405806909157041.450897514m), // 25 * 4
- new TestResult(0, 60894058069091570.41450897514m), // 25 * 5
- new TestResult(1, 0m), // 25 * 6
- new TestResult(1, 0m), // 25 * 7
- new TestResult(1, 0m), // 25 * 8
- new TestResult(0, -1950957297354170624860913.7855m), // 25 * 9
- new TestResult(1, 0m), // 25 * 10
- new TestResult(1, 0m), // 25 * 11
- new TestResult(0, 464575021466700199.22364418475m), // 25 * 12
- new TestResult(1, 0m), // 25 * 13
- new TestResult(1, 0m), // 25 * 14
- new TestResult(1, 0m), // 25 * 15
- new TestResult(0, -256439069562229438659442.67473m), // 25 * 16
- new TestResult(1, 0m), // 25 * 17
- new TestResult(1, 0m), // 25 * 18
- new TestResult(1, 0m), // 25 * 19
- new TestResult(0, 4312103575884025168661620716.9m), // 25 * 20
- new TestResult(1, 0m), // 25 * 21
- new TestResult(1, 0m), // 25 * 22
- new TestResult(1, 0m), // 25 * 23
- new TestResult(1, 0m), // 25 * 24
- new TestResult(1, 0m), // 25 * 25
- new TestResult(1, 0m), // 25 * 26
- new TestResult(1, 0m), // 25 * 27
- new TestResult(1, 0m), // 25 * 28
- new TestResult(0, -3042950960973153681431212945.8m), // 25 * 29
- new TestResult(0, 0m), // 26 * 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 * 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 * 2
- new TestResult(2, -85070106626639973932230.07557m), // 26 * 3
- new TestResult(0, -425350533133199869661150.37787m), // 26 * 4
- new TestResult(0, -4253505331331998696611.5037787m), // 26 * 5
- new TestResult(1, 0m), // 26 * 6
- new TestResult(1, 0m), // 26 * 7
- new TestResult(1, 0m), // 26 * 8
- new TestResult(1, 0m), // 26 * 9
- new TestResult(1, 0m), // 26 * 10
- new TestResult(1, 0m), // 26 * 11
- new TestResult(0, -32450987719855972399063.033158m), // 26 * 12
- new TestResult(1, 0m), // 26 * 13
- new TestResult(1, 0m), // 26 * 14
- new TestResult(1, 0m), // 26 * 15
- new TestResult(2, 17912502206818886711664532432m), // 26 * 16
- new TestResult(1, 0m), // 26 * 17
- new TestResult(1, 0m), // 26 * 18
- new TestResult(1, 0m), // 26 * 19
- new TestResult(1, 0m), // 26 * 20
- new TestResult(1, 0m), // 26 * 21
- new TestResult(1, 0m), // 26 * 22
- new TestResult(1, 0m), // 26 * 23
- new TestResult(1, 0m), // 26 * 24
- new TestResult(1, 0m), // 26 * 25
- new TestResult(1, 0m), // 26 * 26
- new TestResult(1, 0m), // 26 * 27
- new TestResult(1, 0m), // 26 * 28
- new TestResult(1, 0m), // 26 * 29
- new TestResult(0, 0m), // 27 * 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 * 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 * 2
- new TestResult(2, -15616549045183906214971.762462m), // 27 * 3
- new TestResult(0, -78082745225919531074858.812311m), // 27 * 4
- new TestResult(0, -780827452259195310748.58812311m), // 27 * 5
- new TestResult(1, 0m), // 27 * 6
- new TestResult(1, 0m), // 27 * 7
- new TestResult(1, 0m), // 27 * 8
- new TestResult(0, 25016579026989918165002777574m), // 27 * 9
- new TestResult(1, 0m), // 27 * 10
- new TestResult(1, 0m), // 27 * 11
- new TestResult(0, -5957115388557583551533.0994303m), // 27 * 12
- new TestResult(1, 0m), // 27 * 13
- new TestResult(1, 0m), // 27 * 14
- new TestResult(1, 0m), // 27 * 15
- new TestResult(0, 3288246369108855691627019039.6m), // 27 * 16
- new TestResult(1, 0m), // 27 * 17
- new TestResult(1, 0m), // 27 * 18
- new TestResult(1, 0m), // 27 * 19
- new TestResult(1, 0m), // 27 * 20
- new TestResult(1, 0m), // 27 * 21
- new TestResult(1, 0m), // 27 * 22
- new TestResult(1, 0m), // 27 * 23
- new TestResult(1, 0m), // 27 * 24
- new TestResult(1, 0m), // 27 * 25
- new TestResult(1, 0m), // 27 * 26
- new TestResult(1, 0m), // 27 * 27
- new TestResult(1, 0m), // 27 * 28
- new TestResult(1, 0m), // 27 * 29
- new TestResult(0, 0m), // 28 * 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 * 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 * 2
- new TestResult(0, 2075615253608546074660118943.4m), // 28 * 3
- new TestResult(0, 10378076268042730373300594717m), // 28 * 4
- new TestResult(0, 103780762680427303733005947.17m), // 28 * 5
- new TestResult(1, 0m), // 28 * 6
- new TestResult(1, 0m), // 28 * 7
- new TestResult(1, 0m), // 28 * 8
- new TestResult(1, 0m), // 28 * 9
- new TestResult(1, 0m), // 28 * 10
- new TestResult(1, 0m), // 28 * 11
- new TestResult(0, 791767728722982425613218218.59m), // 28 * 12
- new TestResult(1, 0m), // 28 * 13
- new TestResult(1, 0m), // 28 * 14
- new TestResult(1, 0m), // 28 * 15
- new TestResult(1, 0m), // 28 * 16
- new TestResult(1, 0m), // 28 * 17
- new TestResult(1, 0m), // 28 * 18
- new TestResult(1, 0m), // 28 * 19
- new TestResult(1, 0m), // 28 * 20
- new TestResult(1, 0m), // 28 * 21
- new TestResult(1, 0m), // 28 * 22
- new TestResult(1, 0m), // 28 * 23
- new TestResult(1, 0m), // 28 * 24
- new TestResult(1, 0m), // 28 * 25
- new TestResult(1, 0m), // 28 * 26
- new TestResult(1, 0m), // 28 * 27
- new TestResult(1, 0m), // 28 * 28
- new TestResult(1, 0m), // 28 * 29
- new TestResult(0, 0m), // 29 * 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 * 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 * 2
- new TestResult(0, -9994245932.897304851543126084m), // 29 * 3
- new TestResult(0, -49971229664.48652425771563042m), // 29 * 4
- new TestResult(0, -499712296.6448652425771563042m), // 29 * 5
- new TestResult(1, 0m), // 29 * 6
- new TestResult(1, 0m), // 29 * 7
- new TestResult(1, 0m), // 29 * 8
- new TestResult(2, 16010057181782036.694377696165m), // 29 * 9
- new TestResult(1, 0m), // 29 * 10
- new TestResult(2, 2724399925666581324856736883m), // 29 * 11
- new TestResult(2, -3812422070.43511700405678157m), // 29 * 12
- new TestResult(1, 0m), // 29 * 13
- new TestResult(1, 0m), // 29 * 14
- new TestResult(1, 0m), // 29 * 15
- new TestResult(2, 2104404936439239.9111285468803m), // 29 * 16
- new TestResult(2, -122246061989021334943606343.1m), // 29 * 17
- new TestResult(1, 0m), // 29 * 18
- new TestResult(1, 0m), // 29 * 19
- new TestResult(0, -35386230604481178142.543841269m), // 29 * 20
- new TestResult(0, -2077565236457711426002.3992246m), // 29 * 21
- new TestResult(2, 31928579952897032005741.500403m), // 29 * 22
- new TestResult(2, -2210458768617810051106106.871m), // 29 * 23
- new TestResult(2, 2562693464342799730524457.4865m), // 29 * 24
- new TestResult(0, -3042950960973153681431212945.8m), // 29 * 25
- new TestResult(1, 0m), // 29 * 26
- new TestResult(1, 0m), // 29 * 27
- new TestResult(1, 0m), // 29 * 28
- new TestResult(0, 24971237941808579837.350664893m), // 29 * 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Div_build2 = new TestResult[] {
- new TestResult(3, 0m), // 0 / 0
- new TestResult(0, 0m), // 0 / 1
- new TestResult(0, 0m), // 0 / 2
- new TestResult(0, 0m), // 0 / 3
- new TestResult(0, 0m), // 0 / 4
- new TestResult(0, 0m), // 0 / 5
- new TestResult(0, 0m), // 0 / 6
- new TestResult(0, 0m), // 0 / 7
- new TestResult(0, 0m), // 0 / 8
- new TestResult(0, 0m), // 0 / 9
- new TestResult(0, 0m), // 0 / 10
- new TestResult(0, 0m), // 0 / 11
- new TestResult(0, 0m), // 0 / 12
- new TestResult(0, 0m), // 0 / 13
- new TestResult(0, 0m), // 0 / 14
- new TestResult(0, 0m), // 0 / 15
- new TestResult(0, 0m), // 0 / 16
- new TestResult(0, 0m), // 0 / 17
- new TestResult(0, 0m), // 0 / 18
- new TestResult(0, 0m), // 0 / 19
- new TestResult(0, 0m), // 0 / 20
- new TestResult(0, 0m), // 0 / 21
- new TestResult(0, 0m), // 0 / 22
- new TestResult(0, 0m), // 0 / 23
- new TestResult(0, 0m), // 0 / 24
- new TestResult(0, 0m), // 0 / 25
- new TestResult(0, 0m), // 0 / 26
- new TestResult(0, 0m), // 0 / 27
- new TestResult(0, 0m), // 0 / 28
- new TestResult(0, 0m), // 0 / 29
- new TestResult(3, 0m), // 1 / 0
- new TestResult(0, 1m), // 1 / 1
- new TestResult(0, -1m), // 1 / 2
- new TestResult(0, 0.5m), // 1 / 3
- new TestResult(0, 0.1m), // 1 / 4
- new TestResult(0, 10m), // 1 / 5
- new TestResult(0, 0m), // 1 / 6
- new TestResult(0, 0m), // 1 / 7
- new TestResult(2, 3.61E-26m), // 1 / 8
- new TestResult(2, -3.121239924198969049581E-07m), // 1 / 9
- new TestResult(2, -2.06327E-23m), // 1 / 10
- new TestResult(2, -1.8342105061E-18m), // 1 / 11
- new TestResult(0, 1.3107475704751451797758879069m), // 1 / 12
- new TestResult(2, -2.4971716E-21m), // 1 / 13
- new TestResult(2, 4.4873E-24m), // 1 / 14
- new TestResult(2, 7.02E-26m), // 1 / 15
- new TestResult(2, -2.3746014276625098667414E-06m), // 1 / 16
- new TestResult(2, 4.08775782642E-17m), // 1 / 17
- new TestResult(2, -1.879E-25m), // 1 / 18
- new TestResult(2, 9.7E-27m), // 1 / 19
- new TestResult(2, 1.412165941691409118E-10m), // 1 / 20
- new TestResult(2, 2.4052784859689137E-12m), // 1 / 21
- new TestResult(2, -1.565094023542766E-13m), // 1 / 22
- new TestResult(2, 2.2606723262128E-15m), // 1 / 23
- new TestResult(2, -1.9499495495573E-15m), // 1 / 24
- new TestResult(2, 1.6421963517E-18m), // 1 / 25
- new TestResult(2, -2.351E-23m), // 1 / 26
- new TestResult(2, -1.280693E-22m), // 1 / 27
- new TestResult(2, 1E-27m), // 1 / 28
- new TestResult(2, -2.00115147598754898E-10m), // 1 / 29
- new TestResult(3, 0m), // 2 / 0
- new TestResult(0, -1m), // 2 / 1
- new TestResult(0, 1m), // 2 / 2
- new TestResult(0, -0.5m), // 2 / 3
- new TestResult(0, -0.1m), // 2 / 4
- new TestResult(0, -10m), // 2 / 5
- new TestResult(0, 0m), // 2 / 6
- new TestResult(0, 0m), // 2 / 7
- new TestResult(2, -3.61E-26m), // 2 / 8
- new TestResult(2, 3.121239924198969049581E-07m), // 2 / 9
- new TestResult(2, 2.06327E-23m), // 2 / 10
- new TestResult(2, 1.8342105061E-18m), // 2 / 11
- new TestResult(0, -1.3107475704751451797758879069m), // 2 / 12
- new TestResult(2, 2.4971716E-21m), // 2 / 13
- new TestResult(2, -4.4873E-24m), // 2 / 14
- new TestResult(2, -7.02E-26m), // 2 / 15
- new TestResult(2, 2.3746014276625098667414E-06m), // 2 / 16
- new TestResult(2, -4.08775782642E-17m), // 2 / 17
- new TestResult(2, 1.879E-25m), // 2 / 18
- new TestResult(2, -9.7E-27m), // 2 / 19
- new TestResult(2, -1.412165941691409118E-10m), // 2 / 20
- new TestResult(2, -2.4052784859689137E-12m), // 2 / 21
- new TestResult(2, 1.565094023542766E-13m), // 2 / 22
- new TestResult(2, -2.2606723262128E-15m), // 2 / 23
- new TestResult(2, 1.9499495495573E-15m), // 2 / 24
- new TestResult(2, -1.6421963517E-18m), // 2 / 25
- new TestResult(2, 2.351E-23m), // 2 / 26
- new TestResult(2, 1.280693E-22m), // 2 / 27
- new TestResult(2, -1E-27m), // 2 / 28
- new TestResult(2, 2.00115147598754898E-10m), // 2 / 29
- new TestResult(3, 0m), // 3 / 0
- new TestResult(0, 2m), // 3 / 1
- new TestResult(0, -2m), // 3 / 2
- new TestResult(0, 1m), // 3 / 3
- new TestResult(0, 0.2m), // 3 / 4
- new TestResult(0, 20m), // 3 / 5
- new TestResult(0, 0m), // 3 / 6
- new TestResult(0, 0m), // 3 / 7
- new TestResult(2, 7.22E-26m), // 3 / 8
- new TestResult(2, -6.242479848397938099161E-07m), // 3 / 9
- new TestResult(2, -4.12653E-23m), // 3 / 10
- new TestResult(2, -3.6684210122E-18m), // 3 / 11
- new TestResult(0, 2.6214951409502903595517758138m), // 3 / 12
- new TestResult(2, -4.9943432E-21m), // 3 / 13
- new TestResult(2, 8.9746E-24m), // 3 / 14
- new TestResult(2, 1.404E-25m), // 3 / 15
- new TestResult(2, -4.7492028553250197334829E-06m), // 3 / 16
- new TestResult(2, 8.17551565284E-17m), // 3 / 17
- new TestResult(2, -3.757E-25m), // 3 / 18
- new TestResult(2, 1.95E-26m), // 3 / 19
- new TestResult(2, 2.824331883382818237E-10m), // 3 / 20
- new TestResult(2, 4.8105569719378275E-12m), // 3 / 21
- new TestResult(2, -3.130188047085533E-13m), // 3 / 22
- new TestResult(2, 4.5213446524256E-15m), // 3 / 23
- new TestResult(2, -3.8998990991146E-15m), // 3 / 24
- new TestResult(2, 3.2843927034E-18m), // 3 / 25
- new TestResult(2, -4.702E-23m), // 3 / 26
- new TestResult(2, -2.561385E-22m), // 3 / 27
- new TestResult(2, 1.9E-27m), // 3 / 28
- new TestResult(2, -4.002302951975097959E-10m), // 3 / 29
- new TestResult(3, 0m), // 4 / 0
- new TestResult(0, 10m), // 4 / 1
- new TestResult(0, -10m), // 4 / 2
- new TestResult(0, 5m), // 4 / 3
- new TestResult(0, 1m), // 4 / 4
- new TestResult(0, 100m), // 4 / 5
- new TestResult(2, 1E-28m), // 4 / 6
- new TestResult(2, -1E-28m), // 4 / 7
- new TestResult(2, 3.61E-25m), // 4 / 8
- new TestResult(2, -3.1212399241989690495806E-06m), // 4 / 9
- new TestResult(2, -2.063265E-22m), // 4 / 10
- new TestResult(2, -1.83421050609E-17m), // 4 / 11
- new TestResult(0, 13.107475704751451797758879069m), // 4 / 12
- new TestResult(2, -2.49717158E-20m), // 4 / 13
- new TestResult(2, 4.48729E-23m), // 4 / 14
- new TestResult(2, 7.019E-25m), // 4 / 15
- new TestResult(2, -2.37460142766250986674143E-05m), // 4 / 16
- new TestResult(2, 4.087757826422E-16m), // 4 / 17
- new TestResult(2, -1.8785E-24m), // 4 / 18
- new TestResult(2, 9.73E-26m), // 4 / 19
- new TestResult(2, 1.4121659416914091185E-09m), // 4 / 20
- new TestResult(2, 2.40527848596891375E-11m), // 4 / 21
- new TestResult(2, -1.5650940235427663E-12m), // 4 / 22
- new TestResult(2, 2.26067232621278E-14m), // 4 / 23
- new TestResult(2, -1.94994954955729E-14m), // 4 / 24
- new TestResult(2, 1.64219635168E-17m), // 4 / 25
- new TestResult(2, -2.351002E-22m), // 4 / 26
- new TestResult(2, -1.2806927E-21m), // 4 / 27
- new TestResult(2, 9.6E-27m), // 4 / 28
- new TestResult(2, -2.0011514759875489796E-09m), // 4 / 29
- new TestResult(3, 0m), // 5 / 0
- new TestResult(0, 0.1m), // 5 / 1
- new TestResult(0, -0.1m), // 5 / 2
- new TestResult(0, 0.05m), // 5 / 3
- new TestResult(0, 0.01m), // 5 / 4
- new TestResult(0, 1m), // 5 / 5
- new TestResult(0, 0m), // 5 / 6
- new TestResult(0, 0m), // 5 / 7
- new TestResult(2, 3.6E-27m), // 5 / 8
- new TestResult(2, -3.12123992419896904958E-08m), // 5 / 9
- new TestResult(2, -2.0633E-24m), // 5 / 10
- new TestResult(2, -1.834210506E-19m), // 5 / 11
- new TestResult(0, 0.1310747570475145179775887907m), // 5 / 12
- new TestResult(2, -2.497172E-22m), // 5 / 13
- new TestResult(2, 4.487E-25m), // 5 / 14
- new TestResult(2, 7E-27m), // 5 / 15
- new TestResult(2, -2.374601427662509866741E-07m), // 5 / 16
- new TestResult(2, 4.0877578264E-18m), // 5 / 17
- new TestResult(2, -1.88E-26m), // 5 / 18
- new TestResult(2, 1E-27m), // 5 / 19
- new TestResult(2, 1.41216594169140912E-11m), // 5 / 20
- new TestResult(2, 2.405278485968914E-13m), // 5 / 21
- new TestResult(2, -1.56509402354277E-14m), // 5 / 22
- new TestResult(2, 2.260672326213E-16m), // 5 / 23
- new TestResult(2, -1.949949549557E-16m), // 5 / 24
- new TestResult(2, 1.642196352E-19m), // 5 / 25
- new TestResult(2, -2.351E-24m), // 5 / 26
- new TestResult(2, -1.28069E-23m), // 5 / 27
- new TestResult(2, 1E-28m), // 5 / 28
- new TestResult(2, -2.00115147598754898E-11m), // 5 / 29
- new TestResult(3, 0m), // 6 / 0
- new TestResult(0, 79228162514264337593543950335m), // 6 / 1
- new TestResult(0, -79228162514264337593543950335m), // 6 / 2
- new TestResult(4, 39614081257132168796771975168m), // 6 / 3
- new TestResult(4, 7922816251426433759354395034m), // 6 / 4
- new TestResult(1, 0m), // 6 / 5
- new TestResult(0, 1m), // 6 / 6
- new TestResult(0, -1m), // 6 / 7
- new TestResult(2, 2859.8815108190596050496514036m), // 6 / 8
- new TestResult(2, -24729010396044602218186.765763m), // 6 / 9
- new TestResult(0, -1634686.9890330150250120997619m), // 6 / 10
- new TestResult(2, -145321128061.87519668639091926m), // 6 / 11
- new TestResult(1, 0m), // 6 / 12
- new TestResult(0, -197846315.8215581473367403789m), // 6 / 13
- new TestResult(0, 355519.78373087286985534915017m), // 6 / 14
- new TestResult(0, 5561.4152228343398478498516935m), // 6 / 15
- new TestResult(0, -188135307817449443294332.61564m), // 6 / 16
- new TestResult(4, 3238655413907.0152158135371692m), // 6 / 17
- new TestResult(0, -14883.393842880239095927799143m), // 6 / 18
- new TestResult(0, 770.69397665852204557888702506m), // 6 / 19
- new TestResult(4, 11188331272543609822.484506627m), // 6 / 20
- new TestResult(0, 190565794778408772.72439011791m), // 6 / 21
- new TestResult(4, -12399952364735014.543439368391m), // 6 / 22
- new TestResult(2, 179108914452685.79816067884477m), // 6 / 23
- new TestResult(2, -154490919806941.48506503891762m), // 6 / 24
- new TestResult(2, 130108199431.16705963085822836m), // 6 / 25
- new TestResult(2, -1862655.7707746844883926874832m), // 6 / 26
- new TestResult(2, -10146692.753313261555369747673m), // 6 / 27
- new TestResult(0, 76.341858036091015923443233609m), // 6 / 28
- new TestResult(2, -15854755435520147876.101506668m), // 6 / 29
- new TestResult(3, 0m), // 7 / 0
- new TestResult(0, -79228162514264337593543950335m), // 7 / 1
- new TestResult(0, 79228162514264337593543950335m), // 7 / 2
- new TestResult(4, -39614081257132168796771975168m), // 7 / 3
- new TestResult(4, -7922816251426433759354395034m), // 7 / 4
- new TestResult(1, 0m), // 7 / 5
- new TestResult(0, -1m), // 7 / 6
- new TestResult(0, 1m), // 7 / 7
- new TestResult(2, -2859.8815108190596050496514036m), // 7 / 8
- new TestResult(2, 24729010396044602218186.765763m), // 7 / 9
- new TestResult(0, 1634686.9890330150250120997619m), // 7 / 10
- new TestResult(2, 145321128061.87519668639091926m), // 7 / 11
- new TestResult(1, 0m), // 7 / 12
- new TestResult(0, 197846315.8215581473367403789m), // 7 / 13
- new TestResult(0, -355519.78373087286985534915017m), // 7 / 14
- new TestResult(0, -5561.4152228343398478498516935m), // 7 / 15
- new TestResult(0, 188135307817449443294332.61564m), // 7 / 16
- new TestResult(4, -3238655413907.0152158135371692m), // 7 / 17
- new TestResult(0, 14883.393842880239095927799143m), // 7 / 18
- new TestResult(0, -770.69397665852204557888702506m), // 7 / 19
- new TestResult(4, -11188331272543609822.484506627m), // 7 / 20
- new TestResult(0, -190565794778408772.72439011791m), // 7 / 21
- new TestResult(4, 12399952364735014.543439368391m), // 7 / 22
- new TestResult(2, -179108914452685.79816067884477m), // 7 / 23
- new TestResult(2, 154490919806941.48506503891762m), // 7 / 24
- new TestResult(2, -130108199431.16705963085822836m), // 7 / 25
- new TestResult(2, 1862655.7707746844883926874832m), // 7 / 26
- new TestResult(2, 10146692.753313261555369747673m), // 7 / 27
- new TestResult(0, -76.341858036091015923443233609m), // 7 / 28
- new TestResult(2, 15854755435520147876.101506668m), // 7 / 29
- new TestResult(3, 0m), // 8 / 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 / 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 / 2
- new TestResult(0, 13851651233545980304665939.766m), // 8 / 3
- new TestResult(0, 2770330246709196060933187.9532m), // 8 / 4
- new TestResult(0, 277033024670919606093318795.32m), // 8 / 5
- new TestResult(2, 0.0003496648361888264585379374m), // 8 / 6
- new TestResult(2, -0.0003496648361888264585379374m), // 8 / 7
- new TestResult(0, 1m), // 8 / 8
- new TestResult(2, -8646865369244722339.540450168m), // 8 / 9
- new TestResult(0, -571.59255824023515226354006889m), // 8 / 10
- new TestResult(0, -50813688.438531062464476589278m), // 8 / 11
- new TestResult(0, 36312036402878882966329689.018m), // 8 / 12
- new TestResult(0, -69179.899612307954004328275068m), // 8 / 13
- new TestResult(2, 124.31276694014267187689413445m), // 8 / 14
- new TestResult(0, 1.9446313428704152390534655913m), // 8 / 15
- new TestResult(0, -65784301589322901428.917817252m), // 8 / 16
- new TestResult(2, 1132443914.7758524269197245123m), // 8 / 17
- new TestResult(0, -5.2041994700045071214948001057m), // 8 / 18
- new TestResult(2, 0.2694845831000173532986745484m), // 8 / 19
- new TestResult(0, 3912166021640285.6025706982227m), // 8 / 20
- new TestResult(0, 66634157414385.824002109431498m), // 8 / 21
- new TestResult(0, -4335827312364.3201348613764117m), // 8 / 22
- new TestResult(0, 62628089232.056911382057917869m), // 8 / 23
- new TestResult(0, -54020042166.955319300276527479m), // 8 / 24
- new TestResult(0, 45494262.240922193719761217507m), // 8 / 25
- new TestResult(0, -651.30522496410233725620872491m), // 8 / 26
- new TestResult(0, -3547.9416594456341168641639951m), // 8 / 27
- new TestResult(2, 0.0266940632845404098551052086m), // 8 / 28
- new TestResult(0, -5543850462175058.4016671641533m), // 8 / 29
- new TestResult(3, 0m), // 9 / 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 / 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 / 2
- new TestResult(0, -1601927.4779984090746256692509m), // 9 / 3
- new TestResult(0, -320385.49559968181492513385018m), // 9 / 4
- new TestResult(0, -32038549.559968181492513385018m), // 9 / 5
- new TestResult(2, -4.04383E-23m), // 9 / 6
- new TestResult(2, 4.04383E-23m), // 9 / 7
- new TestResult(2, -1.156488458E-19m), // 9 / 8
- new TestResult(0, 1m), // 9 / 9
- new TestResult(2, 6.61040196455E-17m), // 9 / 10
- new TestResult(2, 5.8765444202781065E-12m), // 9 / 11
- new TestResult(0, -4199445.0997275825559060668592m), // 9 / 12
- new TestResult(2, 8.0005755447943E-15m), // 9 / 13
- new TestResult(2, -1.43766280186E-17m), // 9 / 14
- new TestResult(2, -2.248943704E-19m), // 9 / 15
- new TestResult(0, 7.6078785525336521046280405305m), // 9 / 16
- new TestResult(2, -1.309658317109623269E-10m), // 9 / 17
- new TestResult(2, 6.018596622E-19m), // 9 / 18
- new TestResult(2, -3.1165581E-20m), // 9 / 19
- new TestResult(2, -0.0004524374850977934825669157m), // 9 / 20
- new TestResult(2, -7.7061633978240275370839E-06m), // 9 / 21
- new TestResult(2, 5.014334243928492665444E-07m), // 9 / 22
- new TestResult(2, -7.242866236221657103E-09m), // 9 / 23
- new TestResult(2, 6.2473555282928855602E-09m), // 9 / 24
- new TestResult(2, -5.261358920047113E-12m), // 9 / 25
- new TestResult(2, 7.53226975501E-17m), // 9 / 26
- new TestResult(2, 4.103153579868E-16m), // 9 / 27
- new TestResult(2, -3.0871376E-21m), // 9 / 28
- new TestResult(2, 0.0006411399074043056427231896m), // 9 / 29
- new TestResult(3, 0m), // 10 / 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 / 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 / 2
- new TestResult(0, -24233435222094436898210.014434m), // 10 / 3
- new TestResult(0, -4846687044418887379642.0028868m), // 10 / 4
- new TestResult(0, -484668704441888737964200.28868m), // 10 / 5
- new TestResult(2, -6.11737908669317400216E-07m), // 10 / 6
- new TestResult(2, 6.11737908669317400216E-07m), // 10 / 7
- new TestResult(2, -0.001749497934470499347067655m), // 10 / 8
- new TestResult(2, 15127673103138133.38384122385m), // 10 / 9
- new TestResult(0, 1m), // 10 / 10
- new TestResult(2, 88898.44296603758700885485801m), // 10 / 11
- new TestResult(0, -63527832683254186820073.01815m), // 10 / 12
- new TestResult(2, 121.03009147860926410013615872m), // 10 / 13
- new TestResult(2, -0.217484928990092181791376891m), // 10 / 14
- new TestResult(2, -0.0034021285176583848675539818m), // 10 / 15
- new TestResult(2, 115089499751104803.45385549602m), // 10 / 16
- new TestResult(2, -1981208.2898040400164777217752m), // 10 / 17
- new TestResult(2, 0.0091047362233453526323903968m), // 10 / 18
- new TestResult(2, -0.0004714627215051239953535366m), // 10 / 19
- new TestResult(0, -6844326374165.3505116694016252m), // 10 / 20
- new TestResult(2, -116576320761.65010852644993727m), // 10 / 21
- new TestResult(0, 7585520927.2021546507200976307m), // 10 / 22
- new TestResult(2, -109567712.75131768812510902617m), // 10 / 23
- new TestResult(2, 94507952.1910976087542637813m), // 10 / 24
- new TestResult(0, -79592.11782075260884714858998m), // 10 / 25
- new TestResult(0, 1.1394571457845409462816707224m), // 10 / 26
- new TestResult(0, 6.2071166048219727069770728387m), // 10 / 27
- new TestResult(2, -4.67012085789282405269787E-05m), // 10 / 28
- new TestResult(2, 9698954932588.587842740128447m), // 10 / 29
- new TestResult(3, 0m), // 11 / 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 / 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 / 2
- new TestResult(0, -272596846621402397.15165687338m), // 11 / 3
- new TestResult(0, -54519369324280479.430331374676m), // 11 / 4
- new TestResult(0, -5451936932428047943.0331374676m), // 11 / 5
- new TestResult(2, -6.8813118459568899E-12m), // 11 / 6
- new TestResult(2, 6.8813118459568899E-12m), // 11 / 7
- new TestResult(2, -1.96797365184322821747E-08m), // 11 / 8
- new TestResult(2, 170168032177.09280206999941461m), // 11 / 9
- new TestResult(2, 1.12487909420644868170014E-05m), // 11 / 10
- new TestResult(0, 1m), // 11 / 11
- new TestResult(0, -714611308856377959.50595110446m), // 11 / 12
- new TestResult(2, 0.0013614421967418161221277362m), // 11 / 13
- new TestResult(2, -2.4464424992592870530962E-06m), // 11 / 14
- new TestResult(2, -3.82698324531749191876E-08m), // 11 / 15
- new TestResult(2, 1294617722326.9607230936474447m), // 11 / 16
- new TestResult(0, -22.286197864690758108786295635m), // 11 / 17
- new TestResult(2, 1.024172743590536270877E-07m), // 11 / 18
- new TestResult(2, -5.3033855911879105358E-09m), // 11 / 19
- new TestResult(0, -76990396.522244266468310204941m), // 11 / 20
- new TestResult(2, -1311342.6610428539176292952583m), // 11 / 21
- new TestResult(2, 85327.93909675220473779587097m), // 11 / 22
- new TestResult(2, -1232.5042947397459817875590485m), // 11 / 23
- new TestResult(2, 1063.1001965602823514109428061m), // 11 / 24
- new TestResult(2, -0.8953150940018113683593315845m), // 11 / 25
- new TestResult(2, 1.28175152203717976446025E-05m), // 11 / 26
- new TestResult(2, 6.98225570406594773014162E-05m), // 11 / 27
- new TestResult(2, -5.253321320461122964E-10m), // 11 / 28
- new TestResult(2, 109101516.393194182269828744m), // 11 / 29
- new TestResult(3, 0m), // 12 / 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 / 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 / 2
- new TestResult(2, 0.3814617026669370904946265716m), // 12 / 3
- new TestResult(2, 0.0762923405333874180989253143m), // 12 / 4
- new TestResult(0, 7.629234053338741809892531431m), // 12 / 5
- new TestResult(0, 0m), // 12 / 6
- new TestResult(0, 0m), // 12 / 7
- new TestResult(2, 2.75E-26m), // 12 / 8
- new TestResult(2, -2.381266991833920788159E-07m), // 12 / 9
- new TestResult(2, -1.57411E-23m), // 12 / 10
- new TestResult(2, -1.3993621254E-18m), // 12 / 11
- new TestResult(0, 1m), // 12 / 12
- new TestResult(2, -1.9051506E-21m), // 12 / 13
- new TestResult(2, 3.4235E-24m), // 12 / 14
- new TestResult(2, 5.36E-26m), // 12 / 15
- new TestResult(2, -1.8116390075029613252172E-06m), // 12 / 16
- new TestResult(2, 3.11864612111E-17m), // 12 / 17
- new TestResult(2, -1.433E-25m), // 12 / 18
- new TestResult(2, 7.4E-27m), // 12 / 19
- new TestResult(2, 1.077374449131727051E-10m), // 12 / 20
- new TestResult(2, 1.8350432532917088E-12m), // 12 / 21
- new TestResult(2, -1.194046862108942E-13m), // 12 / 22
- new TestResult(2, 1.7247198294583E-15m), // 12 / 23
- new TestResult(2, -1.4876621505775E-15m), // 12 / 24
- new TestResult(2, 1.2528700328E-18m), // 12 / 25
- new TestResult(2, -1.79363E-23m), // 12 / 26
- new TestResult(2, -9.7707E-23m), // 12 / 27
- new TestResult(2, 7E-28m), // 12 / 28
- new TestResult(2, -1.526725298649329415E-10m), // 12 / 29
- new TestResult(3, 0m), // 13 / 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 / 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 / 2
- new TestResult(0, -200226529832685697986.16737226m), // 13 / 3
- new TestResult(0, -40045305966537139597.233474452m), // 13 / 4
- new TestResult(0, -4004530596653713959723.3474452m), // 13 / 5
- new TestResult(2, -5.0544282103383796846E-09m), // 13 / 6
- new TestResult(2, 5.0544282103383796846E-09m), // 13 / 7
- new TestResult(2, -1.44550657865090008770424E-05m), // 13 / 8
- new TestResult(0, 124991007759518.90460797449561m), // 13 / 9
- new TestResult(2, 0.0082624080324415766315344098m), // 13 / 10
- new TestResult(0, 734.51520923413833710945795487m), // 13 / 11
- new TestResult(0, -524892875045723911444.75281192m), // 13 / 12
- new TestResult(0, 1m), // 13 / 13
- new TestResult(2, -0.0017969492242227235536064218m), // 13 / 14
- new TestResult(2, -2.81097739916991934127E-05m), // 13 / 15
- new TestResult(0, 950916407193211.1625559901416m), // 13 / 16
- new TestResult(2, -16369.551287616739221174657438m), // 13 / 17
- new TestResult(2, 7.52270457050304262522489E-05m), // 13 / 18
- new TestResult(2, -3.8954173771607025488213E-06m), // 13 / 19
- new TestResult(0, -56550617210.555523949138629466m), // 13 / 20
- new TestResult(2, -963201129.053543593301215979m), // 13 / 21
- new TestResult(0, 62674669.039168758653283589393m), // 13 / 22
- new TestResult(2, -905293.1499327386264702284996m), // 13 / 23
- new TestResult(0, 780863.26331332938464898250347m), // 13 / 24
- new TestResult(0, -657.62255360122271090761257385m), // 13 / 25
- new TestResult(2, 0.0094146598739531437042039072m), // 13 / 26
- new TestResult(2, 0.0512857300939825548661107378m), // 13 / 27
- new TestResult(2, -3.858644408872661628546E-07m), // 13 / 28
- new TestResult(2, 80136723141.3087985919301071m), // 13 / 29
- new TestResult(3, 0m), // 14 / 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 / 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 / 2
- new TestResult(0, 111425813892595857095025.30838m), // 14 / 3
- new TestResult(0, 22285162778519171419005.061676m), // 14 / 4
- new TestResult(0, 2228516277851917141900506.1676m), // 14 / 5
- new TestResult(2, 2.8127829891936371496034E-06m), // 14 / 6
- new TestResult(2, -2.8127829891936371496034E-06m), // 14 / 7
- new TestResult(2, 0.0080442260647412496180191824m), // 14 / 8
- new TestResult(0, -69557339781586865.090190294226m), // 14 / 9
- new TestResult(0, -4.5980197554082303507855592074m), // 14 / 10
- new TestResult(0, -408756.79698287266169556154972m), // 14 / 11
- new TestResult(0, 292102229695871398106087.53771m), // 14 / 12
- new TestResult(0, -556.49875161751071295835933612m), // 14 / 13
- new TestResult(0, 1m), // 14 / 14
- new TestResult(2, 0.0156430541346309720805875037m), // 14 / 15
- new TestResult(0, -529183793495630496.21134784463m), // 14 / 16
- new TestResult(0, 9109634.856097530429701051341m), // 14 / 17
- new TestResult(2, -0.0418637570227228532534385582m), // 14 / 18
- new TestResult(2, 0.0021677949074190888565424407m), // 14 / 19
- new TestResult(0, 31470347880873.8650457716423m), // 14 / 20
- new TestResult(0, 536020225874.87383772032904409m), // 14 / 21
- new TestResult(0, -34878375078.338063831579069802m), // 14 / 22
- new TestResult(0, 503794507.78545299809142202221m), // 14 / 23
- new TestResult(0, -434549431.21784335466036244264m), // 14 / 24
- new TestResult(0, 365966.13011459996262470838791m), // 14 / 25
- new TestResult(0, -5.2392464667583952349382510034m), // 14 / 26
- new TestResult(0, -28.540444773093892153704750451m), // 14 / 27
- new TestResult(2, 0.0002147330796473523774307252m), // 14 / 28
- new TestResult(0, -44595986386856.427962855912902m), // 14 / 29
- new TestResult(3, 0m), // 15 / 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 / 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 / 2
- new TestResult(0, 7123021689602076606830667.792m), // 15 / 3
- new TestResult(0, 1424604337920415321366133.5584m), // 15 / 4
- new TestResult(0, 142460433792041532136613355.84m), // 15 / 5
- new TestResult(2, 0.000179810346814988644017588m), // 15 / 6
- new TestResult(2, -0.000179810346814988644017588m), // 15 / 7
- new TestResult(2, 0.5142362863101488055319975668m), // 15 / 8
- new TestResult(0, -4446531935704239606.853757764m), // 15 / 9
- new TestResult(0, -293.9336344319759696558350238m), // 15 / 10
- new TestResult(0, -26130242.436351157631251931791m), // 15 / 11
- new TestResult(0, 18672966748175371201221341.455m), // 15 / 12
- new TestResult(0, -35574.814663942145387025413585m), // 15 / 13
- new TestResult(0, 63.926135612238008074953534656m), // 15 / 14
- new TestResult(0, 1m), // 15 / 15
- new TestResult(0, -33828674946800228646.235978357m), // 15 / 16
- new TestResult(0, 582343753.18886100200299543357m), // 15 / 17
- new TestResult(0, -2.676188208672362394790189458m), // 15 / 18
- new TestResult(2, 0.1385787512311916118536189686m), // 15 / 19
- new TestResult(0, 2011777726397049.7148998294303m), // 15 / 20
- new TestResult(0, 34265701650179.633435597272951m), // 15 / 21
- new TestResult(0, -2229639735192.3415269889385254m), // 15 / 22
- new TestResult(0, 32205636025.393565317814400562m), // 15 / 23
- new TestResult(0, -27779065870.252746877787654023m), // 15 / 24
- new TestResult(0, 23394800.463191857206004010592m), // 15 / 25
- new TestResult(0, -334.92478013993600679391750784m), // 15 / 26
- new TestResult(0, -1824.480342998389574945394373m), // 15 / 27
- new TestResult(2, 0.0137270559699701534233028604m), // 15 / 28
- new TestResult(0, -2850849073527704.1131980257228m), // 15 / 29
- new TestResult(3, 0m), // 16 / 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 / 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 / 2
- new TestResult(0, -210561.65223154345718298324093m), // 16 / 3
- new TestResult(0, -42112.330446308691436596648186m), // 16 / 4
- new TestResult(0, -4211233.0446308691436596648186m), // 16 / 5
- new TestResult(2, -5.3153E-24m), // 16 / 6
- new TestResult(2, 5.3153E-24m), // 16 / 7
- new TestResult(2, -1.52011951E-20m), // 16 / 8
- new TestResult(2, 0.1314426870900784765046305445m), // 16 / 9
- new TestResult(2, 8.6888899697E-18m), // 16 / 10
- new TestResult(2, 7.724287894055618E-13m), // 16 / 11
- new TestResult(0, -551986.34819545603591091806686m), // 16 / 12
- new TestResult(2, 1.0516171478749E-15m), // 16 / 13
- new TestResult(2, -1.8897026181E-18m), // 16 / 14
- new TestResult(2, -2.95607204E-20m), // 16 / 15
- new TestResult(0, 1m), // 16 / 16
- new TestResult(2, -1.72145008370758982E-11m), // 16 / 17
- new TestResult(2, 7.91100512E-20m), // 16 / 18
- new TestResult(2, -4.0964877E-21m), // 16 / 19
- new TestResult(2, -5.94695987815313124908788E-05m), // 16 / 20
- new TestResult(2, -1.012918824165199591208E-06m), // 16 / 21
- new TestResult(2, 6.59097566989758101184E-08m), // 16 / 22
- new TestResult(2, -9.520218003229776933E-10m), // 16 / 23
- new TestResult(2, 8.211691978458736692E-10m), // 16 / 24
- new TestResult(2, -6.915671541963459E-13m), // 16 / 25
- new TestResult(2, 9.9006177649E-18m), // 16 / 26
- new TestResult(2, 5.39329532081E-17m), // 16 / 27
- new TestResult(2, -4.057817E-22m), // 16 / 28
- new TestResult(2, 8.42731522299060351340978E-05m), // 16 / 29
- new TestResult(3, 0m), // 17 / 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 / 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 / 2
- new TestResult(0, 12231644369149772.600254449321m), // 17 / 3
- new TestResult(0, 2446328873829954.5200508898642m), // 17 / 4
- new TestResult(0, 244632887382995452.00508898642m), // 17 / 5
- new TestResult(2, 3.087701135804474E-13m), // 17 / 6
- new TestResult(2, -3.087701135804474E-13m), // 17 / 7
- new TestResult(2, 8.830459389222225669E-10m), // 17 / 8
- new TestResult(0, -7635579348.7187565660747357791m), // 17 / 9
- new TestResult(2, -5.047424872722036356353E-07m), // 17 / 10
- new TestResult(2, -0.0448708212173039475800037318m), // 17 / 11
- new TestResult(0, 32065196279558108.529140993113m), // 17 / 12
- new TestResult(2, -6.10890294076955781848965E-05m), // 17 / 13
- new TestResult(2, 1.097738840026777145636E-07m), // 17 / 14
- new TestResult(2, 1.7171988100225883459E-09m), // 17 / 15
- new TestResult(0, -58090560363.286299748647320613m), // 17 / 16
- new TestResult(0, 1m), // 17 / 17
- new TestResult(2, -4.5955472073286630491E-09m), // 17 / 18
- new TestResult(2, 2.379672667086185355E-10m), // 17 / 19
- new TestResult(0, 3454622.3177989620890093190782m), // 17 / 20
- new TestResult(0, 58841.022098277508341771781449m), // 17 / 21
- new TestResult(0, -3828.7347000513678647353825371m), // 17 / 22
- new TestResult(0, 55.303479858826432190514052161m), // 17 / 23
- new TestResult(0, -47.702178855937114485246771806m), // 17 / 24
- new TestResult(2, 0.0401735235161089558399723624m), // 17 / 25
- new TestResult(2, -5.751324339033751411128E-07m), // 17 / 26
- new TestResult(2, -3.1329954739064384030107E-06m), // 17 / 27
- new TestResult(2, 2.35720841767462147E-11m), // 17 / 28
- new TestResult(0, -4895474.6366157719700764456737m), // 17 / 29
- new TestResult(3, 0m), // 18 / 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 / 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 / 2
- new TestResult(0, -2661629576918192956348888.0005m), // 18 / 3
- new TestResult(0, -532325915383638591269777.6001m), // 18 / 4
- new TestResult(0, -53232591538363859126977760.01m), // 18 / 5
- new TestResult(2, -6.71889765571425396685425E-05m), // 18 / 6
- new TestResult(2, 6.71889765571425396685425E-05m), // 18 / 7
- new TestResult(2, -0.1921525117866271842350897941m), // 18 / 8
- new TestResult(2, 1661516899781174928.9093780261m), // 18 / 9
- new TestResult(2, 109.83294578440517035615430815m), // 18 / 10
- new TestResult(0, 9763977.866606841461047851247m), // 18 / 11
- new TestResult(0, -6977449002900619940294072.5616m), // 18 / 12
- new TestResult(2, 13293.091475651689504900168879m), // 18 / 13
- new TestResult(2, -23.887010414694002921991680138m), // 18 / 14
- new TestResult(2, -0.3736657970315521134142448751m), // 18 / 15
- new TestResult(2, 12640618786517406225.453062932m), // 18 / 16
- new TestResult(2, -217601942.68166121398235985303m), // 18 / 17
- new TestResult(0, 1m), // 18 / 18
- new TestResult(2, -0.0517821395304403973786481636m), // 18 / 19
- new TestResult(0, -751732527584477.35915419894761m), // 18 / 20
- new TestResult(2, -12803920717959.743225565448731m), // 18 / 21
- new TestResult(2, 833140108743.8650907762143944m), // 18 / 22
- new TestResult(2, -12034144654.336754703603784598m), // 18 / 23
- new TestResult(2, 10380086789.199979490407779016m), // 18 / 24
- new TestResult(2, -8741836.761472709884309939817m), // 18 / 25
- new TestResult(2, 125.14993491660654415586289072m), // 18 / 26
- new TestResult(0, 681.74590153489282094280759828m), // 18 / 27
- new TestResult(2, -0.0051293313099156230719389272m), // 18 / 28
- new TestResult(2, 1065264791276391.4723331595476m), // 18 / 29
- new TestResult(3, 0m), // 19 / 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 / 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 / 2
- new TestResult(0, 51400533099902917362336584.595m), // 19 / 3
- new TestResult(0, 10280106619980583472467316.919m), // 19 / 4
- new TestResult(0, 1028010661998058347246731691.9m), // 19 / 5
- new TestResult(2, 0.0012975318742410238535080931m), // 19 / 6
- new TestResult(2, -0.0012975318742410238535080931m), // 19 / 7
- new TestResult(0, 3.7107874168403053465719309061m), // 19 / 8
- new TestResult(0, -32086679207305516282.844795417m), // 19 / 9
- new TestResult(0, -2121.0584726774239906503858037m), // 19 / 10
- new TestResult(0, -188558795.66094477019222763757m), // 19 / 11
- new TestResult(0, 134746247763650063417846672.74m), // 19 / 12
- new TestResult(0, -256711.90097962787395549999647m), // 19 / 13
- new TestResult(0, 461.29825131408293475234811789m), // 19 / 14
- new TestResult(0, 7.2161135175168023022995955438m), // 19 / 15
- new TestResult(0, -244111558563287122929.04506056m), // 19 / 16
- new TestResult(0, 4202258629.2276083227657702227m), // 19 / 17
- new TestResult(0, -19.311677908019711128996883838m), // 19 / 18
- new TestResult(0, 1m), // 19 / 19
- new TestResult(0, 14517216445692969.517326696553m), // 19 / 20
- new TestResult(0, 247265192865059.0518154425151m), // 19 / 21
- new TestResult(0, -16089333432314.039236231362245m), // 19 / 22
- new TestResult(0, 232399525463.06860877964908684m), // 19 / 23
- new TestResult(0, -200456892730.3205001486617745m), // 19 / 24
- new TestResult(0, 168819535.86204710848979659043m), // 19 / 25
- new TestResult(0, -2416.8552333191352676140967438m), // 19 / 26
- new TestResult(0, -13165.657265554370962757268367m), // 19 / 27
- new TestResult(2, 0.0990559941406113443335355768m), // 19 / 28
- new TestResult(0, -20572050535883517.889932557941m), // 19 / 29
- new TestResult(3, 0m), // 20 / 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 / 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 / 2
- new TestResult(0, 3540660380.1896643587350463984m), // 20 / 3
- new TestResult(0, 708132076.03793287174700927968m), // 20 / 4
- new TestResult(0, 70813207603.793287174700927968m), // 20 / 5
- new TestResult(2, 8.93788337E-20m), // 20 / 6
- new TestResult(2, -8.93788337E-20m), // 20 / 7
- new TestResult(2, 2.556128739088E-16m), // 20 / 8
- new TestResult(0, -2210.250107335496183875574735m), // 20 / 9
- new TestResult(2, -1.461064165166945E-13m), // 20 / 10
- new TestResult(2, -1.2988632935681496171E-08m), // 20 / 11
- new TestResult(2, 9281823982.422412820396304075m), // 20 / 12
- new TestResult(2, -1.76832729566273202E-11m), // 20 / 13
- new TestResult(2, 3.17759436211301E-14m), // 20 / 14
- new TestResult(2, 4.970728062443E-16m), // 20 / 15
- new TestResult(2, -16815.314387332923907118773285m), // 20 / 16
- new TestResult(2, 2.894672435964370128732E-07m), // 20 / 17
- new TestResult(2, -1.3302603829227E-15m), // 20 / 18
- new TestResult(2, 6.88837287603E-17m), // 20 / 19
- new TestResult(0, 1m), // 20 / 20
- new TestResult(2, 0.0170325484771854288433021822m), // 20 / 21
- new TestResult(2, -0.0011082932800859005017661851m), // 20 / 22
- new TestResult(2, 1.60085458760255588702037E-05m), // 20 / 23
- new TestResult(2, -1.38082182269723557757959E-05m), // 20 / 24
- new TestResult(2, 1.16289191177647018971E-08m), // 20 / 25
- new TestResult(2, -1.6648200034492E-13m), // 20 / 26
- new TestResult(2, -9.068995640318096E-13m), // 20 / 27
- new TestResult(2, 6.8233462325E-18m), // 20 / 28
- new TestResult(2, -1.4170795491574366313541174399m), // 20 / 29
- new TestResult(3, 0m), // 21 / 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 / 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 / 2
- new TestResult(2, 207876136969.8885212282841852m), // 21 / 3
- new TestResult(0, 41575227393.977704245656837041m), // 21 / 4
- new TestResult(0, 4157522739397.7704245656837041m), // 21 / 5
- new TestResult(2, 5.2475314427E-18m), // 21 / 6
- new TestResult(2, -5.2475314427E-18m), // 21 / 7
- new TestResult(2, 1.50073181503771E-14m), // 21 / 8
- new TestResult(2, -129766.25959973387113808743405m), // 21 / 9
- new TestResult(2, -8.5780713738991847E-12m), // 21 / 10
- new TestResult(2, -7.625771887911763590261E-07m), // 21 / 11
- new TestResult(0, 544946282986.07977368508338172m), // 21 / 12
- new TestResult(2, -1.0382047630930577807E-09m), // 21 / 13
- new TestResult(2, 1.8656012436244067E-12m), // 21 / 14
- new TestResult(2, 2.91837012476515E-14m), // 21 / 15
- new TestResult(2, -987245.9432513294606844938685m), // 21 / 16
- new TestResult(2, 1.69949461164997956913075E-05m), // 21 / 17
- new TestResult(2, -7.81010771643817E-14m), // 21 / 18
- new TestResult(2, 4.0442408752037E-15m), // 21 / 19
- new TestResult(0, 58.711120143850993772970798576m), // 21 / 20
- new TestResult(0, 1m), // 21 / 21
- new TestResult(2, -0.0650691399217460043995169619m), // 21 / 22
- new TestResult(2, 0.0009398796602556869430220663m), // 21 / 23
- new TestResult(2, -0.0008106959592962871308194687m), // 21 / 24
- new TestResult(2, 6.827468674662091164433E-07m), // 21 / 25
- new TestResult(2, -9.7743447240392408E-12m), // 21 / 26
- new TestResult(2, -5.32450892622776623E-11m), // 21 / 27
- new TestResult(2, 4.006063004374E-16m), // 21 / 28
- new TestResult(2, -83.19832766397646235747803502m), // 21 / 29
- new TestResult(3, 0m), // 22 / 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 / 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 / 2
- new TestResult(0, -3194696244946.3181336835410231m), // 22 / 3
- new TestResult(0, -638939248989.26362673670820462m), // 22 / 4
- new TestResult(0, -63893924898926.362673670820462m), // 22 / 5
- new TestResult(2, -8.06454710942E-17m), // 22 / 6
- new TestResult(2, 8.06454710942E-17m), // 22 / 7
- new TestResult(2, -2.306364917136659E-13m), // 22 / 8
- new TestResult(2, 1994282.6930829954142428134453m), // 22 / 9
- new TestResult(2, 1.31830102322167113E-10m), // 22 / 10
- new TestResult(2, 1.17194908324940723524544E-05m), // 22 / 11
- new TestResult(2, -8374880682938.911591614017805m), // 22 / 12
- new TestResult(2, 1.59554093436863052632E-08m), // 22 / 13
- new TestResult(2, -2.8671060442293101E-11m), // 22 / 14
- new TestResult(2, -4.485029505960676E-13m), // 22 / 15
- new TestResult(2, 15172260.52839517272431927284m), // 22 / 16
- new TestResult(2, -0.0002611828915663923103773216m), // 22 / 17
- new TestResult(2, 1.2002783079399592E-12m), // 22 / 18
- new TestResult(2, -6.21529788171079E-14m), // 22 / 19
- new TestResult(2, -902.2882462325251912660653119m), // 22 / 20
- new TestResult(2, -15.368268294350108200187006165m), // 22 / 21
- new TestResult(0, 1m), // 22 / 22
- new TestResult(2, -0.0144443227832120251558802997m), // 22 / 23
- new TestResult(2, 0.0124589930076108753677011728m), // 22 / 24
- new TestResult(2, -1.04926370363477969575619E-05m), // 22 / 25
- new TestResult(2, 1.50214752120500522E-10m), // 22 / 26
- new TestResult(2, 8.182848171393031905E-10m), // 22 / 27
- new TestResult(2, -6.156625105529E-15m), // 22 / 28
- new TestResult(2, 1278.6142211812409691677177837m), // 22 / 29
- new TestResult(3, 0m), // 23 / 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 / 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 / 2
- new TestResult(0, 221173141371457.52982081653405m), // 23 / 3
- new TestResult(0, 44234628274291.50596416330681m), // 23 / 4
- new TestResult(0, 4423462827429150.596416330681m), // 23 / 5
- new TestResult(2, 5.5831950244116E-15m), // 23 / 6
- new TestResult(2, -5.5831950244116E-15m), // 23 / 7
- new TestResult(2, 1.59672762216117307E-11m), // 23 / 8
- new TestResult(0, -138066887.80181919317571960944m), // 23 / 9
- new TestResult(2, -9.1267762636395250963E-09m), // 23 / 10
- new TestResult(2, -0.0008113561991369439495762269m), // 23 / 11
- new TestResult(0, 579804315413987.55317875373327m), // 23 / 12
- new TestResult(2, -1.104614566093091384748E-06m), // 23 / 13
- new TestResult(2, 1.9849362876061009571E-09m), // 23 / 14
- new TestResult(2, 3.10504658008156699E-11m), // 23 / 15
- new TestResult(2, -1050396114.5225303515983863327m), // 23 / 16
- new TestResult(2, 0.018082044792709369766201304m), // 23 / 17
- new TestResult(2, -8.30968904499273382E-11m), // 23 / 18
- new TestResult(2, 4.3029347758238576E-12m), // 23 / 19
- new TestResult(0, 62466.635492334295970467255163m), // 23 / 20
- new TestResult(2, 1063.9659972298557739709718754m), // 23 / 21
- new TestResult(0, -69.231352345729507070036842909m), // 23 / 22
- new TestResult(0, 1m), // 23 / 23
- new TestResult(2, -0.8625529347828887027197930493m), // 23 / 24
- new TestResult(2, 0.000726419451699245356034835m), // 23 / 25
- new TestResult(2, -1.03995704315807902618E-08m), // 23 / 26
- new TestResult(2, -5.66509644945319386873E-08m), // 23 / 27
- new TestResult(2, 4.262314819414408E-13m), // 23 / 28
- new TestResult(0, -88520.19166085901375500091819m), // 23 / 29
- new TestResult(3, 0m), // 24 / 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 / 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 / 2
- new TestResult(0, -256416890433661.94510418721882m), // 24 / 3
- new TestResult(0, -51283378086732.389020837443764m), // 24 / 4
- new TestResult(0, -5128337808673238.9020837443764m), // 24 / 5
- new TestResult(2, -6.4728723296466E-15m), // 24 / 6
- new TestResult(2, 6.4728723296466E-15m), // 24 / 7
- new TestResult(2, -1.85116478974485417E-11m), // 24 / 8
- new TestResult(0, 160067727.13209967231293920454m), // 24 / 9
- new TestResult(2, 1.05811201789450821647E-08m), // 24 / 10
- new TestResult(2, 0.0009406451087447388135269385m), // 24 / 11
- new TestResult(0, -672195632329427.78049892650167m), // 24 / 12
- new TestResult(2, 1.280633943203881720602E-06m), // 24 / 13
- new TestResult(2, -2.3012341707535026743E-09m), // 24 / 14
- new TestResult(2, -3.59983307095596564E-11m), // 24 / 15
- new TestResult(2, 1217775828.2011100471829103026m), // 24 / 16
- new TestResult(2, -0.0209634030139388041036175456m), // 24 / 17
- new TestResult(2, 9.63383081768117492E-11m), // 24 / 18
- new TestResult(2, -4.988603716138233E-12m), // 24 / 19
- new TestResult(0, -72420.639908967018993409156115m), // 24 / 20
- new TestResult(2, -1233.5080599982704934889448056m), // 24 / 21
- new TestResult(2, 80.26330855062892819843621147m), // 24 / 22
- new TestResult(0, -1.1593491363538259770624590073m), // 24 / 23
- new TestResult(0, 1m), // 24 / 24
- new TestResult(2, -0.0008421737639581399076256596m), // 24 / 25
- new TestResult(2, 1.20567329983039744731E-08m), // 24 / 26
- new TestResult(2, 6.56782467603468627053E-08m), // 24 / 27
- new TestResult(2, -4.941511004756208E-13m), // 24 / 28
- new TestResult(2, 102625.80775189204591883200668m), // 24 / 29
- new TestResult(3, 0m), // 25 / 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 / 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 / 2
- new TestResult(0, 304470290345457852.0725448757m), // 25 / 3
- new TestResult(0, 60894058069091570.41450897514m), // 25 / 4
- new TestResult(0, 6089405806909157041.450897514m), // 25 / 5
- new TestResult(2, 7.6859106833543095E-12m), // 25 / 6
- new TestResult(2, -7.6859106833543095E-12m), // 25 / 7
- new TestResult(2, 2.19807938571316735336E-08m), // 25 / 8
- new TestResult(2, -190064965191.73899284873850192m), // 25 / 9
- new TestResult(2, -1.2564058192949139177057E-05m), // 25 / 10
- new TestResult(2, -1.1169252106878663178369471734m), // 25 / 11
- new TestResult(2, 798167386704341861.9682340376m), // 25 / 12
- new TestResult(2, -0.0015206291124352045188095451m), // 25 / 13
- new TestResult(2, 2.7324933039209294299951E-06m), // 25 / 14
- new TestResult(2, 4.27445406757517405142E-08m), // 25 / 15
- new TestResult(0, -1445991172270.2862199666258075m), // 25 / 16
- new TestResult(2, 24.892016245451201449485802529m), // 25 / 17
- new TestResult(2, -1.143924357415629812325E-07m), // 25 / 18
- new TestResult(2, 5.9234850687965514433E-09m), // 25 / 19
- new TestResult(2, 85992514.8565500475609760009m), // 25 / 20
- new TestResult(2, 1464671.6779692768786214751455m), // 25 / 21
- new TestResult(2, -95304.9263532013818698238713m), // 25 / 22
- new TestResult(2, 1376.6151190758908669955780933m), // 25 / 23
- new TestResult(2, -1187.4034110254054607086172841m), // 25 / 24
- new TestResult(0, 1m), // 25 / 25
- new TestResult(2, -1.43162058880087033607313E-05m), // 25 / 26
- new TestResult(2, -7.79865742334041504368931E-05m), // 25 / 27
- new TestResult(2, 5.867567022667099857E-10m), // 25 / 28
- new TestResult(2, -121858234.18383411295432055833m), // 25 / 29
- new TestResult(3, 0m), // 26 / 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 / 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 / 2
- new TestResult(2, -21267526656659993483057.518894m), // 26 / 3
- new TestResult(0, -4253505331331998696611.5037787m), // 26 / 4
- new TestResult(0, -425350533133199869661150.37787m), // 26 / 5
- new TestResult(2, -5.368678505659136383798E-07m), // 26 / 6
- new TestResult(2, 5.368678505659136383798E-07m), // 26 / 7
- new TestResult(2, -0.0015353784395866262203076433m), // 26 / 8
- new TestResult(2, 13276210657946598.343741130625m), // 26 / 9
- new TestResult(2, 0.8776108901502200170717671109m), // 26 / 10
- new TestResult(0, 78018.241664392812128305230978m), // 26 / 11
- new TestResult(0, -55752717790464947101601.359896m), // 26 / 12
- new TestResult(2, 106.21732631750483463727976216m), // 26 / 13
- new TestResult(2, -0.1908671421252521905897157731m), // 26 / 14
- new TestResult(2, -0.0029857450367876236635795704m), // 26 / 15
- new TestResult(2, 101003798323510611.65980529603m), // 26 / 16
- new TestResult(0, -1738729.9707879186275737174853m), // 26 / 17
- new TestResult(2, 0.0079904156615530673319808542m), // 26 / 18
- new TestResult(2, -0.0004137608186927571471957746m), // 26 / 19
- new TestResult(0, -6006655361709.8810944800037905m), // 26 / 20
- new TestResult(2, -102308648634.06932650747319597m), // 26 / 21
- new TestResult(0, 6657135773.1750052361186583781m), // 26 / 22
- new TestResult(2, -96157817.91940752862823678187m), // 26 / 23
- new TestResult(2, 82941208.04870360868726566113m), // 26 / 24
- new TestResult(0, -69850.909369611886817979504214m), // 26 / 25
- new TestResult(0, 1m), // 26 / 26
- new TestResult(0, 5.4474331288240229212686639513m), // 26 / 27
- new TestResult(2, -4.09854892320443047650146E-05m), // 26 / 28
- new TestResult(0, 8511908471915.937756062101659m), // 26 / 29
- new TestResult(3, 0m), // 27 / 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 / 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 / 2
- new TestResult(2, -3904137261295976553742.9406156m), // 27 / 3
- new TestResult(0, -780827452259195310748.58812311m), // 27 / 4
- new TestResult(0, -78082745225919531074858.812311m), // 27 / 5
- new TestResult(2, -9.85542801296968307756E-08m), // 27 / 6
- new TestResult(2, 9.85542801296968307756E-08m), // 27 / 7
- new TestResult(2, -0.000281853563555002197999826m), // 27 / 8
- new TestResult(2, 2437149817901964.8960845694514m), // 27 / 9
- new TestResult(2, 0.1611053994415304138070003376m), // 27 / 10
- new TestResult(2, 14322.019163773595213651372685m), // 27 / 11
- new TestResult(2, -10234676860090376638967.506512m), // 27 / 12
- new TestResult(2, 19.498601232106311831598265533m), // 27 / 13
- new TestResult(2, -0.0350379963574616786880617938m), // 27 / 14
- new TestResult(2, -0.0005481012737887758520091497m), // 27 / 15
- new TestResult(2, 18541539828927654.501195934005m), // 27 / 16
- new TestResult(2, -319183.3529057512147016471775m), // 27 / 17
- new TestResult(2, 0.0014668221660718241029342142m), // 27 / 18
- new TestResult(2, -7.59551900698740123366376E-05m), // 27 / 19
- new TestResult(2, -1102657934418.1103423727465413m), // 27 / 20
- new TestResult(2, -18781074721.729615778535996388m), // 27 / 21
- new TestResult(2, 1222068378.9489912725931951927m), // 27 / 22
- new TestResult(2, -17651950.128695901472129097893m), // 27 / 23
- new TestResult(0, 15225741.38814783974528909088m), // 27 / 24
- new TestResult(2, -12822.719933909700245783228909m), // 27 / 25
- new TestResult(2, 0.1835726986181246222761380025m), // 27 / 26
- new TestResult(0, 1m), // 27 / 27
- new TestResult(2, -7.5238168625104611316081E-06m), // 27 / 28
- new TestResult(2, 1562554008580.0861321324839011m), // 27 / 29
- new TestResult(3, 0m), // 28 / 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 / 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 / 2
- new TestResult(0, 518903813402136518665029735.85m), // 28 / 3
- new TestResult(0, 103780762680427303733005947.17m), // 28 / 4
- new TestResult(0, 10378076268042730373300594717m), // 28 / 5
- new TestResult(2, 0.013098973822817421173845813m), // 28 / 6
- new TestResult(2, -0.013098973822817421173845813m), // 28 / 7
- new TestResult(0, 37.461513046578399246836695461m), // 28 / 8
- new TestResult(0, -323924659841968113506.41166762m), // 28 / 9
- new TestResult(0, -21412.722077843692663812014719m), // 28 / 10
- new TestResult(0, -1903557652.3848013647110715272m), // 28 / 11
- new TestResult(0, 1360303825454277040707598638.1m), // 28 / 12
- new TestResult(0, -2591583.7118874583629347087379m), // 28 / 13
- new TestResult(0, 4656.9443405844146143879311m), // 28 / 14
- new TestResult(0, 72.848832421725332869329889807m), // 28 / 15
- new TestResult(0, -2464379472248467996678.919247m), // 28 / 16
- new TestResult(0, 42423062487.893912564215173398m), // 28 / 17
- new TestResult(0, -194.95718634257023426451589779m), // 28 / 18
- new TestResult(0, 10.095300225653040883323838635m), // 28 / 19
- new TestResult(0, 146555658460058271.30028503504m), // 28 / 20
- new TestResult(0, 2496216357326773.3203945609668m), // 28 / 21
- new TestResult(0, -162426651429846.93508891542812m), // 28 / 22
- new TestResult(0, 2346142981848.9761467960716552m), // 28 / 23
- new TestResult(0, -2023672514414.1119557698582125m), // 28 / 24
- new TestResult(0, 1704283898.4827658021193146276m), // 28 / 25
- new TestResult(0, -24398.879182297399040382596287m), // 28 / 26
- new TestResult(0, -132911.26276382163838029345835m), // 28 / 27
- new TestResult(0, 1m), // 28 / 28
- new TestResult(0, -207681026417050638.7817636979m), // 28 / 29
- new TestResult(3, 0m), // 29 / 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 / 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 / 2
- new TestResult(0, -2498561483.224326212885781521m), // 29 / 3
- new TestResult(0, -499712296.6448652425771563042m), // 29 / 4
- new TestResult(0, -49971229664.48652425771563042m), // 29 / 5
- new TestResult(2, -6.30725591E-20m), // 29 / 6
- new TestResult(2, 6.30725591E-20m), // 29 / 7
- new TestResult(2, -1.803800457503E-16m), // 29 / 8
- new TestResult(0, 1559.7219709011119254589559305m), // 29 / 9
- new TestResult(2, 1.031038918059089E-13m), // 29 / 10
- new TestResult(2, 9.1657754452841005337E-09m), // 29 / 11
- new TestResult(0, -6549966787.6381215871101448624m), // 29 / 12
- new TestResult(2, 1.24786734570697837E-11m), // 29 / 13
- new TestResult(2, -2.24235425880102E-14m), // 29 / 14
- new TestResult(2, -3.507726905944E-16m), // 29 / 15
- new TestResult(2, 11866.175330334086443056587349m), // 29 / 16
- new TestResult(2, -2.042702851569255038994E-07m), // 29 / 17
- new TestResult(2, 9.387337384931E-16m), // 29 / 18
- new TestResult(2, -4.86096414286E-17m), // 29 / 19
- new TestResult(2, -0.705676685966272906628710787m), // 29 / 20
- new TestResult(2, -0.0120194723629401016807892544m), // 29 / 21
- new TestResult(2, 0.0007820967289697085504718691m), // 29 / 22
- new TestResult(2, -1.1296857600932761513324E-05m), // 29 / 23
- new TestResult(2, 9.7441376775089367720444E-06m), // 29 / 24
- new TestResult(2, -8.2062571043940289217E-09m), // 29 / 25
- new TestResult(2, 1.17482466276439E-13m), // 29 / 26
- new TestResult(2, 6.399778788502251E-13m), // 29 / 27
- new TestResult(2, -4.8150763565E-18m), // 29 / 28
- new TestResult(0, 1m), // 29 / 29
- };
-
- #endregion
- }
-}
diff --git a/mcs/class/corlib/Test/System/DoubleTest.cs b/mcs/class/corlib/Test/System/DoubleTest.cs
deleted file mode 100644
index fbc38aff23e..00000000000
--- a/mcs/class/corlib/Test/System/DoubleTest.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Double class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DoubleTest : TestCase
-{
- private const Double d_zero = 0.0;
- private const Double d_neg = -1234.5678;
- private const Double d_pos = 1234.9999;
- private const Double d_pos2 = 1234.9999;
- private const Double d_nan = Double.NaN;
- private const Double d_pinf = Double.PositiveInfinity;
- private const Double d_ninf = Double.NegativeInfinity;
- private const String s = "What Ever";
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
-
- private string[] string_values = {
- "1", ".1", "1.1", "-12", "44.444432", ".000021121",
- " .00001", " .223 ", " -221.3233",
- " 1.7976931348623157e308 ", "+1.7976931348623157E308", "-1.7976931348623157e308",
- "4.9406564584124650e-324",
- "6.28318530717958647692528676655900577",
- "1e-05",
- };
- private double[] double_values = {
- 1, .1, 1.1, -12, 44.444432, .000021121,
- .00001, .223, -221.3233,
- 1.7976931348623157e308, 1.7976931348623157e308, -1.7976931348623157e308,
- 4.9406564584124650e-324,
- 6.28318530717958647692528676655900577,
- 1e-05
- };
-
- public DoubleTest () : base ("MonoTests.System.DoubleTests testcase") {}
- public DoubleTest (string name) : base (name) {}
-
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (DoubleTest));
- }
- }
-
- public void TestPublicFields ()
- {
- AssertEquals("Epsilon Field has wrong value", 3.9406564584124654e-324, Double.Epsilon);
- AssertEquals("MaxValue Field has wrong value", 1.7976931348623157e+308, Double.MaxValue);
- AssertEquals("MinValue Field has wrong value", -1.7976931348623157e+308, Double.MinValue);
- AssertEquals("NegativeInfinity Field has wrong value", (double)-1.0 / (double)(0.0), Double.NegativeInfinity);
- AssertEquals("PositiveInfinity Field has wrong value", (double)1.0 / (double)(0.0), Double.PositiveInfinity);
- }
-
- public void TestCompareTo () {
- //If you do int foo = d_ninf.CompareTo(d_pinf); Assert(".." foo < 0, true) this works.... WHY???
- AssertEquals("CompareTo Infinity failed", d_ninf.CompareTo(d_pinf) < 0, true);
-
- AssertEquals("CompareTo Failed01", d_neg.CompareTo(d_pos) < 0, true);
- AssertEquals("CompareTo NaN Failed", d_nan.CompareTo(d_neg) < 0, true);
-
- AssertEquals("CompareTo Failed02", 0, d_pos.CompareTo(d_pos2));
- AssertEquals("CompareTo Failed03", 0, d_pinf.CompareTo(d_pinf));
- AssertEquals("CompareTo Failed04", 0, d_ninf.CompareTo(d_ninf));
- AssertEquals("CompareTo Failed05", 0, d_nan.CompareTo(d_nan));
-
- Assert("CompareTo Failed06", d_pos.CompareTo(d_neg) > 0);
- Assert("CompareTo Failed07", d_pos.CompareTo(d_nan) > 0);
- Assert("CompareTo Failed08", d_pos.CompareTo(null) > 0);
-
- try {
- d_pos.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
-
- }
-
- public void TestEquals () {
- AssertEquals("Equals Failed", true, d_pos.Equals(d_pos2));
- AssertEquals("Equals Failed", false, d_pos.Equals(d_neg));
- AssertEquals("Equals Failed", false, d_pos.Equals(s));
-
- }
-
- public void TestTypeCode () {
- AssertEquals("GetTypeCode Failed", TypeCode.Double, d_pos.GetTypeCode());
- }
-
- public void TestIsInfinity() {
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.PositiveInfinity));
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.NegativeInfinity));
- AssertEquals("IsInfinity Failed", false, Double.IsInfinity(12));
- }
-
- public void TestIsNan() {
- AssertEquals("IsNan Failed", true, Double.IsNaN(Double.NaN));
- AssertEquals("IsNan Failed", false, Double.IsNaN(12));
- AssertEquals("IsNan Failed", false, Double.IsNaN(Double.PositiveInfinity));
- }
-
- public void TestIsNegativeInfinity() {
- AssertEquals("IsNegativeInfinity Failed", true, Double.IsNegativeInfinity(Double.NegativeInfinity));
- AssertEquals("IsNegativeInfinity Failed", false, Double.IsNegativeInfinity(12));
- }
-
- public void TestIsPositiveInfinity() {
- AssertEquals("IsPositiveInfinity Failed", true, Double.IsPositiveInfinity(Double.PositiveInfinity));
- AssertEquals("IsPositiveInfinity Failed", false, Double.IsPositiveInfinity(12));
- }
-
- public void TestParse() {
- int i=0;
- try {
- for(i=0;i<string_values.Length;i++) {
- AssertEquals("Parse Failed", double_values[i], Double.Parse(string_values[i]));
- }
- } catch (Exception e) {
- Fail("TestParse: i=" + i + " failed with e = " + e.ToString());
- }
-
- try {
- AssertEquals("Parse Failed NumberStyles.Float", 10.1111, Double.Parse(" 10.1111 ", NumberStyles.Float, Nfi));
- } catch (Exception e) {
- Fail("TestParse: Parse Failed NumberStyles.Float with e = " + e.ToString());
- }
-
- try {
- AssertEquals("Parse Failed NumberStyles.AllowThousands", 1234.5678, Double.Parse("1,234.5678", NumberStyles.Float | NumberStyles.AllowThousands, Nfi));
- } catch (Exception e) {
- Fail("TestParse: Parse Failed NumberStyles.AllowThousands with e = " + e.ToString());
- }
-
- try {
- Double.Parse(null);
- Fail("Parse should raise a ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Parse should be a ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
-
- try {
- Double.Parse("save the elk");
- Fail("Parse should raise a FormatException");
- }
- catch (Exception e) {
- Assert("Parse should be a FormatException", typeof(FormatException) == e.GetType());
- }
-
- double ovf_plus = 0;
- try {
- ovf_plus = Double.Parse("1.79769313486232e308");
- Fail("Parse should have raised an OverflowException +");
- }
- catch (Exception e) {
- AssertEquals("Should be an OverflowException + for " + ovf_plus, typeof(OverflowException), e.GetType());
- }
-
- try {
- Double.Parse("-1.79769313486232e308");
- Fail("Parse should have raised an OverflowException -");
- }
- catch (Exception e) {
- AssertEquals("Should be an OverflowException -", typeof(OverflowException), e.GetType());
- }
-
-
- }
-
- public void TestToString() {
- //ToString is not yet Implemented......
- //AssertEquals("ToString Failed", "1234.9999", d_pos.ToString());
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/EnumTest.cs b/mcs/class/corlib/Test/System/EnumTest.cs
deleted file mode 100644
index 4b6ac0f786c..00000000000
--- a/mcs/class/corlib/Test/System/EnumTest.cs
+++ /dev/null
@@ -1,728 +0,0 @@
-// EnumTest.cs - NUnit Test Cases for the System.Enum class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class EnumTest : TestCase
-{
- public EnumTest() : base ("MonoTests.System.EnumTest testsuite") {}
- public EnumTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(EnumTest));
- }
- }
-
- enum TestingEnum {This, Is, A, Test};
- enum TestingEnum2 {This, Is, A, Test};
-
- public void TestCompareTo() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- AssertEquals("An enum should equal itself",
- 0, e1.CompareTo(e1));
- AssertEquals("An enum should equal a copy",
- 0, e1.CompareTo(e2));
-
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- AssertEquals("should equal", 0, x.CompareTo(x));
- AssertEquals("less than", -1, x.CompareTo(y));
- AssertEquals("greater than", 1, y.CompareTo(x));
-
- {
- bool errorThrown = false;
- try {
- e1.CompareTo(e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("1) Compare type mismatch not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ((Enum)e1).CompareTo((Enum)e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("2) Compare type mismatch not caught.",
- errorThrown);
- }
- }
-
- public void TestEquals() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- Assert("An enum should equal itself", e1.Equals(e1));
- Assert("An enum should equal a copy", e1.Equals(e2));
-
- Assert("Shouldn't match", !e1.Equals(e3));
- Assert("Shouldn't match null", !e1.Equals(null));
- }
-
- public void TestFormat() {
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(null, x, "G");
- Fail("null first arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("first arg null, wrong exception: " + e.ToString());
- }
- Fail ("01 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), null, "G");
- Fail("null second arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("second arg null, wrong exception: " + e.ToString());
- }
- Fail ("02 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, null);
- Fail("null third arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("third arg null, wrong exception: " + e.ToString());
- }
- Fail ("03 - Should not be here");
-
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(bad.GetType(), x, "G");
- Fail("bad type arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("bad type, wrong exception: " + e.ToString());
- }
- Fail ("04 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.Format(y.GetType(), x, "G");
- Fail("wrong enum type not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("wrong enum type, wrong exception: " + e.ToString());
- }
- Fail ("05 - Should not be here");
-
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), bad, "G");
- Fail("non-enum object not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("non-enum object, wrong exception: " + e.ToString());
- }
- Fail ("06 - Should not be here");
-
- string[] codes = {"a", "b", "c", "ad", "e", "af", "ag", "h",
- "i", "j", "k", "l", "m", "n", "o", "p",
- "q", "r", "s", "t", "u", "v", "w", "ax",
- "y", "z"};
- foreach (string code in codes) {
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, code);
- Fail ("bad format code not caught - " + code);
- } catch (FormatException) {
-
- } catch (Exception e) {
- Fail ("bad format code, wrong exception: " + e.ToString());
- }
- }
-
- {
- TestingEnum x = TestingEnum.Test;
- AssertEquals("decimal format wrong",
- "3", Enum.Format(x.GetType(), x, "d"));
- AssertEquals("named format wrong",
- "Test", Enum.Format(x.GetType(), x, "g"));
- AssertEquals("hex format wrong",
- "00000003", Enum.Format(x.GetType(), x, "x"));
- AssertEquals("bitfield format wrong",
- "Test", Enum.Format(x.GetType(), x, "f"));
- }
- }
-
- public void TestGetHashCode() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum2();
-
- AssertEquals("hash code is deterministic",
- e1.GetHashCode(), e1.GetHashCode());
- }
-
- public void GetName() {
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(null, x);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(bad.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.GetName(y.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("wrong enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum object not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- TestingEnum z = TestingEnum.A;
-
- AssertEquals("first name doesn't match",
- "This", Enum.GetName(x.GetType(), x));
- AssertEquals("second name doesn't match",
- "Is", Enum.GetName(y.GetType(), y));
- AssertEquals("third name doesn't match",
- "A", Enum.GetName(z.GetType(), z));
- }
- }
-
- public void TestGetNames() {
- {
- bool errorThrown = false;
- try {
- Enum.GetNames(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- string[] match = {"This", "Is", "A", "Test"};
- string[] names = Enum.GetNames(x.GetType());
- AssertNotNull("Got no names", names);
- AssertEquals("names wrong size",
- match.Length, names.Length);
- for (int i = 0; i < names.Length; i++) {
- AssertEquals("name mismatch",
- match[i], names[i]);
- }
- }
- }
-
- public void TestGetTypeCode() {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = new TestingEnum();
- AssertEquals("01 bad type code",
- TypeCode.Int32, x.GetTypeCode());
- AssertEquals("02 bad type code",
- TypeCode.Int32, y.GetTypeCode());
- }
-
- enum TestShortEnum : short { zero, one, two, three, four, five, six};
- public void TestGetUnderlyingType() {
- {
- bool errorThrown = false;
- try {
- Enum.GetUnderlyingType(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetUnderlyingType(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- short sh = 5;
- int i = 5;
- Enum t1 = new TestingEnum();
- Enum t2 = new TestShortEnum();
- AssertEquals("Wrong default underlying type",
- i.GetType(),
- Enum.GetUnderlyingType(t1.GetType()));
- AssertEquals("Not short underlying type",
- sh.GetType(),
- Enum.GetUnderlyingType(t2.GetType()));
- }
- }
-
- public void TestGetValues() {
- {
- bool errorThrown = false;
- try {
- Enum.GetValues(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetValues(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- Enum t1 = new TestingEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (int i= 0; i < a1.Length; i++) {
- AssertEquals("wrong enum value",
- (TestingEnum)i,
- a1.GetValue(i));
- }
- }
- {
- Enum t1 = new TestShortEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (short i= 0; i < a1.Length; i++) {
- AssertEquals("wrong short enum value",
- (TestShortEnum)i,
- a1.GetValue(i));
- }
- }
- }
-
- public void TestIsDefined() {
- {
- bool errorThrown = false;
- try {
- Enum.IsDefined(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.IsDefined(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- int i = 4;
- Enum.IsDefined(bad.GetType(), i);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
-
- try {
- TestingEnum x = TestingEnum.Test;
- short i = 4;
- Enum.IsDefined(x.GetType(), i);
- Fail("wrong underlying type not caught.");
- } catch (ArgumentException) {
- } catch (Exception e) {
- Fail("wrong Exception thrown ("+e.ToString()+")for underlying type not caught.");
- }
-
- // spec says yes, MS impl says no.
- //{
- //bool errorThrown = false;
- //try {
- //String bad = "huh?";
- //TestingEnum x = TestingEnum.Test;
- //Enum.IsDefined(x.GetType(), bad);
- //} catch (ExecutionEngineException) {
- //errorThrown = true;
- //}
- //Assert("non-enum object not caught.",
- //errorThrown);
- //}
- {
- Enum t1 = new TestingEnum();
- int i = 0;
- for (i = 0;
- i < Enum.GetValues(t1.GetType()).Length; i++) {
- Assert("should have value for i=" + i,
- Enum.IsDefined(t1.GetType(), i));
- }
- Assert("Shouldn't have value",
- !Enum.IsDefined(t1.GetType(), i));
- }
- }
-
- public void TestParse1() {
- {
- bool errorThrown = false;
- try {
- String name = "huh?";
- Enum.Parse(null, name);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "This"));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "Is"));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "A"));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "Test"));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,Is"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Test"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Is,A"));
- }
- }
- public void TestParse2() {
- {
- bool errorThrown = true;
- try {
- String name = "huh?";
- Enum.Parse(null, name, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "test";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, false);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "this", true));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "is", true));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "a", true));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "test", true));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,is", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,test", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,is,A", true));
- }
- }
-
- public void TestToObject() {
- {
- bool errorThrown = false;
- try {
- Enum.ToObject(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Enum.ToObject("huh?".GetType(), 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("Should get object",
- TestingEnum.This,
- Enum.ToObject(t1.GetType(), 0));
- }
- // TODO - should probably test all the different underlying types
- }
-
- [Flags]
- enum SomeEnum {a,b,c};
-
- [Flags]
- enum SomeByteEnum : byte {a,b,c};
-
- [Flags]
- enum SomeInt64Enum : long {a,b,c};
-
- public void TestToString() {
- AssertEquals("invalid string", "This",
- TestingEnum.This.ToString());
- AssertEquals("invalid string", "Is",
- TestingEnum.Is.ToString());
- AssertEquals("invalid string", "A",
- TestingEnum.A.ToString());
- AssertEquals("invalid string", "Test",
- TestingEnum.Test.ToString());
-
- Enum is1 = TestingEnum.Is;
-
- AssertEquals("decimal parse wrong",
- "1", is1.ToString("d"));
- AssertEquals("named format wrong",
- "Is", is1.ToString("g"));
- AssertEquals("hex format wrong",
- "00000001", is1.ToString("x"));
- AssertEquals("bitfield format wrong",
- "Is", is1.ToString("f"));
-
-
- AssertEquals("bitfield with flags format wrong for Int32 enum",
- "b, c", ((SomeEnum)3).ToString("f"));
- AssertEquals("bitfield with flags format wrong for Byte enum",
- "b, c", ((SomeByteEnum)3).ToString("f"));
- AssertEquals("bitfield with flags format wrong for Int64 enum",
- "b, c", ((SomeInt64Enum)3).ToString("f"));
- }
-
- // TODO - ToString with IFormatProviders
-}
-}
diff --git a/mcs/class/corlib/Test/System/ExceptionTest.cs b/mcs/class/corlib/Test/System/ExceptionTest.cs
deleted file mode 100644
index d0f6b80f3f8..00000000000
--- a/mcs/class/corlib/Test/System/ExceptionTest.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// ExceptionTest.cs - NUnit Test Cases for the System.Exception class
-//
-// Linus Upson (linus@linus.com)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System
-{
- public class ExceptionTest : TestCase
- {
- public ExceptionTest() : base ("MonoTests.System.ExceptionTest testsuite") {}
- public ExceptionTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ExceptionTest));
- }
- }
-
- // This test makes sure that exceptions thrown on block boundaries are
- // handled in the correct block. The meaning of the 'caught' variable is
- // a little confusing since there are two catchers: the method being
- // tested the the method calling the test. There is probably a better
- // name, but I can't think of it right now.
-
- public void TestThrowOnBlockBoundaries()
- {
- bool caught;
-
- try {
- caught = false;
- ThrowBeforeTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown before try blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtBeginOfTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of try blocks should be caught", !caught);
-
- try {
- caught = false;
- ThrowAtEndOfTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of try blocks should be caught", !caught);
-
- try {
- caught = false;
- ThrowAtBeginOfCatch();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of catch blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtEndOfCatch();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of catch blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtBeginOfFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of finally blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtEndOfFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of finally blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAfterFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown after finally blocks should not be caught", caught);
- }
-
- private static void DoNothing()
- {
- }
-
- private static void ThrowException()
- {
- throw new Exception();
- }
-
- private static void ThrowBeforeTry()
- {
- ThrowException();
- try {
- DoNothing();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtBeginOfTry()
- {
- DoNothing();
- try {
- ThrowException();
- DoNothing();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtEndOfTry()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtBeginOfCatch()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- throw;
- }
- }
-
- private static void ThrowAtEndOfCatch()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- throw;
- }
- }
-
- private static void ThrowAtBeginOfFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- ThrowException();
- DoNothing();
- }
- }
-
- private static void ThrowAtEndOfFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- DoNothing();
- ThrowException();
- }
- }
-
- private static void ThrowAfterFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- DoNothing();
- }
- ThrowException();
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System/GuidTest.cs b/mcs/class/corlib/Test/System/GuidTest.cs
deleted file mode 100755
index e3b19008886..00000000000
--- a/mcs/class/corlib/Test/System/GuidTest.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// GuidTest.cs - NUnit Test Cases for the System.Guid struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class GuidTest : TestCase
-{
- public GuidTest () : base ("MonoTests.System.GuidTest testcase") {}
- public GuidTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (GuidTest));
- }
- }
-
- public void TestCtor1 ()
- {
- Guid g = new Guid (new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f});
- bool exception;
-
- if (BitConverter.IsLittleEndian) {
- AssertEquals ("A1", "03020100-0504-0706-0809-0a0b0c0d0e0f", g.ToString ());
- }
- else {
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ());
- }
-
- try {
- Guid g1 = new Guid ((byte[]) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A2", exception);
-
- try {
- Guid g1 = new Guid (new byte[] {0x00, 0x01, 0x02});
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A3", exception);
- }
-
- public void TestCtor2 ()
- {
- Guid g1 = new Guid ("00010203-0405-0607-0809-0a0b0c0d0e0f");
- Guid g2 = new Guid ("{00010203-0405-0607-0809-0A0B0C0D0E0F}");
- Guid g3 = new Guid ("{0x00010203,0x0405,0x0607,{0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}}");
- Guid g4;
- Guid g5;
-
- bool exception;
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "00010203-0405-0607-0809-0a0b0c0d0e0f", g2.ToString ());
- AssertEquals ("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g3.ToString ());
-
- try {
- g4 = new Guid ((string) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- g5 = new Guid ("invalid");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- }
-
- public void TestCtor4 ()
- {
- Guid g1 = new Guid (0x00010203, (short) 0x0405, (short) 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (unchecked ((int) 0xffffffff), unchecked ((short) 0xffff), unchecked((short) 0xffff), 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString ());
-
- }
-
- public void TestCtor5 ()
- {
- Guid g1 = new Guid (0x00010203u, (ushort) 0x0405u, (ushort) 0x0607u, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0xffffffffu, (ushort) 0xffffu, (ushort) 0xffffu, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString ());
-
- }
-
- public void TestEmpty ()
- {
- AssertEquals ("A1", "00000000-0000-0000-0000-000000000000", Guid.Empty.ToString ());
- }
-
- public void TestNewGuid ()
- {
- Guid g1 = Guid.NewGuid ();
- Guid g2 = Guid.NewGuid ();
-
- Assert ("A1", g1 != g2);
- }
-
- public void TestEqualityOp ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals ("A1", true, g1 == g1);
- AssertEquals ("A2", true, g1 == g2);
- AssertEquals ("A3", false, g1 == g3);
- }
-
- public void TestInequalityOp ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals ("A1", false, g1 != g1);
- AssertEquals ("A2", false, g1 != g2);
- AssertEquals ("A3", true, g1 != g3);
- }
-
- public void TestEquals ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
- string s = "This is not a Guid!";
-
- AssertEquals ("A1", true, g1.Equals (g1));
- AssertEquals ("A2", true, g1.Equals (g2));
- AssertEquals ("A3", false, g1.Equals (g3));
- AssertEquals ("A4", false, g1.Equals (null));
- AssertEquals ("A5", false, g1.Equals (s));
- }
-
- public void TestCompareTo ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010204, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x00010203, 0x0405, 0x0607, 0x09, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g4 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x1f);
- bool exception;
-
- Assert ("A1", g1.CompareTo (g2) < 0);
- Assert ("A2", g1.CompareTo (g3) < 0);
- Assert ("A3", g1.CompareTo (g4) < 0);
- Assert ("A4", g2.CompareTo (g1) > 0);
- Assert ("A5", g3.CompareTo (g1) > 0);
- Assert ("A6", g4.CompareTo (g1) > 0);
- Assert ("A7", g1.CompareTo (g1) == 0);
- Assert ("A8", g1.CompareTo (null) > 0);
-
- try {
- g1.CompareTo ("Say what?");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A9", exception);
- }
-
- public void TestGetHashCode ()
- {
- // We don't test anything but the availibility of this member
- int res = Guid.NewGuid ().GetHashCode ();
-
- Assert ("A1", true);
- }
-
- public void TestToByteArray ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- byte[] b = g1.ToByteArray ();
-
- AssertEquals ("A1", 0x00010203, BitConverter.ToInt32 (b, 0));
- AssertEquals ("A2", (short) 0x0405, BitConverter.ToInt16 (b, 4));
- AssertEquals ("A3", (short) 0x0607, BitConverter.ToInt16 (b, 6));
- for (int i=8; i<16; ++i) {
- AssertEquals ("A1", (byte) i, b [i]);
- }
-
- }
-
- public void TestToString ()
- {
- Guid g = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- bool exception;
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ());
- AssertEquals ("A2", "000102030405060708090a0b0c0d0e0f", g.ToString ("N"));
- AssertEquals ("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ("D"));
- AssertEquals ("A4", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString ("B"));
- AssertEquals ("A5", "(00010203-0405-0607-0809-0a0b0c0d0e0f)", g.ToString ("P"));
- AssertEquals ("A6", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString (""));
- AssertEquals ("A7", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ((string)null));
-
- try {
- g.ToString ("X");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A8", exception);
-
- try {
- g.ToString ("This is invalid");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A9", exception);
-
- AssertEquals ("A10", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString ("B", null));
-
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int16Test.cs b/mcs/class/corlib/Test/System/Int16Test.cs
deleted file mode 100644
index 717b35420b6..00000000000
--- a/mcs/class/corlib/Test/System/Int16Test.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-// Int16Test.cs - NUnit Test Cases for the System.Int16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int16Test : TestCase
-{
- private const Int16 MyInt16_1 = -42;
- private const Int16 MyInt16_2 = -32768;
- private const Int16 MyInt16_3 = 32767;
- private const string MyString1 = "-42";
- private const string MyString2 = "-32768";
- private const string MyString3 = "32767";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null, "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] Results2 = {null, "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,768.00)", "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,767.00000", "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int16Test() : base ("MonoTests.System.Int16Test testcase") {}
- public Int16Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = "("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,768.00)";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,767.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int16.MinValue, MyInt16_2);
- AssertEquals(Int16.MaxValue, MyInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt16_3.CompareTo(MyInt16_2) > 0);
- Assert(MyInt16_2.CompareTo(MyInt16_2) == 0);
- Assert(MyInt16_1.CompareTo((Int16)(-42)) == 0);
- Assert(MyInt16_2.CompareTo(MyInt16_3) < 0);
- try {
- MyInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt16_1.Equals(MyInt16_1));
- Assert(MyInt16_1.Equals((Int16)(-42)));
- Assert(MyInt16_1.Equals((SByte)(-42)) == false);
- Assert(MyInt16_1.Equals(MyInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt16_1.GetHashCode();
- MyInt16_2.GetHashCode();
- MyInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyInt16_1 == Int16.Parse(MyString1));
- Assert(MyInt16_2 == Int16.Parse(MyString2));
- Assert(MyInt16_3 == Int16.Parse(MyString3));
- try {
- Int16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Int16.MaxValue + 1;
- Int16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == Int16.Parse(" $42 ", NumberStyles.Currency));
- try {
- Int16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int16.Parse(" -42 ", Nfi));
- try {
- Int16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert(String.Compare(MyString1, MyInt16_1.ToString()) == 0);
- Assert(String.Compare(MyString2, MyInt16_2.ToString()) == 0);
- Assert(String.Compare(MyString3, MyInt16_3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests are culture sensitive. Need to find a way to determine the culture
- of the system to decide the correct expected result.
- for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(Results1[i], MyInt16_2.ToString(Formats1[i])) == 0);
- Assert(String.Compare(Results2[i], MyInt16_3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MyInt16_2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MyInt16_2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
- Assert("i="+i+", ResultsNfi2[i]="+ResultsNfi2[i]+", MyInt16_3.ToString(Formats2[i]="+Formats2[i]+"): Expected "+ResultsNfi2[i]+" but got "+MyInt16_3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MyInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int32Test.cs b/mcs/class/corlib/Test/System/Int32Test.cs
deleted file mode 100644
index a74247b2d35..00000000000
--- a/mcs/class/corlib/Test/System/Int32Test.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Int32Test.cs - NUnit Test Cases for the System.Int32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int32Test : TestCase
-{
- private const Int32 MyInt32_1 = -42;
- private const Int32 MyInt32_2 = -2147483648;
- private const Int32 MyInt32_3 = 2147483647;
- private const string MyString1 = "-42";
- private const string MyString2 = "-2147483648";
- private const string MyString3 = "2147483647";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null,
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] Results2 = {null,
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,648.00)",
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,647.00000",
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int32Test() : base ("MonoTests.System.Int32Test testcase") {}
- public Int32Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = "("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,648.00)";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,647.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals("#A01", Int32.MinValue, MyInt32_2);
- AssertEquals("#A02", Int32.MaxValue, MyInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert("MyInt32_3.CompareTo(MyInt32_2) > 0", MyInt32_3.CompareTo(MyInt32_2) > 0);
- Assert("MyInt32_2.CompareTo(MyInt32_2) == 0", MyInt32_2.CompareTo(MyInt32_2) == 0);
- Assert("MyInt32_1.CompareTo((Int32)(-42)) == 0", MyInt32_1.CompareTo((Int32)(-42)) == 0);
- Assert("MyInt32_2.CompareTo(MyInt32_3) < 0", MyInt32_2.CompareTo(MyInt32_3) < 0);
- try {
- MyInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("typeof(ArgumentException) == e.GetType()", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert ("#B01", MyInt32_1.Equals (MyInt32_1));
- Assert ("#B02", MyInt32_1.Equals ((Int32)(-42)));
- Assert ("#B03", MyInt32_1.Equals ((SByte)(-42)) == false);
- Assert ("#B04", MyInt32_1.Equals (MyInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt32_1.GetHashCode();
- MyInt32_2.GetHashCode();
- MyInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- AssertEquals ("#C01", MyInt32_1, Int32.Parse (MyString1));
- AssertEquals ("#C02", MyInt32_2, Int32.Parse (MyString2));
- AssertEquals ("#C03", MyInt32_3, Int32.Parse (MyString3));
-
- AssertEquals ("#C04", 1, Int32.Parse ("1"));
- AssertEquals ("#C05", 1, Int32.Parse (" 1"));
- AssertEquals ("#C06", 1, Int32.Parse (" 1"));
- AssertEquals ("#C07", 1, Int32.Parse ("1 "));
- AssertEquals ("#C08", 1, Int32.Parse ("+1"));
- AssertEquals ("#C09", -1, Int32.Parse ("-1"));
- AssertEquals ("#C10", -1, Int32.Parse (" -1"));
- AssertEquals ("#C11", -1, Int32.Parse (" -1 "));
- AssertEquals ("#C12", -1, Int32.Parse (" -1 "));
-
- try {
- Int32.Parse(null);
- Fail ("#C13: Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert ("#C14", typeof (ArgumentNullException) == e.GetType());
- }
- try {
- Int32.Parse("not-a-number");
- Fail ("#C15: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C16", typeof (FormatException) == e.GetType());
- }
- try {
- double OverInt = (double)Int32.MaxValue + 1;
- Int32.Parse(OverInt.ToString());
- Fail ("#C17: Should raise a System.OverflowException");
- }
- catch (Exception e) {
- AssertEquals ("#C18", typeof (OverflowException), e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- AssertEquals ("#C19", 42, Int32.Parse (" $42 ", NumberStyles.Currency));
- try {
- Int32.Parse("$42", NumberStyles.Integer);
- Fail ("#C20: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C21", typeof (FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- AssertEquals ("#C22", -42, Int32.Parse (" -42 ", Nfi));
- try {
- Int32.Parse("%42", Nfi);
- Fail ("#C23: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C24", typeof (FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- AssertEquals ("#C25", 16, Int32.Parse (" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail ("#C26: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("#C27", typeof (FormatException) == e.GetType());
- }
-
- try {
- Int32.Parse (" - 1 ");
- Fail ("#C28: Should raise FormatException");
- } catch (Exception e){
- Assert ("#C29", typeof (FormatException) == e.GetType ());
- }
-
- try {
- Int32.Parse (" - ");
- Fail ("#C30: Should raise FormatException");
- } catch (Exception e){
- Assert ("#C31", typeof (FormatException) == e.GetType ());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals ("#D01", MyString1, MyInt32_1.ToString ());
- AssertEquals ("#D02", MyString2, MyInt32_2.ToString ());
- AssertEquals ("#D03", MyString3, MyInt32_3.ToString ());
-
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals ("#D04(" + i + "," + Formats1 [i] + ")",
- ResultsNfi1 [i], MyInt32_2.ToString (Formats1 [i], Nfi));
- AssertEquals ("#D05(" + i + "," + Formats2 [i] + ")",
- ResultsNfi2 [i], MyInt32_3.ToString (Formats2 [i], Nfi));
- }
-
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals ("#D06(" + i + ")", Results1 [i],
- MyInt32_2.ToString(Formats1[i]));
- AssertEquals ("#D07(" + i + ")", Results2 [i],
- MyInt32_3.ToString(Formats2[i]));
- }
-
- try {
- MyInt32_1.ToString("z");
- Fail ("#D08: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#D09", typeof (FormatException) == e.GetType());
- }
- }
-
- public void TestCustomToString()
- {
- // FIXME: Not yet implemented.
-#if NOTYET
- // culture sensitive?
-
- int i = 123;
-
- AssertEquals ("Custom format string 00000", "00123", i.ToString ("00000"));
- AssertEquals ("Custom format string ####", "123", i.ToString ("####"));
-#endif
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int64Test.cs b/mcs/class/corlib/Test/System/Int64Test.cs
deleted file mode 100644
index 173f8185430..00000000000
--- a/mcs/class/corlib/Test/System/Int64Test.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-// Int64Test.cs - NUnit Test Cases for the System.Int64 struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-// tests ToString and Parse function with the culture independent
-// NumberFormatInfo.InvariantInfo
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
- /// <summary>
- /// Tests for System.Int64
- /// </summary>
-namespace MonoTests.System
-{
-
-public class Int64Test : TestCase
-{
- private const Int64 MyInt64_1 = -42;
- private const Int64 MyInt64_2 = -9223372036854775808;
- private const Int64 MyInt64_3 = 9223372036854775807;
- private const string MyString1 = "-42";
- private const string MyString2 = "-9223372036854775808";
- private const string MyString3 = "9223372036854775807";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] Results2 = {"", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,808.00)", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] ResultsNfi2 = {""+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,807.00000", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
-
- // FIXME: This is failing with an ArgumentException. Seems to be related to the number of elements in the arrary,
- // not the values themselves
-/* private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue,
- 1L, 12L, 123L, 1234L, -123L,
- 1234567890123456L, 6543210987654321L };
-*/
- private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue };
-
- private const long val1 = -1234567L;
- private const long val2 = 1234567L;
- private const string sval1Test1 = " -1,234,567 ";
- private const string sval1Test2 = " -1234567 ";
- //private const string sval1Test3 = " -12345,,,,67 "; // interesting: this case works on SDK Beta2, but the specification says nothing about this case
- private const string sval1Test4 = " -12345 67 ";
- private string sval1Test5 = " -"+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00 ";
- private string sval1Test6 = "("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00)";
- private const string sval1Test7 = "-1,234,567.00";
- private const string sval1UserCur1 = "1234/5/67:000 XYZ-";
- private const string sval2UserCur1 = "1234/5/67:000 XYZ";
- private const string sval1UserPercent1 = "-%%%1~2~3~4~5~6~7~0~0;0";
- private const string sval2UserPercent1 = "%%%1~2~3~4~5~6~7~0~0;0";
- private const NumberStyles style1 = NumberStyles.AllowLeadingWhite | NumberStyles.AllowLeadingSign
- | NumberStyles.AllowTrailingWhite | NumberStyles.AllowThousands;
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
- private NumberFormatInfo NfiUser;
-
- public Int64Test() : base("MonoTests.System.Int64Test") {}
- public Int64Test(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(Int64Test)); }
- }
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- int cdd = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- string csym = NumberFormatInfo.CurrentInfo.CurrencySymbol;
- string csuffix = (cdd > 0 ? "." : "").PadRight(cdd + (cdd > 0 ? 1 : 0), '0');
- Results1[0] = "(" + csym + "9,223,372,036,854,775,808" + csuffix + ")";
- Results2[0] = csym + "9,223,372,036,854,775,807.00000";
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ":";
- NfiUser.CurrencyGroupSeparator = "/";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10; // n $-
- NfiUser.CurrencyPositivePattern = 3; // n $
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int64.MinValue, MyInt64_2);
- AssertEquals(Int64.MaxValue, MyInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt64_3.CompareTo(MyInt64_2) > 0);
- Assert(MyInt64_2.CompareTo(MyInt64_2) == 0);
- Assert(MyInt64_1.CompareTo((Int64)(-42)) == 0);
- Assert(MyInt64_2.CompareTo(MyInt64_3) < 0);
- try {
- MyInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt64_1.Equals(MyInt64_1));
- Assert(MyInt64_1.Equals((Int64)(-42)));
- Assert(MyInt64_1.Equals((SByte)(-42)) == false);
- Assert(MyInt64_1.Equals(MyInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt64_1.GetHashCode();
- MyInt64_2.GetHashCode();
- MyInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestRoundTripGeneral()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString(Nfi);
- long lv2 = Int64.Parse(s);
- Assert(lv == lv2);
- long lv3 = Int64.Parse(s, NumberStyles.Integer, Nfi);
- Assert(lv == lv3);
- }
- }
-
- public void TestRoundTripHex()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString("x", Nfi);
- long lv2 = Int64.Parse(s, NumberStyles.HexNumber, Nfi);
- Assert(lv == lv2);
- }
- }
-
- public void TestParseNull()
- {
- try
- {
- Int64.Parse(null);
- Fail("Should raise System.ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- // ok
- }
- }
-
- public void TestParse()
- {
- long lv;
-
- lv = Int64.Parse(sval1Test1, style1, Nfi);
- AssertEquals("Long value should be equal for Test1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test1, Nfi);
- Fail("Should raise FormatException 1");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test2, style1, Nfi);
- AssertEquals("Value should be the same for Test2 with style1", val1, lv);
- lv = Int64.Parse(sval1Test2, Nfi);
- AssertEquals("Value should be the same for Test2 without style1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test4, style1, Nfi);
- Fail("Should raise FormatException 3");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test5, NumberStyles.Currency, Nfi);
- AssertEquals("Value should be the same for Test5 and currency style", val1, lv);
-
- //test Parse(string s)
- Assert(MyInt64_1 == Int64.Parse(MyString1));
- Assert(MyInt64_2 == Int64.Parse(MyString2));
- Assert(MyInt64_3 == Int64.Parse(MyString3));
- try {
- Int64.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- AssertEquals("A1", (long)42, Int64.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- Int64.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int64.Parse(" -42 ", Nfi));
- try {
- Int64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int64.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- string s;
-
- s = val1.ToString("c", Nfi);
- Assert("val1 does not become sval1Test6", s.Equals(sval1Test6));
-
- s = val1.ToString("n", Nfi);
- AssertEquals("val1 does not become sval1Test7", sval1Test7, s);
-
- //test ToString()
- AssertEquals("MyInt64_1.ToString()", MyString1, MyInt64_1.ToString());
- AssertEquals("MyInt64_2.ToString()", MyString2, MyInt64_2.ToString());
- AssertEquals("MyInt64_3.ToString()", MyString3, MyInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"])", Results1[i], MyInt64_2.ToString(Formats1[i]));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"])", Results2[i], MyInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"], Nfi)", ResultsNfi1[i], MyInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"], Nfi)", ResultsNfi2[i], MyInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- AssertEquals("Exception is wrong type", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestUserCurrency()
- {
- string s= "";
- long v;
- int iTest = 1;
- try {
- s = val1.ToString("c", NfiUser);
- iTest++;
- AssertEquals("Currency value type 1 is not what we want to try to parse", sval1UserCur1, s);
- iTest++;
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- iTest++;
- Assert(v == val1);
- } catch (Exception e) {
- Fail ("1 Unexpected exception at iTest = " + iTest + ", s = " + s + ":e = " + e);
- }
-
- iTest = 1;
- try {
- s = val2.ToString("c", NfiUser);
- iTest++;
- AssertEquals("Currency value type 2 is not what we want to try to parse", sval2UserCur1, s);
- iTest++;
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- iTest++;
- Assert(v == val2);
- } catch (Exception e) {
- Fail ("2 Unexpected exception at iTest = " + iTest + ":e = " + e);
- }
- }
-
- public void TestUserPercent()
- {
- string s;
-
- s = val1.ToString("p", NfiUser);
- Assert(s.Equals(sval1UserPercent1));
-
- s = val2.ToString("p", NfiUser);
- Assert(s.Equals(sval2UserPercent1));
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs b/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
deleted file mode 100644
index 33f352aecf9..00000000000
--- a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
+++ /dev/null
@@ -1,2016 +0,0 @@
-//
-// IntegerFormatterTest.cs - NUnit Test Cases for System.IntegerFormatter
-//
-// Author:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.IO;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class IntegerFormatterTest : TestCase
-{
- private const int INT32 = 0;
- private const int INT64 = 1;
- private const int UINT32 = 2;
- private const int UINT64 = 3;
- private int testType;
-
- public IntegerFormatterTest () :
- base ("[MonoTests.System.IntegerFormatterTest]") {}
-
- public IntegerFormatterTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(IntegerFormatterTest));
- }
- }
-
- public void TestStandard ()
- {
- // Make the test Culture insensitive
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.CurrencySymbol = "$";
-
- StringReader sr = new StringReader (tutti);
-
- string inputLine;
- while ((inputLine = sr.ReadLine ()) != null) {
- if (inputLine.IndexOf ('(') != -1)
- ProcessLine (inputLine, nfi);
- else
- ChangeType (inputLine);
- }
-
- sr.Close ();
- }
-
- private void ProcessLine (string testLine, NumberFormatInfo nfi)
- {
- string number = "0";
- string format = "X";
- string expected = "XXX";
- int idxStart;
- int idxEnd;
-
- idxStart = testLine.IndexOf ('(');
- if (idxStart != -1){
- idxStart++;
- idxEnd = testLine.IndexOf (')');
- number = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- idxStart = testLine.IndexOf ('(', idxStart);
- if (idxStart != -1) {
- idxStart++;
- idxEnd = testLine.IndexOf (')', idxStart);
- format = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- idxStart = testLine.IndexOf ('(', idxStart);
- if (idxStart != -1) {
- idxStart++;
- idxEnd = testLine.LastIndexOf (')');
- expected = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- DoTest (number, format, expected, nfi);
- }
-
- private void DoTest (string number,
- string format,
- string expected,
- NumberFormatInfo nfi)
- {
- string id = number + " " + format;
-
- switch (testType) {
- case INT32:
- int i32 = Int32.Parse (number, nfi);
- AssertEquals(id, expected, i32.ToString (format, nfi));
- break;
- case INT64:
- long i64 = Int64.Parse (number, nfi);
- AssertEquals(id, expected, i64.ToString (format, nfi));
- break;
- case UINT32:
- uint ui32 = UInt32.Parse (number, nfi);
- AssertEquals(id, expected, ui32.ToString (format, nfi));
- break;
- case UINT64:
- ulong ui64 = UInt64.Parse (number, nfi);
- AssertEquals(id, expected, ui64.ToString (format, nfi));
- break;
- }
- }
-
- private void ChangeType (string newType)
- {
- if (newType == "Int32")
- testType = INT32;
- else if (newType == "Int64")
- testType = INT64;
- else if (newType == "UInt32")
- testType = UINT32;
- else if (newType == "UInt64")
- testType = UINT64;
- else throw new Exception ("Test of type '" + newType + "' not supported.");
-
- }
-
- private static string tutti = "Int32\n" +
-"(-2147483648) (C) (($2,147,483,648.00))\n" +
-"(-2147483648) (C0) (($2,147,483,648))\n" +
-"(-2147483648) (C1) (($2,147,483,648.0))\n" +
-"(-2147483648) (C2) (($2,147,483,648.00))\n" +
-"(-2147483648) (C3) (($2,147,483,648.000))\n" +
-"(-2147483648) (C4) (($2,147,483,648.0000))\n" +
-"(-2147483648) (C5) (($2,147,483,648.00000))\n" +
-"(-2147483648) (C6) (($2,147,483,648.000000))\n" +
-"(-2147483648) (C7) (($2,147,483,648.0000000))\n" +
-"(-2147483648) (C8) (($2,147,483,648.00000000))\n" +
-"(-2147483648) (C9) (($2,147,483,648.000000000))\n" +
-"(-2147483648) (C10) (($2,147,483,648.0000000000))\n" +
-"(-2147483648) (C99) (($2,147,483,648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-2147483648) (D) (-2147483648)\n" +
-"(-2147483648) (D0) (-2147483648)\n" +
-"(-2147483648) (D1) (-2147483648)\n" +
-"(-2147483648) (D2) (-2147483648)\n" +
-"(-2147483648) (D3) (-2147483648)\n" +
-"(-2147483648) (D4) (-2147483648)\n" +
-"(-2147483648) (D5) (-2147483648)\n" +
-"(-2147483648) (D6) (-2147483648)\n" +
-"(-2147483648) (D7) (-2147483648)\n" +
-"(-2147483648) (D8) (-2147483648)\n" +
-"(-2147483648) (D9) (-2147483648)\n" +
-"(-2147483648) (D10) (-2147483648)\n" +
-"(-2147483648) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002147483648)\n" +
-"(-2147483648) (E) (-2.147484E+009)\n" +
-"(-2147483648) (E0) (-2E+009)\n" +
-"(-2147483648) (E1) (-2.1E+009)\n" +
-"(-2147483648) (E2) (-2.15E+009)\n" +
-"(-2147483648) (E3) (-2.147E+009)\n" +
-"(-2147483648) (E4) (-2.1475E+009)\n" +
-"(-2147483648) (E5) (-2.14748E+009)\n" +
-"(-2147483648) (E6) (-2.147484E+009)\n" +
-"(-2147483648) (E7) (-2.1474836E+009)\n" +
-"(-2147483648) (E8) (-2.14748365E+009)\n" +
-"(-2147483648) (E9) (-2.147483648E+009)\n" +
-"(-2147483648) (E10) (-2.1474836480E+009)\n" +
-"(-2147483648) (E99) (-2.147483648000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(-2147483648) (F) (-2147483648.00)\n" +
-"(-2147483648) (F0) (-2147483648)\n" +
-"(-2147483648) (F1) (-2147483648.0)\n" +
-"(-2147483648) (F2) (-2147483648.00)\n" +
-"(-2147483648) (F3) (-2147483648.000)\n" +
-"(-2147483648) (F4) (-2147483648.0000)\n" +
-"(-2147483648) (F5) (-2147483648.00000)\n" +
-"(-2147483648) (F6) (-2147483648.000000)\n" +
-"(-2147483648) (F7) (-2147483648.0000000)\n" +
-"(-2147483648) (F8) (-2147483648.00000000)\n" +
-"(-2147483648) (F9) (-2147483648.000000000)\n" +
-"(-2147483648) (F10) (-2147483648.0000000000)\n" +
-"(-2147483648) (F99) (-2147483648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-2147483648) (G) (-2147483648)\n" +
-"(-2147483648) (G0) (-2147483648)\n" +
-"(-2147483648) (G1) (-2E+09)\n" +
-"(-2147483648) (G2) (-2.1E+09)\n" +
-"(-2147483648) (G3) (-2.15E+09)\n" +
-"(-2147483648) (G4) (-2.147E+09)\n" +
-"(-2147483648) (G5) (-2.1475E+09)\n" +
-"(-2147483648) (G6) (-2.14748E+09)\n" +
-"(-2147483648) (G7) (-2.147484E+09)\n" +
-"(-2147483648) (G8) (-2.1474836E+09)\n" +
-"(-2147483648) (G9) (-2.14748365E+09)\n" +
-"(-2147483648) (G10) (-2147483648)\n" +
-"(-2147483648) (G99) (-2147483648)\n" +
-"(-2147483648) (N) (-2,147,483,648.00)\n" +
-"(-2147483648) (N0) (-2,147,483,648)\n" +
-"(-2147483648) (N1) (-2,147,483,648.0)\n" +
-"(-2147483648) (N2) (-2,147,483,648.00)\n" +
-"(-2147483648) (N3) (-2,147,483,648.000)\n" +
-"(-2147483648) (N4) (-2,147,483,648.0000)\n" +
-"(-2147483648) (N5) (-2,147,483,648.00000)\n" +
-"(-2147483648) (N6) (-2,147,483,648.000000)\n" +
-"(-2147483648) (N7) (-2,147,483,648.0000000)\n" +
-"(-2147483648) (N8) (-2,147,483,648.00000000)\n" +
-"(-2147483648) (N9) (-2,147,483,648.000000000)\n" +
-"(-2147483648) (N10) (-2,147,483,648.0000000000)\n" +
-"(-2147483648) (N99) (-2,147,483,648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-2147483648) (P) (-214,748,364,800.00 %)\n" +
-"(-2147483648) (P0) (-214,748,364,800 %)\n" +
-"(-2147483648) (P1) (-214,748,364,800.0 %)\n" +
-"(-2147483648) (P2) (-214,748,364,800.00 %)\n" +
-"(-2147483648) (P3) (-214,748,364,800.000 %)\n" +
-"(-2147483648) (P4) (-214,748,364,800.0000 %)\n" +
-"(-2147483648) (P5) (-214,748,364,800.00000 %)\n" +
-"(-2147483648) (P6) (-214,748,364,800.000000 %)\n" +
-"(-2147483648) (P7) (-214,748,364,800.0000000 %)\n" +
-"(-2147483648) (P8) (-214,748,364,800.00000000 %)\n" +
-"(-2147483648) (P9) (-214,748,364,800.000000000 %)\n" +
-"(-2147483648) (P10) (-214,748,364,800.0000000000 %)\n" +
-"(-2147483648) (P99) (-214,748,364,800.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-2147483648) (X) (80000000)\n" +
-"(-2147483648) (X0) (80000000)\n" +
-"(-2147483648) (X1) (80000000)\n" +
-"(-2147483648) (X2) (80000000)\n" +
-"(-2147483648) (X3) (80000000)\n" +
-"(-2147483648) (X4) (80000000)\n" +
-"(-2147483648) (X5) (80000000)\n" +
-"(-2147483648) (X6) (80000000)\n" +
-"(-2147483648) (X7) (80000000)\n" +
-"(-2147483648) (X8) (80000000)\n" +
-"(-2147483648) (X9) (080000000)\n" +
-"(-2147483648) (X10) (0080000000)\n" +
-"(-2147483648) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000)\n" +
-"(2147483647) (C) ($2,147,483,647.00)\n" +
-"(2147483647) (C0) ($2,147,483,647)\n" +
-"(2147483647) (C1) ($2,147,483,647.0)\n" +
-"(2147483647) (C2) ($2,147,483,647.00)\n" +
-"(2147483647) (C3) ($2,147,483,647.000)\n" +
-"(2147483647) (C4) ($2,147,483,647.0000)\n" +
-"(2147483647) (C5) ($2,147,483,647.00000)\n" +
-"(2147483647) (C6) ($2,147,483,647.000000)\n" +
-"(2147483647) (C7) ($2,147,483,647.0000000)\n" +
-"(2147483647) (C8) ($2,147,483,647.00000000)\n" +
-"(2147483647) (C9) ($2,147,483,647.000000000)\n" +
-"(2147483647) (C10) ($2,147,483,647.0000000000)\n" +
-"(2147483647) (C99) ($2,147,483,647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (D) (2147483647)\n" +
-"(2147483647) (D0) (2147483647)\n" +
-"(2147483647) (D1) (2147483647)\n" +
-"(2147483647) (D2) (2147483647)\n" +
-"(2147483647) (D3) (2147483647)\n" +
-"(2147483647) (D4) (2147483647)\n" +
-"(2147483647) (D5) (2147483647)\n" +
-"(2147483647) (D6) (2147483647)\n" +
-"(2147483647) (D7) (2147483647)\n" +
-"(2147483647) (D8) (2147483647)\n" +
-"(2147483647) (D9) (2147483647)\n" +
-"(2147483647) (D10) (2147483647)\n" +
-"(2147483647) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002147483647)\n" +
-"(2147483647) (E) (2.147484E+009)\n" +
-"(2147483647) (E0) (2E+009)\n" +
-"(2147483647) (E1) (2.1E+009)\n" +
-"(2147483647) (E2) (2.15E+009)\n" +
-"(2147483647) (E3) (2.147E+009)\n" +
-"(2147483647) (E4) (2.1475E+009)\n" +
-"(2147483647) (E5) (2.14748E+009)\n" +
-"(2147483647) (E6) (2.147484E+009)\n" +
-"(2147483647) (E7) (2.1474836E+009)\n" +
-"(2147483647) (E8) (2.14748365E+009)\n" +
-"(2147483647) (E9) (2.147483647E+009)\n" +
-"(2147483647) (E10) (2.1474836470E+009)\n" +
-"(2147483647) (E99) (2.147483647000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(2147483647) (F) (2147483647.00)\n" +
-"(2147483647) (F0) (2147483647)\n" +
-"(2147483647) (F1) (2147483647.0)\n" +
-"(2147483647) (F2) (2147483647.00)\n" +
-"(2147483647) (F3) (2147483647.000)\n" +
-"(2147483647) (F4) (2147483647.0000)\n" +
-"(2147483647) (F5) (2147483647.00000)\n" +
-"(2147483647) (F6) (2147483647.000000)\n" +
-"(2147483647) (F7) (2147483647.0000000)\n" +
-"(2147483647) (F8) (2147483647.00000000)\n" +
-"(2147483647) (F9) (2147483647.000000000)\n" +
-"(2147483647) (F10) (2147483647.0000000000)\n" +
-"(2147483647) (F99) (2147483647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (G) (2147483647)\n" +
-"(2147483647) (G0) (2147483647)\n" +
-"(2147483647) (G1) (2E+09)\n" +
-"(2147483647) (G2) (2.1E+09)\n" +
-"(2147483647) (G3) (2.15E+09)\n" +
-"(2147483647) (G4) (2.147E+09)\n" +
-"(2147483647) (G5) (2.1475E+09)\n" +
-"(2147483647) (G6) (2.14748E+09)\n" +
-"(2147483647) (G7) (2.147484E+09)\n" +
-"(2147483647) (G8) (2.1474836E+09)\n" +
-"(2147483647) (G9) (2.14748365E+09)\n" +
-"(2147483647) (G10) (2147483647)\n" +
-"(2147483647) (G99) (2147483647)\n" +
-"(2147483647) (N) (2,147,483,647.00)\n" +
-"(2147483647) (N0) (2,147,483,647)\n" +
-"(2147483647) (N1) (2,147,483,647.0)\n" +
-"(2147483647) (N2) (2,147,483,647.00)\n" +
-"(2147483647) (N3) (2,147,483,647.000)\n" +
-"(2147483647) (N4) (2,147,483,647.0000)\n" +
-"(2147483647) (N5) (2,147,483,647.00000)\n" +
-"(2147483647) (N6) (2,147,483,647.000000)\n" +
-"(2147483647) (N7) (2,147,483,647.0000000)\n" +
-"(2147483647) (N8) (2,147,483,647.00000000)\n" +
-"(2147483647) (N9) (2,147,483,647.000000000)\n" +
-"(2147483647) (N10) (2,147,483,647.0000000000)\n" +
-"(2147483647) (N99) (2,147,483,647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (P) (214,748,364,700.00 %)\n" +
-"(2147483647) (P0) (214,748,364,700 %)\n" +
-"(2147483647) (P1) (214,748,364,700.0 %)\n" +
-"(2147483647) (P2) (214,748,364,700.00 %)\n" +
-"(2147483647) (P3) (214,748,364,700.000 %)\n" +
-"(2147483647) (P4) (214,748,364,700.0000 %)\n" +
-"(2147483647) (P5) (214,748,364,700.00000 %)\n" +
-"(2147483647) (P6) (214,748,364,700.000000 %)\n" +
-"(2147483647) (P7) (214,748,364,700.0000000 %)\n" +
-"(2147483647) (P8) (214,748,364,700.00000000 %)\n" +
-"(2147483647) (P9) (214,748,364,700.000000000 %)\n" +
-"(2147483647) (P10) (214,748,364,700.0000000000 %)\n" +
-"(2147483647) (P99) (214,748,364,700.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(2147483647) (X) (7FFFFFFF)\n" +
-"(2147483647) (X0) (7FFFFFFF)\n" +
-"(2147483647) (X1) (7FFFFFFF)\n" +
-"(2147483647) (X2) (7FFFFFFF)\n" +
-"(2147483647) (X3) (7FFFFFFF)\n" +
-"(2147483647) (X4) (7FFFFFFF)\n" +
-"(2147483647) (X5) (7FFFFFFF)\n" +
-"(2147483647) (X6) (7FFFFFFF)\n" +
-"(2147483647) (X7) (7FFFFFFF)\n" +
-"(2147483647) (X8) (7FFFFFFF)\n" +
-"(2147483647) (X9) (07FFFFFFF)\n" +
-"(2147483647) (X10) (007FFFFFFF)\n" +
-"(2147483647) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (C) (($100.00))\n" +
-"(-100) (C0) (($100))\n" +
-"(-100) (C1) (($100.0))\n" +
-"(-100) (C2) (($100.00))\n" +
-"(-100) (C3) (($100.000))\n" +
-"(-100) (C4) (($100.0000))\n" +
-"(-100) (C5) (($100.00000))\n" +
-"(-100) (C6) (($100.000000))\n" +
-"(-100) (C7) (($100.0000000))\n" +
-"(-100) (C8) (($100.00000000))\n" +
-"(-100) (C9) (($100.000000000))\n" +
-"(-100) (C10) (($100.0000000000))\n" +
-"(-100) (C99) (($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-100) (D) (-100)\n" +
-"(-100) (D0) (-100)\n" +
-"(-100) (D1) (-100)\n" +
-"(-100) (D2) (-100)\n" +
-"(-100) (D3) (-100)\n" +
-"(-100) (D4) (-0100)\n" +
-"(-100) (D5) (-00100)\n" +
-"(-100) (D6) (-000100)\n" +
-"(-100) (D7) (-0000100)\n" +
-"(-100) (D8) (-00000100)\n" +
-"(-100) (D9) (-000000100)\n" +
-"(-100) (D10) (-0000000100)\n" +
-"(-100) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(-100) (E) (-1.000000E+002)\n" +
-"(-100) (E0) (-1E+002)\n" +
-"(-100) (E1) (-1.0E+002)\n" +
-"(-100) (E2) (-1.00E+002)\n" +
-"(-100) (E3) (-1.000E+002)\n" +
-"(-100) (E4) (-1.0000E+002)\n" +
-"(-100) (E5) (-1.00000E+002)\n" +
-"(-100) (E6) (-1.000000E+002)\n" +
-"(-100) (E7) (-1.0000000E+002)\n" +
-"(-100) (E8) (-1.00000000E+002)\n" +
-"(-100) (E9) (-1.000000000E+002)\n" +
-"(-100) (E10) (-1.0000000000E+002)\n" +
-"(-100) (E99) (-1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(-100) (F) (-100.00)\n" +
-"(-100) (F0) (-100)\n" +
-"(-100) (F1) (-100.0)\n" +
-"(-100) (F2) (-100.00)\n" +
-"(-100) (F3) (-100.000)\n" +
-"(-100) (F4) (-100.0000)\n" +
-"(-100) (F5) (-100.00000)\n" +
-"(-100) (F6) (-100.000000)\n" +
-"(-100) (F7) (-100.0000000)\n" +
-"(-100) (F8) (-100.00000000)\n" +
-"(-100) (F9) (-100.000000000)\n" +
-"(-100) (F10) (-100.0000000000)\n" +
-"(-100) (F99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (G) (-100)\n" +
-"(-100) (G0) (-100)\n" +
-"(-100) (G1) (-1E+02)\n" +
-"(-100) (G2) (-1E+02)\n" +
-"(-100) (G3) (-100)\n" +
-"(-100) (G4) (-100)\n" +
-"(-100) (G5) (-100)\n" +
-"(-100) (G6) (-100)\n" +
-"(-100) (G7) (-100)\n" +
-"(-100) (G8) (-100)\n" +
-"(-100) (G9) (-100)\n" +
-"(-100) (G10) (-100)\n" +
-"(-100) (G99) (-100)\n" +
-"(-100) (N) (-100.00)\n" +
-"(-100) (N0) (-100)\n" +
-"(-100) (N1) (-100.0)\n" +
-"(-100) (N2) (-100.00)\n" +
-"(-100) (N3) (-100.000)\n" +
-"(-100) (N4) (-100.0000)\n" +
-"(-100) (N5) (-100.00000)\n" +
-"(-100) (N6) (-100.000000)\n" +
-"(-100) (N7) (-100.0000000)\n" +
-"(-100) (N8) (-100.00000000)\n" +
-"(-100) (N9) (-100.000000000)\n" +
-"(-100) (N10) (-100.0000000000)\n" +
-"(-100) (N99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (P) (-10,000.00 %)\n" +
-"(-100) (P0) (-10,000 %)\n" +
-"(-100) (P1) (-10,000.0 %)\n" +
-"(-100) (P2) (-10,000.00 %)\n" +
-"(-100) (P3) (-10,000.000 %)\n" +
-"(-100) (P4) (-10,000.0000 %)\n" +
-"(-100) (P5) (-10,000.00000 %)\n" +
-"(-100) (P6) (-10,000.000000 %)\n" +
-"(-100) (P7) (-10,000.0000000 %)\n" +
-"(-100) (P8) (-10,000.00000000 %)\n" +
-"(-100) (P9) (-10,000.000000000 %)\n" +
-"(-100) (P10) (-10,000.0000000000 %)\n" +
-"(-100) (P99) (-10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-100) (X) (FFFFFF9C)\n" +
-"(-100) (X0) (FFFFFF9C)\n" +
-"(-100) (X1) (FFFFFF9C)\n" +
-"(-100) (X2) (FFFFFF9C)\n" +
-"(-100) (X3) (FFFFFF9C)\n" +
-"(-100) (X4) (FFFFFF9C)\n" +
-"(-100) (X5) (FFFFFF9C)\n" +
-"(-100) (X6) (FFFFFF9C)\n" +
-"(-100) (X7) (FFFFFF9C)\n" +
-"(-100) (X8) (FFFFFF9C)\n" +
-"(-100) (X9) (0FFFFFF9C)\n" +
-"(-100) (X10) (00FFFFFF9C)\n" +
-"(-100) (X99) (0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFF9C)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"Int64\n" +
-"(-9223372036854775808) (C) (($9,223,372,036,854,775,808.00))\n" +
-"(-9223372036854775808) (C0) (($9,223,372,036,854,775,808))\n" +
-"(-9223372036854775808) (C1) (($9,223,372,036,854,775,808.0))\n" +
-"(-9223372036854775808) (C2) (($9,223,372,036,854,775,808.00))\n" +
-"(-9223372036854775808) (C3) (($9,223,372,036,854,775,808.000))\n" +
-"(-9223372036854775808) (C4) (($9,223,372,036,854,775,808.0000))\n" +
-"(-9223372036854775808) (C5) (($9,223,372,036,854,775,808.00000))\n" +
-"(-9223372036854775808) (C6) (($9,223,372,036,854,775,808.000000))\n" +
-"(-9223372036854775808) (C7) (($9,223,372,036,854,775,808.0000000))\n" +
-"(-9223372036854775808) (C8) (($9,223,372,036,854,775,808.00000000))\n" +
-"(-9223372036854775808) (C9) (($9,223,372,036,854,775,808.000000000))\n" +
-"(-9223372036854775808) (C10) (($9,223,372,036,854,775,808.0000000000))\n" +
-"(-9223372036854775808) (C99) (($9,223,372,036,854,775,808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-9223372036854775808) (D) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D1) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D2) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D3) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D4) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D5) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D6) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D7) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D8) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D9) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D10) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000009223372036854775808)\n" +
-"(-9223372036854775808) (E) (-9.223372E+018)\n" +
-"(-9223372036854775808) (E0) (-9E+018)\n" +
-"(-9223372036854775808) (E1) (-9.2E+018)\n" +
-"(-9223372036854775808) (E2) (-9.22E+018)\n" +
-"(-9223372036854775808) (E3) (-9.223E+018)\n" +
-"(-9223372036854775808) (E4) (-9.2234E+018)\n" +
-"(-9223372036854775808) (E5) (-9.22337E+018)\n" +
-"(-9223372036854775808) (E6) (-9.223372E+018)\n" +
-"(-9223372036854775808) (E7) (-9.2233720E+018)\n" +
-"(-9223372036854775808) (E8) (-9.22337204E+018)\n" +
-"(-9223372036854775808) (E9) (-9.223372037E+018)\n" +
-"(-9223372036854775808) (E10) (-9.2233720369E+018)\n" +
-"(-9223372036854775808) (E99) (-9.223372036854775808000000000000000000000000000000000000000000000000000000000000000000000000000000000E+018)\n" +
-"(-9223372036854775808) (F) (-9223372036854775808.00)\n" +
-"(-9223372036854775808) (F0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (F1) (-9223372036854775808.0)\n" +
-"(-9223372036854775808) (F2) (-9223372036854775808.00)\n" +
-"(-9223372036854775808) (F3) (-9223372036854775808.000)\n" +
-"(-9223372036854775808) (F4) (-9223372036854775808.0000)\n" +
-"(-9223372036854775808) (F5) (-9223372036854775808.00000)\n" +
-"(-9223372036854775808) (F6) (-9223372036854775808.000000)\n" +
-"(-9223372036854775808) (F7) (-9223372036854775808.0000000)\n" +
-"(-9223372036854775808) (F8) (-9223372036854775808.00000000)\n" +
-"(-9223372036854775808) (F9) (-9223372036854775808.000000000)\n" +
-"(-9223372036854775808) (F10) (-9223372036854775808.0000000000)\n" +
-"(-9223372036854775808) (F99) (-9223372036854775808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-9223372036854775808) (G) (-9223372036854775808)\n" +
-"(-9223372036854775808) (G0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (G1) (-9E+18)\n" +
-"(-9223372036854775808) (G2) (-9.2E+18)\n" +
-"(-9223372036854775808) (G3) (-9.22E+18)\n" +
-"(-9223372036854775808) (G4) (-9.223E+18)\n" +
-"(-9223372036854775808) (G5) (-9.2234E+18)\n" +
-"(-9223372036854775808) (G6) (-9.22337E+18)\n" +
-"(-9223372036854775808) (G7) (-9.223372E+18)\n" +
-"(-9223372036854775808) (G8) (-9.223372E+18)\n" +
-"(-9223372036854775808) (G9) (-9.22337204E+18)\n" +
-"(-9223372036854775808) (G10) (-9.223372037E+18)\n" +
-"(-9223372036854775808) (G99) (-9223372036854775808)\n" +
-"(-9223372036854775808) (N) (-9,223,372,036,854,775,808.00)\n" +
-"(-9223372036854775808) (N0) (-9,223,372,036,854,775,808)\n" +
-"(-9223372036854775808) (N1) (-9,223,372,036,854,775,808.0)\n" +
-"(-9223372036854775808) (N2) (-9,223,372,036,854,775,808.00)\n" +
-"(-9223372036854775808) (N3) (-9,223,372,036,854,775,808.000)\n" +
-"(-9223372036854775808) (N4) (-9,223,372,036,854,775,808.0000)\n" +
-"(-9223372036854775808) (N5) (-9,223,372,036,854,775,808.00000)\n" +
-"(-9223372036854775808) (N6) (-9,223,372,036,854,775,808.000000)\n" +
-"(-9223372036854775808) (N7) (-9,223,372,036,854,775,808.0000000)\n" +
-"(-9223372036854775808) (N8) (-9,223,372,036,854,775,808.00000000)\n" +
-"(-9223372036854775808) (N9) (-9,223,372,036,854,775,808.000000000)\n" +
-"(-9223372036854775808) (N10) (-9,223,372,036,854,775,808.0000000000)\n" +
-"(-9223372036854775808) (N99) (-9,223,372,036,854,775,808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-9223372036854775808) (P) (-922,337,203,685,477,580,800.00 %)\n" +
-"(-9223372036854775808) (P0) (-922,337,203,685,477,580,800 %)\n" +
-"(-9223372036854775808) (P1) (-922,337,203,685,477,580,800.0 %)\n" +
-"(-9223372036854775808) (P2) (-922,337,203,685,477,580,800.00 %)\n" +
-"(-9223372036854775808) (P3) (-922,337,203,685,477,580,800.000 %)\n" +
-"(-9223372036854775808) (P4) (-922,337,203,685,477,580,800.0000 %)\n" +
-"(-9223372036854775808) (P5) (-922,337,203,685,477,580,800.00000 %)\n" +
-"(-9223372036854775808) (P6) (-922,337,203,685,477,580,800.000000 %)\n" +
-"(-9223372036854775808) (P7) (-922,337,203,685,477,580,800.0000000 %)\n" +
-"(-9223372036854775808) (P8) (-922,337,203,685,477,580,800.00000000 %)\n" +
-"(-9223372036854775808) (P9) (-922,337,203,685,477,580,800.000000000 %)\n" +
-"(-9223372036854775808) (P10) (-922,337,203,685,477,580,800.0000000000 %)\n" +
-"(-9223372036854775808) (P99) (-922,337,203,685,477,580,800.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-9223372036854775808) (X) (8000000000000000)\n" +
-"(-9223372036854775808) (X0) (8000000000000000)\n" +
-"(-9223372036854775808) (X1) (8000000000000000)\n" +
-"(-9223372036854775808) (X2) (8000000000000000)\n" +
-"(-9223372036854775808) (X3) (8000000000000000)\n" +
-"(-9223372036854775808) (X4) (8000000000000000)\n" +
-"(-9223372036854775808) (X5) (8000000000000000)\n" +
-"(-9223372036854775808) (X6) (8000000000000000)\n" +
-"(-9223372036854775808) (X7) (8000000000000000)\n" +
-"(-9223372036854775808) (X8) (8000000000000000)\n" +
-"(-9223372036854775808) (X9) (8000000000000000)\n" +
-"(-9223372036854775808) (X10) (8000000000000000)\n" +
-"(-9223372036854775808) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000)\n" +
-"(9223372036854775807) (C) ($9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (C0) ($9,223,372,036,854,775,807)\n" +
-"(9223372036854775807) (C1) ($9,223,372,036,854,775,807.0)\n" +
-"(9223372036854775807) (C2) ($9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (C3) ($9,223,372,036,854,775,807.000)\n" +
-"(9223372036854775807) (C4) ($9,223,372,036,854,775,807.0000)\n" +
-"(9223372036854775807) (C5) ($9,223,372,036,854,775,807.00000)\n" +
-"(9223372036854775807) (C6) ($9,223,372,036,854,775,807.000000)\n" +
-"(9223372036854775807) (C7) ($9,223,372,036,854,775,807.0000000)\n" +
-"(9223372036854775807) (C8) ($9,223,372,036,854,775,807.00000000)\n" +
-"(9223372036854775807) (C9) ($9,223,372,036,854,775,807.000000000)\n" +
-"(9223372036854775807) (C10) ($9,223,372,036,854,775,807.0000000000)\n" +
-"(9223372036854775807) (C99) ($9,223,372,036,854,775,807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (D) (9223372036854775807)\n" +
-"(9223372036854775807) (D0) (9223372036854775807)\n" +
-"(9223372036854775807) (D1) (9223372036854775807)\n" +
-"(9223372036854775807) (D2) (9223372036854775807)\n" +
-"(9223372036854775807) (D3) (9223372036854775807)\n" +
-"(9223372036854775807) (D4) (9223372036854775807)\n" +
-"(9223372036854775807) (D5) (9223372036854775807)\n" +
-"(9223372036854775807) (D6) (9223372036854775807)\n" +
-"(9223372036854775807) (D7) (9223372036854775807)\n" +
-"(9223372036854775807) (D8) (9223372036854775807)\n" +
-"(9223372036854775807) (D9) (9223372036854775807)\n" +
-"(9223372036854775807) (D10) (9223372036854775807)\n" +
-"(9223372036854775807) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000009223372036854775807)\n" +
-"(9223372036854775807) (E) (9.223372E+018)\n" +
-"(9223372036854775807) (E0) (9E+018)\n" +
-"(9223372036854775807) (E1) (9.2E+018)\n" +
-"(9223372036854775807) (E2) (9.22E+018)\n" +
-"(9223372036854775807) (E3) (9.223E+018)\n" +
-"(9223372036854775807) (E4) (9.2234E+018)\n" +
-"(9223372036854775807) (E5) (9.22337E+018)\n" +
-"(9223372036854775807) (E6) (9.223372E+018)\n" +
-"(9223372036854775807) (E7) (9.2233720E+018)\n" +
-"(9223372036854775807) (E8) (9.22337204E+018)\n" +
-"(9223372036854775807) (E9) (9.223372037E+018)\n" +
-"(9223372036854775807) (E10) (9.2233720369E+018)\n" +
-"(9223372036854775807) (E99) (9.223372036854775807000000000000000000000000000000000000000000000000000000000000000000000000000000000E+018)\n" +
-"(9223372036854775807) (F) (9223372036854775807.00)\n" +
-"(9223372036854775807) (F0) (9223372036854775807)\n" +
-"(9223372036854775807) (F1) (9223372036854775807.0)\n" +
-"(9223372036854775807) (F2) (9223372036854775807.00)\n" +
-"(9223372036854775807) (F3) (9223372036854775807.000)\n" +
-"(9223372036854775807) (F4) (9223372036854775807.0000)\n" +
-"(9223372036854775807) (F5) (9223372036854775807.00000)\n" +
-"(9223372036854775807) (F6) (9223372036854775807.000000)\n" +
-"(9223372036854775807) (F7) (9223372036854775807.0000000)\n" +
-"(9223372036854775807) (F8) (9223372036854775807.00000000)\n" +
-"(9223372036854775807) (F9) (9223372036854775807.000000000)\n" +
-"(9223372036854775807) (F10) (9223372036854775807.0000000000)\n" +
-"(9223372036854775807) (F99) (9223372036854775807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (G) (9223372036854775807)\n" +
-"(9223372036854775807) (G0) (9223372036854775807)\n" +
-"(9223372036854775807) (G1) (9E+18)\n" +
-"(9223372036854775807) (G2) (9.2E+18)\n" +
-"(9223372036854775807) (G3) (9.22E+18)\n" +
-"(9223372036854775807) (G4) (9.223E+18)\n" +
-"(9223372036854775807) (G5) (9.2234E+18)\n" +
-"(9223372036854775807) (G6) (9.22337E+18)\n" +
-"(9223372036854775807) (G7) (9.223372E+18)\n" +
-"(9223372036854775807) (G8) (9.223372E+18)\n" +
-"(9223372036854775807) (G9) (9.22337204E+18)\n" +
-"(9223372036854775807) (G10) (9.223372037E+18)\n" +
-"(9223372036854775807) (G99) (9223372036854775807)\n" +
-"(9223372036854775807) (N) (9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (N0) (9,223,372,036,854,775,807)\n" +
-"(9223372036854775807) (N1) (9,223,372,036,854,775,807.0)\n" +
-"(9223372036854775807) (N2) (9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (N3) (9,223,372,036,854,775,807.000)\n" +
-"(9223372036854775807) (N4) (9,223,372,036,854,775,807.0000)\n" +
-"(9223372036854775807) (N5) (9,223,372,036,854,775,807.00000)\n" +
-"(9223372036854775807) (N6) (9,223,372,036,854,775,807.000000)\n" +
-"(9223372036854775807) (N7) (9,223,372,036,854,775,807.0000000)\n" +
-"(9223372036854775807) (N8) (9,223,372,036,854,775,807.00000000)\n" +
-"(9223372036854775807) (N9) (9,223,372,036,854,775,807.000000000)\n" +
-"(9223372036854775807) (N10) (9,223,372,036,854,775,807.0000000000)\n" +
-"(9223372036854775807) (N99) (9,223,372,036,854,775,807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (P) (922,337,203,685,477,580,700.00 %)\n" +
-"(9223372036854775807) (P0) (922,337,203,685,477,580,700 %)\n" +
-"(9223372036854775807) (P1) (922,337,203,685,477,580,700.0 %)\n" +
-"(9223372036854775807) (P2) (922,337,203,685,477,580,700.00 %)\n" +
-"(9223372036854775807) (P3) (922,337,203,685,477,580,700.000 %)\n" +
-"(9223372036854775807) (P4) (922,337,203,685,477,580,700.0000 %)\n" +
-"(9223372036854775807) (P5) (922,337,203,685,477,580,700.00000 %)\n" +
-"(9223372036854775807) (P6) (922,337,203,685,477,580,700.000000 %)\n" +
-"(9223372036854775807) (P7) (922,337,203,685,477,580,700.0000000 %)\n" +
-"(9223372036854775807) (P8) (922,337,203,685,477,580,700.00000000 %)\n" +
-"(9223372036854775807) (P9) (922,337,203,685,477,580,700.000000000 %)\n" +
-"(9223372036854775807) (P10) (922,337,203,685,477,580,700.0000000000 %)\n" +
-"(9223372036854775807) (P99) (922,337,203,685,477,580,700.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(9223372036854775807) (X) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X0) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X1) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X2) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X3) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X4) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X5) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X6) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X7) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X8) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X9) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X10) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFFFFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (C) (($100.00))\n" +
-"(-100) (C0) (($100))\n" +
-"(-100) (C1) (($100.0))\n" +
-"(-100) (C2) (($100.00))\n" +
-"(-100) (C3) (($100.000))\n" +
-"(-100) (C4) (($100.0000))\n" +
-"(-100) (C5) (($100.00000))\n" +
-"(-100) (C6) (($100.000000))\n" +
-"(-100) (C7) (($100.0000000))\n" +
-"(-100) (C8) (($100.00000000))\n" +
-"(-100) (C9) (($100.000000000))\n" +
-"(-100) (C10) (($100.0000000000))\n" +
-"(-100) (C99) (($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-100) (D) (-100)\n" +
-"(-100) (D0) (-100)\n" +
-"(-100) (D1) (-100)\n" +
-"(-100) (D2) (-100)\n" +
-"(-100) (D3) (-100)\n" +
-"(-100) (D4) (-0100)\n" +
-"(-100) (D5) (-00100)\n" +
-"(-100) (D6) (-000100)\n" +
-"(-100) (D7) (-0000100)\n" +
-"(-100) (D8) (-00000100)\n" +
-"(-100) (D9) (-000000100)\n" +
-"(-100) (D10) (-0000000100)\n" +
-"(-100) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(-100) (E) (-1.000000E+002)\n" +
-"(-100) (E0) (-1E+002)\n" +
-"(-100) (E1) (-1.0E+002)\n" +
-"(-100) (E2) (-1.00E+002)\n" +
-"(-100) (E3) (-1.000E+002)\n" +
-"(-100) (E4) (-1.0000E+002)\n" +
-"(-100) (E5) (-1.00000E+002)\n" +
-"(-100) (E6) (-1.000000E+002)\n" +
-"(-100) (E7) (-1.0000000E+002)\n" +
-"(-100) (E8) (-1.00000000E+002)\n" +
-"(-100) (E9) (-1.000000000E+002)\n" +
-"(-100) (E10) (-1.0000000000E+002)\n" +
-"(-100) (E99) (-1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(-100) (F) (-100.00)\n" +
-"(-100) (F0) (-100)\n" +
-"(-100) (F1) (-100.0)\n" +
-"(-100) (F2) (-100.00)\n" +
-"(-100) (F3) (-100.000)\n" +
-"(-100) (F4) (-100.0000)\n" +
-"(-100) (F5) (-100.00000)\n" +
-"(-100) (F6) (-100.000000)\n" +
-"(-100) (F7) (-100.0000000)\n" +
-"(-100) (F8) (-100.00000000)\n" +
-"(-100) (F9) (-100.000000000)\n" +
-"(-100) (F10) (-100.0000000000)\n" +
-"(-100) (F99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (G) (-100)\n" +
-"(-100) (G0) (-100)\n" +
-"(-100) (G1) (-1E+02)\n" +
-"(-100) (G2) (-1E+02)\n" +
-"(-100) (G3) (-100)\n" +
-"(-100) (G4) (-100)\n" +
-"(-100) (G5) (-100)\n" +
-"(-100) (G6) (-100)\n" +
-"(-100) (G7) (-100)\n" +
-"(-100) (G8) (-100)\n" +
-"(-100) (G9) (-100)\n" +
-"(-100) (G10) (-100)\n" +
-"(-100) (G99) (-100)\n" +
-"(-100) (N) (-100.00)\n" +
-"(-100) (N0) (-100)\n" +
-"(-100) (N1) (-100.0)\n" +
-"(-100) (N2) (-100.00)\n" +
-"(-100) (N3) (-100.000)\n" +
-"(-100) (N4) (-100.0000)\n" +
-"(-100) (N5) (-100.00000)\n" +
-"(-100) (N6) (-100.000000)\n" +
-"(-100) (N7) (-100.0000000)\n" +
-"(-100) (N8) (-100.00000000)\n" +
-"(-100) (N9) (-100.000000000)\n" +
-"(-100) (N10) (-100.0000000000)\n" +
-"(-100) (N99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (P) (-10,000.00 %)\n" +
-"(-100) (P0) (-10,000 %)\n" +
-"(-100) (P1) (-10,000.0 %)\n" +
-"(-100) (P2) (-10,000.00 %)\n" +
-"(-100) (P3) (-10,000.000 %)\n" +
-"(-100) (P4) (-10,000.0000 %)\n" +
-"(-100) (P5) (-10,000.00000 %)\n" +
-"(-100) (P6) (-10,000.000000 %)\n" +
-"(-100) (P7) (-10,000.0000000 %)\n" +
-"(-100) (P8) (-10,000.00000000 %)\n" +
-"(-100) (P9) (-10,000.000000000 %)\n" +
-"(-100) (P10) (-10,000.0000000000 %)\n" +
-"(-100) (P99) (-10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-100) (X) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X0) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X1) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X2) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X3) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X4) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X5) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X6) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X7) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X8) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X9) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X10) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFF9C)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"UInt32\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (C) ($4,294,967,295.00)\n" +
-"(4294967295) (C0) ($4,294,967,295)\n" +
-"(4294967295) (C1) ($4,294,967,295.0)\n" +
-"(4294967295) (C2) ($4,294,967,295.00)\n" +
-"(4294967295) (C3) ($4,294,967,295.000)\n" +
-"(4294967295) (C4) ($4,294,967,295.0000)\n" +
-"(4294967295) (C5) ($4,294,967,295.00000)\n" +
-"(4294967295) (C6) ($4,294,967,295.000000)\n" +
-"(4294967295) (C7) ($4,294,967,295.0000000)\n" +
-"(4294967295) (C8) ($4,294,967,295.00000000)\n" +
-"(4294967295) (C9) ($4,294,967,295.000000000)\n" +
-"(4294967295) (C10) ($4,294,967,295.0000000000)\n" +
-"(4294967295) (C99) ($4,294,967,295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (D) (4294967295)\n" +
-"(4294967295) (D0) (4294967295)\n" +
-"(4294967295) (D1) (4294967295)\n" +
-"(4294967295) (D2) (4294967295)\n" +
-"(4294967295) (D3) (4294967295)\n" +
-"(4294967295) (D4) (4294967295)\n" +
-"(4294967295) (D5) (4294967295)\n" +
-"(4294967295) (D6) (4294967295)\n" +
-"(4294967295) (D7) (4294967295)\n" +
-"(4294967295) (D8) (4294967295)\n" +
-"(4294967295) (D9) (4294967295)\n" +
-"(4294967295) (D10) (4294967295)\n" +
-"(4294967295) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004294967295)\n" +
-"(4294967295) (E) (4.294967E+009)\n" +
-"(4294967295) (E0) (4E+009)\n" +
-"(4294967295) (E1) (4.3E+009)\n" +
-"(4294967295) (E2) (4.29E+009)\n" +
-"(4294967295) (E3) (4.295E+009)\n" +
-"(4294967295) (E4) (4.2950E+009)\n" +
-"(4294967295) (E5) (4.29497E+009)\n" +
-"(4294967295) (E6) (4.294967E+009)\n" +
-"(4294967295) (E7) (4.2949673E+009)\n" +
-"(4294967295) (E8) (4.29496730E+009)\n" +
-"(4294967295) (E9) (4.294967295E+009)\n" +
-"(4294967295) (E10) (4.2949672950E+009)\n" +
-"(4294967295) (E99) (4.294967295000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(4294967295) (F) (4294967295.00)\n" +
-"(4294967295) (F0) (4294967295)\n" +
-"(4294967295) (F1) (4294967295.0)\n" +
-"(4294967295) (F2) (4294967295.00)\n" +
-"(4294967295) (F3) (4294967295.000)\n" +
-"(4294967295) (F4) (4294967295.0000)\n" +
-"(4294967295) (F5) (4294967295.00000)\n" +
-"(4294967295) (F6) (4294967295.000000)\n" +
-"(4294967295) (F7) (4294967295.0000000)\n" +
-"(4294967295) (F8) (4294967295.00000000)\n" +
-"(4294967295) (F9) (4294967295.000000000)\n" +
-"(4294967295) (F10) (4294967295.0000000000)\n" +
-"(4294967295) (F99) (4294967295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (G) (4294967295)\n" +
-"(4294967295) (G0) (4294967295)\n" +
-"(4294967295) (G1) (4E+09)\n" +
-"(4294967295) (G2) (4.3E+09)\n" +
-"(4294967295) (G3) (4.29E+09)\n" +
-"(4294967295) (G4) (4.295E+09)\n" +
-"(4294967295) (G5) (4.295E+09)\n" +
-"(4294967295) (G6) (4.29497E+09)\n" +
-"(4294967295) (G7) (4.294967E+09)\n" +
-"(4294967295) (G8) (4.2949673E+09)\n" +
-"(4294967295) (G9) (4.2949673E+09)\n" +
-"(4294967295) (G10) (4294967295)\n" +
-"(4294967295) (G99) (4294967295)\n" +
-"(4294967295) (N) (4,294,967,295.00)\n" +
-"(4294967295) (N0) (4,294,967,295)\n" +
-"(4294967295) (N1) (4,294,967,295.0)\n" +
-"(4294967295) (N2) (4,294,967,295.00)\n" +
-"(4294967295) (N3) (4,294,967,295.000)\n" +
-"(4294967295) (N4) (4,294,967,295.0000)\n" +
-"(4294967295) (N5) (4,294,967,295.00000)\n" +
-"(4294967295) (N6) (4,294,967,295.000000)\n" +
-"(4294967295) (N7) (4,294,967,295.0000000)\n" +
-"(4294967295) (N8) (4,294,967,295.00000000)\n" +
-"(4294967295) (N9) (4,294,967,295.000000000)\n" +
-"(4294967295) (N10) (4,294,967,295.0000000000)\n" +
-"(4294967295) (N99) (4,294,967,295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (P) (429,496,729,500.00 %)\n" +
-"(4294967295) (P0) (429,496,729,500 %)\n" +
-"(4294967295) (P1) (429,496,729,500.0 %)\n" +
-"(4294967295) (P2) (429,496,729,500.00 %)\n" +
-"(4294967295) (P3) (429,496,729,500.000 %)\n" +
-"(4294967295) (P4) (429,496,729,500.0000 %)\n" +
-"(4294967295) (P5) (429,496,729,500.00000 %)\n" +
-"(4294967295) (P6) (429,496,729,500.000000 %)\n" +
-"(4294967295) (P7) (429,496,729,500.0000000 %)\n" +
-"(4294967295) (P8) (429,496,729,500.00000000 %)\n" +
-"(4294967295) (P9) (429,496,729,500.000000000 %)\n" +
-"(4294967295) (P10) (429,496,729,500.0000000000 %)\n" +
-"(4294967295) (P99) (429,496,729,500.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(4294967295) (X) (FFFFFFFF)\n" +
-"(4294967295) (X0) (FFFFFFFF)\n" +
-"(4294967295) (X1) (FFFFFFFF)\n" +
-"(4294967295) (X2) (FFFFFFFF)\n" +
-"(4294967295) (X3) (FFFFFFFF)\n" +
-"(4294967295) (X4) (FFFFFFFF)\n" +
-"(4294967295) (X5) (FFFFFFFF)\n" +
-"(4294967295) (X6) (FFFFFFFF)\n" +
-"(4294967295) (X7) (FFFFFFFF)\n" +
-"(4294967295) (X8) (FFFFFFFF)\n" +
-"(4294967295) (X9) (0FFFFFFFF)\n" +
-"(4294967295) (X10) (00FFFFFFFF)\n" +
-"(4294967295) (X99) (0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"UInt64\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (C) ($18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (C0) ($18,446,744,073,709,551,615)\n" +
-"(18446744073709551615) (C1) ($18,446,744,073,709,551,615.0)\n" +
-"(18446744073709551615) (C2) ($18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (C3) ($18,446,744,073,709,551,615.000)\n" +
-"(18446744073709551615) (C4) ($18,446,744,073,709,551,615.0000)\n" +
-"(18446744073709551615) (C5) ($18,446,744,073,709,551,615.00000)\n" +
-"(18446744073709551615) (C6) ($18,446,744,073,709,551,615.000000)\n" +
-"(18446744073709551615) (C7) ($18,446,744,073,709,551,615.0000000)\n" +
-"(18446744073709551615) (C8) ($18,446,744,073,709,551,615.00000000)\n" +
-"(18446744073709551615) (C9) ($18,446,744,073,709,551,615.000000000)\n" +
-"(18446744073709551615) (C10) ($18,446,744,073,709,551,615.0000000000)\n" +
-"(18446744073709551615) (C99) ($18,446,744,073,709,551,615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (D) (18446744073709551615)\n" +
-"(18446744073709551615) (D0) (18446744073709551615)\n" +
-"(18446744073709551615) (D1) (18446744073709551615)\n" +
-"(18446744073709551615) (D2) (18446744073709551615)\n" +
-"(18446744073709551615) (D3) (18446744073709551615)\n" +
-"(18446744073709551615) (D4) (18446744073709551615)\n" +
-"(18446744073709551615) (D5) (18446744073709551615)\n" +
-"(18446744073709551615) (D6) (18446744073709551615)\n" +
-"(18446744073709551615) (D7) (18446744073709551615)\n" +
-"(18446744073709551615) (D8) (18446744073709551615)\n" +
-"(18446744073709551615) (D9) (18446744073709551615)\n" +
-"(18446744073709551615) (D10) (18446744073709551615)\n" +
-"(18446744073709551615) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000018446744073709551615)\n" +
-"(18446744073709551615) (E) (1.844674E+019)\n" +
-"(18446744073709551615) (E0) (2E+019)\n" +
-"(18446744073709551615) (E1) (1.8E+019)\n" +
-"(18446744073709551615) (E2) (1.84E+019)\n" +
-"(18446744073709551615) (E3) (1.845E+019)\n" +
-"(18446744073709551615) (E4) (1.8447E+019)\n" +
-"(18446744073709551615) (E5) (1.84467E+019)\n" +
-"(18446744073709551615) (E6) (1.844674E+019)\n" +
-"(18446744073709551615) (E7) (1.8446744E+019)\n" +
-"(18446744073709551615) (E8) (1.84467441E+019)\n" +
-"(18446744073709551615) (E9) (1.844674407E+019)\n" +
-"(18446744073709551615) (E10) (1.8446744074E+019)\n" +
-"(18446744073709551615) (E99) (1.844674407370955161500000000000000000000000000000000000000000000000000000000000000000000000000000000E+019)\n" +
-"(18446744073709551615) (F) (18446744073709551615.00)\n" +
-"(18446744073709551615) (F0) (18446744073709551615)\n" +
-"(18446744073709551615) (F1) (18446744073709551615.0)\n" +
-"(18446744073709551615) (F2) (18446744073709551615.00)\n" +
-"(18446744073709551615) (F3) (18446744073709551615.000)\n" +
-"(18446744073709551615) (F4) (18446744073709551615.0000)\n" +
-"(18446744073709551615) (F5) (18446744073709551615.00000)\n" +
-"(18446744073709551615) (F6) (18446744073709551615.000000)\n" +
-"(18446744073709551615) (F7) (18446744073709551615.0000000)\n" +
-"(18446744073709551615) (F8) (18446744073709551615.00000000)\n" +
-"(18446744073709551615) (F9) (18446744073709551615.000000000)\n" +
-"(18446744073709551615) (F10) (18446744073709551615.0000000000)\n" +
-"(18446744073709551615) (F99) (18446744073709551615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (G) (18446744073709551615)\n" +
-"(18446744073709551615) (G0) (18446744073709551615)\n" +
-"(18446744073709551615) (G1) (2E+19)\n" +
-"(18446744073709551615) (G2) (1.8E+19)\n" +
-"(18446744073709551615) (G3) (1.84E+19)\n" +
-"(18446744073709551615) (G4) (1.845E+19)\n" +
-"(18446744073709551615) (G5) (1.8447E+19)\n" +
-"(18446744073709551615) (G6) (1.84467E+19)\n" +
-"(18446744073709551615) (G7) (1.844674E+19)\n" +
-"(18446744073709551615) (G8) (1.8446744E+19)\n" +
-"(18446744073709551615) (G9) (1.84467441E+19)\n" +
-"(18446744073709551615) (G10) (1.844674407E+19)\n" +
-"(18446744073709551615) (G99) (18446744073709551615)\n" +
-"(18446744073709551615) (N) (18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (N0) (18,446,744,073,709,551,615)\n" +
-"(18446744073709551615) (N1) (18,446,744,073,709,551,615.0)\n" +
-"(18446744073709551615) (N2) (18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (N3) (18,446,744,073,709,551,615.000)\n" +
-"(18446744073709551615) (N4) (18,446,744,073,709,551,615.0000)\n" +
-"(18446744073709551615) (N5) (18,446,744,073,709,551,615.00000)\n" +
-"(18446744073709551615) (N6) (18,446,744,073,709,551,615.000000)\n" +
-"(18446744073709551615) (N7) (18,446,744,073,709,551,615.0000000)\n" +
-"(18446744073709551615) (N8) (18,446,744,073,709,551,615.00000000)\n" +
-"(18446744073709551615) (N9) (18,446,744,073,709,551,615.000000000)\n" +
-"(18446744073709551615) (N10) (18,446,744,073,709,551,615.0000000000)\n" +
-"(18446744073709551615) (N99) (18,446,744,073,709,551,615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (P) (1,844,674,407,370,955,161,500.00 %)\n" +
-"(18446744073709551615) (P0) (1,844,674,407,370,955,161,500 %)\n" +
-"(18446744073709551615) (P1) (1,844,674,407,370,955,161,500.0 %)\n" +
-"(18446744073709551615) (P2) (1,844,674,407,370,955,161,500.00 %)\n" +
-"(18446744073709551615) (P3) (1,844,674,407,370,955,161,500.000 %)\n" +
-"(18446744073709551615) (P4) (1,844,674,407,370,955,161,500.0000 %)\n" +
-"(18446744073709551615) (P5) (1,844,674,407,370,955,161,500.00000 %)\n" +
-"(18446744073709551615) (P6) (1,844,674,407,370,955,161,500.000000 %)\n" +
-"(18446744073709551615) (P7) (1,844,674,407,370,955,161,500.0000000 %)\n" +
-"(18446744073709551615) (P8) (1,844,674,407,370,955,161,500.00000000 %)\n" +
-"(18446744073709551615) (P9) (1,844,674,407,370,955,161,500.000000000 %)\n" +
-"(18446744073709551615) (P10) (1,844,674,407,370,955,161,500.0000000000 %)\n" +
-"(18446744073709551615) (P99) (1,844,674,407,370,955,161,500.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(18446744073709551615) (X) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X0) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X1) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X2) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X3) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X4) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X5) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X6) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X7) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X8) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X9) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X10) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n";
-}
-
-}
-
diff --git a/mcs/class/corlib/Test/System/MathTest.cs b/mcs/class/corlib/Test/System/MathTest.cs
deleted file mode 100755
index a6b8feb799a..00000000000
--- a/mcs/class/corlib/Test/System/MathTest.cs
+++ /dev/null
@@ -1,614 +0,0 @@
-// MathTest.cs
-//
-// Jon Guymon (guymon@slackworks.com)
-//
-// (C) 2002 Jon Guymon
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System
-{
-
-public class MathTest : TestCase {
-
- public MathTest() : base ("System.Math testsuite") {}
- public MathTest(string name) : base(name) {}
-
- protected override void SetUp() {}
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MathTest));
- }
- }
-
- static double x = 0.1234;
- static double y = 12.345;
-
- public void TestDecimalAbs() {
- decimal a = -9.0M;
-
- Assert(9.0M == Math.Abs(a));
- }
-
-
- public void TestDoubleAbs() {
- double a = -9.0D;
-
- Assert(9.0D == Math.Abs(a));
- }
-
- public void TestFloatAbs() {
- float a = -9.0F;
-
- Assert(9.0F == Math.Abs(a));
- }
-
- public void TestLongAbs() {
- long a = -9L;
- long b = Int64.MinValue;
-
- Assert(9L == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestIntAbs() {
- int a = -9;
- int b = Int32.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestSbyteAbs() {
- sbyte a = -9;
- sbyte b = SByte.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestShortAbs() {
- short a = -9;
- short b = Int16.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestAcos() {
- double a = Math.Acos(x);
- double b = 1.4470809809523457;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Acos(-1.01D)));
- Assert(double.IsNaN(Math.Acos(1.01D)));
- }
-
- public void TestAsin() {
- double a = Math.Asin(x);
- double b = 0.12371534584255098;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Asin(-1.01D)));
- Assert(double.IsNaN(Math.Asin(1.01D)));
- }
-
- public void TestAtan() {
- double a = Math.Atan(x);
- double b = 0.12277930094473837;
- double c = 1.5707963267948966;
- double d = -1.5707963267948966;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert("should return NaN",
- double.IsNaN(Math.Atan(double.NaN)));
- Assert(Math.Atan(double.PositiveInfinity).ToString("G99")+" != "+c.ToString("G99"),
- Math.Abs((double)Math.Atan(double.PositiveInfinity) - c) <= double.Epsilon);
- Assert(Math.Atan(double.NegativeInfinity).ToString("G99")+" != "+d.ToString("G99"),
- Math.Abs((double)Math.Atan(double.NegativeInfinity) - d) <= double.Epsilon);
- }
-
- public void TestAtan2() {
- double a = Math.Atan2(x, y);
- double b = 0.0099956168687207747;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Acos(-2D)));
- Assert(double.IsNaN(Math.Acos(2D)));
- }
-
- public void TestCos() {
- double a = Math.Cos(x);
- double b = 0.99239587670489104;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestCosh() {
- double a = Math.Cosh(x);
- double b = 1.0076234465130722;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(Math.Cosh(double.NegativeInfinity) == double.PositiveInfinity);
- Assert(Math.Cosh(double.PositiveInfinity) == double.PositiveInfinity);
- Assert(double.IsNaN(Math.Cosh(double.NaN)));
- }
-
- public void TestSin() {
- double a = Math.Sin(x);
- double b = 0.12308705821137626;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestSinh() {
- double a = Math.Sinh(x);
- double b = 0.12371341868561381;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestTan() {
- double a = Math.Tan(x);
- double b = 0.12403019913793806;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestTanh() {
- double a = Math.Tanh(x);
- double b = 0.12277743150353424;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestSqrt() {
- double a = Math.Sqrt(x);
- double b = 0.35128336140500593;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestExp() {
- double a = Math.Exp(x);
- double b = 1.1313368651986859;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Exp(double.NaN)));
- Assert(Math.Exp(double.NegativeInfinity) == 0);
- Assert(Math.Exp(double.PositiveInfinity) == double.PositiveInfinity);
- }
-
- public void TestCeiling() {
- int iTest = 1;
- try {
- double a = Math.Ceiling(1.5);
- double b = 2;
-
- iTest++;
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- iTest++;
- Assert(Math.Ceiling(double.NegativeInfinity) == double.NegativeInfinity);
- iTest++;
- Assert(Math.Ceiling(double.PositiveInfinity) == double.PositiveInfinity);
- iTest++;
- Assert(double.IsNaN(Math.Ceiling(double.NaN)));
- } catch (Exception e) {
- Fail("Unexpected Exception at iTest=" + iTest + ": " + e);
- }
- }
-
- public void TestFloor() {
- try {
- double a = Math.Floor(1.5);
- double b = 1;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(Math.Floor(double.NegativeInfinity) == double.NegativeInfinity);
- Assert(Math.Floor(double.PositiveInfinity) == double.PositiveInfinity);
- Assert(double.IsNaN(Math.Floor(double.NaN)));
- } catch (Exception e) {
- Fail("Unexpected Exception: " + e.ToString());
- }
- }
-
- public void TestIEEERemainder() {
- double a = Math.IEEERemainder(y, x);
- double b = 0.0050000000000007816;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.IEEERemainder(y, 0)));
- }
-
- public void TestLog() {
- double a = Math.Log(y);
- double b = 2.513251122797143;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Log(-1)));
- Assert(double.IsNaN(Math.Log(double.NaN)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log(0) == double.NegativeInfinity);
- Assert(Math.Log(double.PositiveInfinity) == double.PositiveInfinity);
- }
-
- public void TestLog2() {
- double a = Math.Log(x, y);
- double b = -0.83251695325303621;
-
- Assert(a + " != " + b + " because diff is " + Math.Abs(a - b), (Math.Abs(a - b) <= 1e-14));
- Assert(double.IsNaN(Math.Log(-1, y)));
- Assert(double.IsNaN(Math.Log(double.NaN, y)));
- Assert(double.IsNaN(Math.Log(x, double.NaN)));
- Assert(double.IsNaN(Math.Log(double.NegativeInfinity, y)));
- Assert(double.IsNaN(Math.Log(x, double.NegativeInfinity)));
- Assert(double.IsNaN(Math.Log(double.PositiveInfinity, double.PositiveInfinity)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log(0, y) == double.NegativeInfinity);
- Assert(Math.Log(double.PositiveInfinity, y) == double.PositiveInfinity);
- Assert(Math.Log(x, double.PositiveInfinity) == 0);
- }
-
- public void TestLog10() {
- double a = Math.Log10(x);
- double b = -0.90868484030277719;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Log10(-1)));
- Assert(double.IsNaN(Math.Log10(double.NaN)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log10(0) == double.NegativeInfinity);
- Assert(Math.Log10(double.PositiveInfinity) == double.PositiveInfinity);
-
- }
-
- public void TestPow() {
- int iTest = 1;
-
- try {
- double a = Math.Pow(y, x);
- double b = 1.363609446060212;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"), (Math.Abs(a - b) <= double.Epsilon));
- iTest++;
- Assert (double.IsNaN(Math.Pow(y, double.NaN)));
- iTest++;
- Assert (double.IsNaN(Math.Pow(double.NaN, x)));
- iTest++;
- Assert ("Math.Pow(double.NegativeInfinity, 1) should be NegativeInfinity", double.IsNegativeInfinity(Math.Pow(double.NegativeInfinity, 1)));
- iTest++;
- Assert ("Math.Pow(double.NegativeInfinity, 2) should be PositiveInfinity", double.IsPositiveInfinity(Math.Pow(double.NegativeInfinity, 2)));
-
- // MS docs say this should be 0
- iTest++;
- Assert(double.IsNaN(Math.Pow(1, double.NegativeInfinity)));
- iTest++;
- AssertEquals ("Math.Pow(double.PositiveInfinity, double.NegativeInfinity)", (double)0, Math.Pow(double.PositiveInfinity, double.NegativeInfinity));
- iTest++;
- Assert ("Math.Pow(double.PositiveInfinity, 1) should be PositiveInfinity", double.IsPositiveInfinity(Math.Pow(double.PositiveInfinity, 1)));
-
- // MS docs say this should be PositiveInfinity
- iTest++;
- Assert ("Math.Pow(1, double.PositiveInfinity) should be NaN", double.IsNaN(Math.Pow(1, double.PositiveInfinity)));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest=" + iTest + ". e=" + e);
- }
- }
-
- public void TestByteMax() {
- byte a = 1;
- byte b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestDecimalMax() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestDoubleMax() {
- double a = 1.5D;
- double b = 2.5D;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestFloatMax() {
- float a = 1.5F;
- float b = 2.5F;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestIntMax() {
- int a = 1;
- int b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestLongMax() {
- long a = 1L;
- long b = 2L;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestSbyteMax() {
- sbyte a = 1;
- sbyte b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestShortMax() {
- short a = 1;
- short b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUintMax() {
- uint a = 1U;
- uint b = 2U;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUlongMax() {
- ulong a = 1UL;
- ulong b = 2UL;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUshortMax() {
- ushort a = 1;
- ushort b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestByteMin() {
- byte a = 1;
- byte b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDecimalMin() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDoubleMin() {
- double a = 1.5D;
- double b = 2.5D;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestFloatMin() {
- float a = 1.5F;
- float b = 2.5F;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestIntMin() {
- int a = 1;
- int b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestLongMin() {
- long a = 1L;
- long b = 2L;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestSbyteMin() {
- sbyte a = 1;
- sbyte b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestShortMin() {
- short a = 1;
- short b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUintMin() {
- uint a = 1U;
- uint b = 2U;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUlongMin() {
- ulong a = 1UL;
- ulong b = 2UL;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUshortMin() {
- ushort a = 1;
- ushort b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDecimalRound() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(Math.Round(a) + " != 2", Math.Round(a) == 2);
- Assert(Math.Round(b) + " != 2", Math.Round(b) == 2);
- }
-
- public void TestDecimalRound2() {
- decimal a = 3.45M;
- decimal b = 3.46M;
-
- AssertEquals ("Should round down", Math.Round(a, 1), 3.4M);
- AssertEquals ("Should round up", Math.Round(b, 1), 3.5M);
- }
-
- public void TestDoubleRound() {
- double a = 1.5D;
- double b = 2.5D;
-
- AssertEquals ("Should round up", Math.Round(a), 2D);
- AssertEquals ("Should round down", Math.Round(b), 2D);
- }
-
- public void TestDoubleRound2() {
- double a = 3.45D;
- double b = 3.46D;
-
- AssertEquals ("Should round down", Math.Round(a, 1), 3.4D);
- AssertEquals ("Should round up", Math.Round(b, 1), 3.5D);
- }
-
- public void TestDecimalSign() {
- decimal a = -5M;
- decimal b = 5M;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0M) == 0);
- }
-
- public void TestDoubleSign() {
- double a = -5D;
- double b = 5D;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0D) == 0);
- }
-
- public void TestFloatSign() {
- float a = -5F;
- float b = 5F;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0F) == 0);
- }
-
- public void TestIntSign() {
- int a = -5;
- int b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- }
-
- public void TestLongSign() {
- long a = -5L;
- long b = 5L;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0L) == 0);
- }
-
- public void TestSbyteSign() {
- sbyte a = -5;
- sbyte b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0) == 0);
- }
-
- public void TestShortSign() {
- short a = -5;
- short b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0) == 0);
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/MulticastDelegate.cs b/mcs/class/corlib/Test/System/MulticastDelegate.cs
deleted file mode 100644
index 18eef7cc1e0..00000000000
--- a/mcs/class/corlib/Test/System/MulticastDelegate.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// MulticastDelegate.cs - NUnit Test Cases for MulticastDelegates (C# delegates)
-//
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) Daniel Stodden
-//
-
-// these are the standard namespaces you will need. You may need to add more
-// depending on your tests.
-using NUnit.Framework;
-using System;
-
-// all test namespaces start with "MonoTests." Append the Namespace that
-// contains the class you are testing, e.g. MonoTests.System.Collections
-namespace MonoTests.System
-{
-
-// the class name should end with "Test" and start with the name of the class
-// you are testing, e.g. CollectionBaseTest
-public class MulticastDelegateTest : TestCase {
-
- // there should be two constructors for your class. The first one
- // (without parameters) should set the name to something unique.
- // Of course the name of the method is the same as the name of the
- // class
- public MulticastDelegateTest() : base ("System.MulticastDelegate") {}
- public MulticastDelegateTest(string name) : base(name) {}
-
- // this method is run before each Test* method is called. You can put
- // variable initialization, etc. here that is common to each test.
- // Just leave the method empty if you don't need to use it.
- protected override void SetUp() {}
-
- // this method is run after each Test* method is called. You can put
- // clean-up code, etc. here. Whatever needs to be done after each test.
- // Just leave the method empty if you don't need to use it.
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MulticastDelegateTest));
- }
- }
-
- private delegate char MyDelegate( ref string s );
-
- private char MethodA( ref string s )
- {
- s += "a";
- return 'a';
- }
-
- private char MethodB( ref string s )
- {
- s += "b";
- return 'b';
- }
-
- private char MethodC( ref string s )
- {
- s += "c";
- return 'c';
- }
-
- private char MethodD( ref string s )
- {
- s += "d";
- return 'd';
- }
-
- public void TestEquals()
- {
- MyDelegate dela = new MyDelegate( MethodA );
- MyDelegate delb = new MyDelegate( MethodB );
- MyDelegate delc = new MyDelegate( MethodC );
-
- AssertEquals( "#A01", false, dela == delb );
-
- MyDelegate del1, del2;
-
- del1 = dela + delb;
- del2 = delb + delc;
- AssertEquals( "#A02", false, del1 == del2 );
-
- del1 += delc;
- del2 = dela + del2;
- AssertEquals( "#A03", true, del1 == del2 );
- }
-
- public void TestCombineRemove()
- {
- MyDelegate dela = new MyDelegate( MethodA );
- MyDelegate delb = new MyDelegate( MethodB );
- MyDelegate delc = new MyDelegate( MethodC );
- MyDelegate deld = new MyDelegate( MethodD );
-
- string val;
- char res;
-
- // test combine
- MyDelegate del1, del2;
- del1 = dela + delb + delb + delc + delb + delb + deld;
- val = "";
- res = del1( ref val );
- AssertEquals( "#A01", "abbcbbd", val );
- AssertEquals( "#A02", 'd', res );
-
- // test remove
- del2 = del1 - ( delb + delb );
- val = "";
- res = del2( ref val );
- AssertEquals( "#A03", "abbcd", val );
- AssertEquals( "#A04", 'd', res );
-
- // we did not affect del1, did we?
- val = "";
- res = del1( ref val );
- AssertEquals( "#A05", "abbcbbd", val );
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System/ObjectTest.cs b/mcs/class/corlib/Test/System/ObjectTest.cs
deleted file mode 100644
index 5a9545f390a..00000000000
--- a/mcs/class/corlib/Test/System/ObjectTest.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-// ObjectTest.cs - NUnit Test Cases for the System.Object struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ObjectTest : TestCase
-{
- public ObjectTest() : base ("MonoTests.System.ObjectTest testsuite") {}
- public ObjectTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ObjectTest));
- }
- }
-
- public void TestCtor() {
- Object o = new Object();
- AssertNotNull("Can I at least get an _Object_, please?", o);
- }
-
- public void TestEquals1() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- x.Equals(x));
- Assert("object should not equal null",
- !x.Equals(null));
- Assert("Different objects should not equal 1",
- !x.Equals(y));
- Assert("Different objects should not equal 2",
- !y.Equals(x));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- ((Object)x).Equals(y));
- }
- }
- public void TestEquals2() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.Equals(x,x));
- Assert("object should not equal null",
- !Object.Equals(x,null));
- Assert("null should not equal object",
- !Object.Equals(null,x));
- Assert("Different objects should not equal 1",
- !Object.Equals(x,y));
- Assert("Different objects should not equal 2",
- !Object.Equals(y,x));
- Assert("null should not equal null",
- Object.Equals(null,null));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- Object.Equals(x,y));
- }
- }
-
- public void TestGetHashCode() {
- Object x = new Object();
- AssertEquals("Object's hash code should not change",
- x.GetHashCode(), x.GetHashCode());
- }
-
- public void TestGetType() {
- Object x = new Object();
- AssertNotNull("Should get a type for Object", x.GetType());
- AssertEquals("Bad name for Object type", "System.Object",
- x.GetType().ToString());
- }
-
- public void TestReferenceEquals() {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.ReferenceEquals(x,x));
- Assert("object should not equal null",
- !Object.ReferenceEquals(x,null));
- Assert("null should not equal object",
- !Object.ReferenceEquals(null,x));
- Assert("Different objects should not equal 1",
- !Object.ReferenceEquals(x,y));
- Assert("Different objects should not equal 2",
- !Object.ReferenceEquals(y,x));
- Assert("null should not equal null",
- Object.ReferenceEquals(null,null));
- }
-
- public void TestToString() {
- Object x = new Object();
- Object y = new Object();
- AssertEquals("All Objects should have same string rep",
- x.ToString(), y.ToString());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System/RandomTest.cs b/mcs/class/corlib/Test/System/RandomTest.cs
deleted file mode 100644
index 74146dea1c6..00000000000
--- a/mcs/class/corlib/Test/System/RandomTest.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.Random Test Cases
-//
-// Author: Bob Smith <bob@thestuff.net>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class RandomTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public RandomTest() : base ("MonoTests.System.RandomTest testcase") {}
- public RandomTest(string name): base(name){}
- public void TestDouble()
- {
- Random r = new Random();
- int i;
- double c=0;
- for (i=0; i<20; i++) c+=r.NextDouble();
- c/=i;
- Assert (c.ToString() + " is out of range.", c < .7 && c > .3);
- }
- public void TestSeed()
- {
- Random r = new Random(42);
- Random r2 = new Random(42);
- int i;
- double c=0, c2=0;
- for (i=0; i<20; i++)
- {
- c += r.NextDouble();
- c2 += r2.NextDouble();
- }
- AssertEquals(c, c2);
- }
- public void TestNext()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next();
- Assert (c < Int32.MaxValue && c >= 0);
- }
- }
- public void TestNextMax()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next(10);
- Assert (c < 10 && c >= 0);
- }
- }
- public void TestNextMinMax()
- {
- Random r = new Random();
- int i;
- long c;
- AssertEquals ("#1 Failed where min == max", 42, r.Next (42, 42));
- AssertEquals ("#2 Failed where min == max", Int32.MaxValue, r.Next (Int32.MaxValue,Int32.MaxValue));
- AssertEquals ("#3 Failed where min == max", Int32.MinValue, r.Next (Int32.MinValue,Int32.MinValue));
- AssertEquals ("#4 Failed where min == max", 0, r.Next (0, 0));
- for (i = 1; i <= Int32.MaxValue / 2; i *= 2)
- {
- c = r.Next (i, i * 2);
- Assert ("At i=" + i + " c < i*2 failed", c < i * 2);
- Assert ("At i=" + i + " c >= i failed", c >= i);
- }
- for (i = -1; i >= Int32.MinValue / 2; i *= 2)
- {
- c = r.Next (i * 2, i);
- Assert ("At i=" + i + " c < i*2 failed", c < i);
- Assert ("At i=" + i + " c >= i failed", c >= i * 2);
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs b/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
deleted file mode 100644
index 728408b3b1d..00000000000
--- a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.ResolveEventArgs Test Cases
-//
-// Author: Nick Drochak <ndrochak@gol.com>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class ResolveEventArgsTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public ResolveEventArgsTest() : base ("MonoTests.System.ResolveEventArgsTest testcase") {}
- public ResolveEventArgsTest(string name): base(name){}
-
- public void TestTheWholeThing()
- {
- ResolveEventArgs REA = new ResolveEventArgs("REA_Name");
- Assert ("Name property not correct", REA.Name == "REA_Name");
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/SByteTest.cs b/mcs/class/corlib/Test/System/SByteTest.cs
deleted file mode 100644
index 0005eb55c63..00000000000
--- a/mcs/class/corlib/Test/System/SByteTest.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-// SByteTest.cs - NUnit Test Cases for the System.SByte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class SByteTest : TestCase
-{
- private const SByte MySByte1 = -42;
- private const SByte MySByte2 = -128;
- private const SByte MySByte3 = 127;
- private const string MyString1 = "-42";
- private const string MyString2 = "-128";
- private const string MyString3 = "127";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public SByteTest() : base ("MonoTests.System.SByteTest testcase") {}
- public SByteTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(SByte.MinValue, MySByte2);
- AssertEquals(SByte.MaxValue, MySByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MySByte3.CompareTo(MySByte2) > 0);
- Assert(MySByte2.CompareTo(MySByte2) == 0);
- Assert(MySByte1.CompareTo((SByte)(-42)) == 0);
- Assert(MySByte2.CompareTo(MySByte3) < 0);
- try {
- MySByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MySByte1.Equals(MySByte1));
- Assert(MySByte1.Equals((SByte)(-42)));
- Assert(MySByte1.Equals((Int16)(-42)) == false);
- Assert(MySByte1.Equals(MySByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MySByte1.GetHashCode();
- MySByte2.GetHashCode();
- MySByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MySByte1 == SByte.Parse(MyString1));
- Assert(MySByte2 == SByte.Parse(MyString2));
- Assert(MySByte3 == SByte.Parse(MyString3));
- try {
- SByte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- SByte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = SByte.MaxValue + 1;
- SByte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- AssertEquals("A1", (sbyte)42, SByte.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- SByte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == SByte.Parse(" -42 ", Nfi));
- try {
- SByte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == SByte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- SByte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert("MyString1, MySByte1.ToString()", String.Compare(MyString1, MySByte1.ToString()) == 0);
- Assert("MyString2, MySByte2.ToString()", String.Compare(MyString2, MySByte2.ToString()) == 0);
- Assert("MyString3, MySByte3.ToString()", String.Compare(MyString3, MySByte3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests depend on the culture of the system running the test.
- So, this needs to be tested in a different way.
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
- Assert("Results2[i], MySByte3.ToString(Formats2[i])", String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0);
- Assert("ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi):"+ResultsNfi2[i]+"<==>"+MySByte3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MySByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("typeof(FormatException) == e.GetType()", typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs
deleted file mode 100644
index 9cdb8c2c776..00000000000
--- a/mcs/class/corlib/Test/System/StringTest.cs
+++ /dev/null
@@ -1,1083 +0,0 @@
-// StringTest.cs - NUnit Test Cases for the System.String class
-//
-// Jeffrey Stedfast <fejj@ximian.com>
-// David Brandt <bucky@keystreams.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class StringTest : TestCase
-{
- public StringTest() : base ("MonoTests.System.StringTest testcase") {}
- public StringTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (StringTest));
- }
- }
-
- public void TestLength ()
- {
- string str = "test string";
-
- AssertEquals("wrong length", 11, str.Length);
- }
-
- public void TestCompare ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
- string caps = "ABC";
-
- AssertEquals(0, String.Compare(null, null));
- AssertEquals(1, String.Compare(lesser, null));
-
- Assert (String.Compare (lesser, greater) < 0);
- Assert (String.Compare (greater, lesser) > 0);
- Assert (String.Compare (lesser, lesser) == 0);
- Assert (String.Compare (lesser, medium) < 0);
-
- Assert (String.Compare (lesser, caps, true) == 0);
- Assert (String.Compare (lesser, caps, false) != 0);
- AssertEquals ("A01", String.Compare ("a", "b"), -1);
- AssertEquals ("A02", String.Compare ("b", "a"), 1);
- AssertEquals ("A03", String.Compare ("A", "a"), 1);
- AssertEquals ("A04", String.Compare ("a", "A"), -1);
-
-
- // TODO - test with CultureInfo
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check #1", 0,
- String.Compare(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring check #2", -1,
- String.Compare(needle, 0, haystack, 0, 3));
- AssertEquals("basic substring check #3", 0,
- String.Compare("ab", 0, "ab", 0, 2));
- AssertEquals("basic substring check #4", 0,
- String.Compare("ab", 0, "ab", 0, 3));
- AssertEquals("basic substring check #5", 0,
- String.Compare("abc", 0, "ab", 0, 2));
- AssertEquals("basic substring check #6", 1,
- String.Compare("abc", 0, "ab", 0, 5));
- AssertEquals("basic substring check #7", -1,
- String.Compare("ab", 0, "abc", 0, 5));
-
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check #1/" + i, String.Compare(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check #2/" + i, String.Compare(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check #3/" + i, 0, String.Compare(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check #4/" + i, 0, String.Compare(needle, 0, haystack, i, 3));
- }
- }
-
- needle = "AB";
- AssertEquals("basic substring check #8", 0,
- String.Compare(needle, 0, haystack, 0, 2, true));
- AssertEquals("basic substring check #9", 1,
- String.Compare(needle, 0, haystack, 0, 2, false));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check #5/" + i, String.Compare(needle, 0, haystack, i, 2, true) != 0);
- Assert("loop substring check #6/" + i, String.Compare(needle, 0, haystack, i, 2, false) != 0);
- } else {
- AssertEquals("loop substring check #7/" + i, 0, String.Compare(needle, 0, haystack, i, 2, true));
- AssertEquals("loop substring check #8/" + i, 1, String.Compare(needle, 0, haystack, i, 2, false));
- }
- }
-
- // TODO - extended format call with CultureInfo
- }
-
- public void TestCompareOrdinal ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
-
- AssertEquals(0, String.CompareOrdinal(null, null));
- AssertEquals(1, String.CompareOrdinal(lesser, null));
-
- Assert (String.CompareOrdinal (lesser, greater) < 0);
- Assert (String.CompareOrdinal (greater, lesser) > 0);
- Assert (String.CompareOrdinal (lesser, lesser) == 0);
- Assert (String.CompareOrdinal (lesser, medium) < 0);
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check", 0,
- String.CompareOrdinal(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring miss", -1,
- String.CompareOrdinal(needle, 0, haystack, 0, 3));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 3));
- }
- }
- }
-
- public void TestCompareTo ()
- {
- string lower = "abc";
- string greater = "xyz";
- string lesser = "abc";
-
- Assert (lower.CompareTo (greater) < 0);
- Assert (lower.CompareTo (lower) == 0);
- Assert (greater.CompareTo (lesser) > 0);
- }
-
- public void TestConcat ()
- {
- string string1 = "string1";
- string string2 = "string2";
- string concat = "string1string2";
-
- Assert (String.Concat (string1, string2) == concat);
- }
-
- public void TestCopy()
- {
- string s1 = "original";
- string s2 = String.Copy(s1);
- AssertEquals("String copy no good", s1, s2);
-
- bool errorThrown = false;
- try {
- string s = String.Copy(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null copy shouldn't be good", errorThrown);
- }
-
- public void TestCopyTo()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.CopyTo(0, (char[])null, 0, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null CopyTo shouldn't be good", errorThrown);
-
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("char string not bad to start", !s1.Equals(s2));
- for (int i = 0; i < s1.Length; i++) {
- s1.CopyTo(i, c1, i, 1);
- }
- s2 = new String(c1);
- AssertEquals("char-by-char copy bad", s1, s2);
- }
-
- public void TestEndsWith()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.EndsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null EndsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.EndsWith("l"));
- Assert("should match 2", s1.EndsWith("inal"));
- Assert("should fail", !s1.EndsWith("ina"));
- }
-
- public void TestEquals()
- {
- string s1 = "original";
- string yes = "original";
- object y = yes;
- string no = "copy";
-
- Assert("No match for null", !s1.Equals(null));
- Assert("Should match object", s1.Equals(y));
- Assert("Should match", s1.Equals(yes));
- Assert("Shouldn't match", !s1.Equals(no));
-
- Assert("Static nulls should match", String.Equals(null, null));
- Assert("Should match", String.Equals(s1, yes));
- Assert("Shouldn't match", !String.Equals(s1, no));
- }
-
- public void TestFormat ()
- {
- AssertEquals ("Empty format string.", "", String.Format ("", 0));
- AssertEquals ("Single argument.", "100", String.Format ("{0}", 100));
- AssertEquals ("Single argument, right justified.", "X 37X", String.Format ("X{0,5}X", 37));
- AssertEquals ("Single argument, left justified.", "X37 X", String.Format ("X{0,-5}X", 37));
- AssertEquals ("Two arguments.", "The 3 wise men.", String.Format ("The {0} wise {1}.", 3, "men"));
- AssertEquals ("Three arguments.", "do re me fa so.", String.Format ("{0} re {1} fa {2}.", "do", "me", "so"));
- AssertEquals ("Formatted argument.", "###00c0ffee#", String.Format ("###{0:x8}#", 0xc0ffee));
- AssertEquals ("Formatted argument, right justified.", "# 033#", String.Format ("#{0,5:x3}#", 0x33));
- AssertEquals ("Formatted argument, left justified.", "#033 #", String.Format ("#{0,-5:x3}#", 0x33));
- AssertEquals ("Escaped bracket", "typedef struct _MonoObject { ... } MonoObject;", String.Format ("typedef struct _{0} {{ ... }} MonoObject;", "MonoObject"));
- AssertEquals ("With Slash", "Could not find file \"a/b\"", String.Format ("Could not find file \"{0}\"", "a/b"));
- AssertEquals ("With BackSlash", "Could not find file \"a\\b\"", String.Format ("Could not find file \"{0}\"", "a\\b"));
-
- // TODO test format exceptions
-
- // TODO test argument null exceptions
- // This should work, but it doesn't currently.
- // I think I broke the spec...
- //bool errorThrown = false;
- //try {
- //string s = String.Format(null, " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 1", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(null, " ", " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 2", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(" ", null);
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 3", errorThrown);
- }
-
- public void TestGetEnumerator()
- {
- string s1 = "original";
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("pre-enumerated string should not match", !s1.Equals(s2));
- CharEnumerator en = s1.GetEnumerator();
- AssertNotNull("null enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- c1[i] = en.Current;
- }
- s2 = new String(c1);
- AssertEquals("enumerated string should match", s1, s2);
- }
-
- public void TestGetHashCode()
- {
- string s1 = "original";
- // TODO - weak test, currently. Just verifies determinicity.
- AssertEquals("same string, same hash code",
- s1.GetHashCode(), s1.GetHashCode());
- }
-
- public void TestGetType() {
- string s1 = "original";
- AssertEquals("String type", "System.String", s1.GetType().ToString());
- }
-
- public void TestGetTypeCode() {
- string s1 = "original";
- Assert(s1.GetTypeCode().Equals(TypeCode.String));
- }
-
- public void TestIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.IndexOf('r'));
- AssertEquals("basic char index", 2, s1.IndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.IndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.IndexOf("rig"));
- AssertEquals("basic string index", 2, s1.IndexOf("i"));
- AssertEquals("basic string index - no", -1, s1.IndexOf("rag"));
-
- AssertEquals("stepped char index", 1, s1.IndexOf('r', 1));
- AssertEquals("stepped char index", 2, s1.IndexOf('i', 1));
- AssertEquals("stepped char index", 4, s1.IndexOf('i', 3));
- AssertEquals("stepped char index", -1, s1.IndexOf('i', 5));
- AssertEquals("stepped char index", -1, s1.IndexOf('l', s1.Length));
-
- AssertEquals("stepped limited char index",
- 1, s1.IndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 2, s1.IndexOf('i', 1, 3));
- AssertEquals("stepped limited char index",
- 4, s1.IndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('i', 5, 3));
-
- s1 = "original original";
- AssertEquals("stepped string index 1",
- 0, s1.IndexOf("original", 0));
- AssertEquals("stepped string index 2",
- 9, s1.IndexOf("original", 1));
- AssertEquals("stepped string index 3",
- -1, s1.IndexOf("original", 10));
- AssertEquals("stepped limited string index 1",
- 1, s1.IndexOf("rig", 0, 5));
- AssertEquals("stepped limited string index 2",
- -1, s1.IndexOf("rig", 0, 3));
- AssertEquals("stepped limited string index 3",
- 10, s1.IndexOf("rig", 2, 15));
- AssertEquals("stepped limited string index 4",
- -1, s1.IndexOf("rig", 2, 3));
- }
-
- public void TestIndexOfAny() {
- string s1 = "abcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 0, s1.IndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.IndexOfAny(c1, 1));
- AssertEquals("out of vowels", -1, s1.IndexOfAny(c1, 9));
- AssertEquals("second vowel in range",
- 4, s1.IndexOfAny(c1, 1, 4));
- AssertEquals("second vowel out of range",
- -1, s1.IndexOfAny(c1, 1, 3));
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestInsert() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string result = s1.Insert(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("Null arg error", errorThrown);
-
- errorThrown = false;
- try {
- string result = s1.Insert(s1.Length+1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- AssertEquals("front insert",
- "Hi!original", s1.Insert(0, "Hi!"));
- AssertEquals("back insert",
- "originalHi!", s1.Insert(s1.Length, "Hi!"));
- AssertEquals("middle insert",
- "origHi!inal", s1.Insert(4, "Hi!"));
- }
-
- public void TestIntern() {
- bool errorThrown = false;
- try {
- string s = String.Intern(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string s1 = "original";
- AssertEquals("One string's reps are both the same",
- String.Intern(s1), String.Intern(s1));
-
- string s2 = "originally";
- Assert("Different strings, different reps",
- String.Intern(s1) != String.Intern(s2));
- }
-
- public void TestIsInterned() {
- bool errorThrown = false;
- try {
- string s = String.IsInterned(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- // FIXME - it seems like this should work, but no.
- // I don't know how it's possible to get a null
- // returned from IsInterned.
- //Assert("no intern for regular string",
- //String.IsInterned("original") == null);
-
- string s1 = "original";
- AssertEquals("is interned", s1, String.IsInterned(s1));
- }
-
- public void TestJoin() {
- bool errorThrown = false;
- try {
- string s = String.Join(" ", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string[] chunks = {"this", "is", "a", "test"};
- AssertEquals("Basic join", "this is a test",
- String.Join(" ", chunks));
- AssertEquals("Basic join", "this.is.a.test",
- String.Join(".", chunks));
-
- AssertEquals("Subset join", "is a",
- String.Join(" ", chunks, 1, 2));
- AssertEquals("Subset join", "is.a",
- String.Join(".", chunks, 1, 2));
- AssertEquals("Subset join", "is a test",
- String.Join(" ", chunks, 1, 3));
-
- errorThrown = false;
- try {
- string s = String.Join(" ", chunks, 2, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- }
-
- public void TestLastIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.LastIndexOf('r'));
- AssertEquals("basic char index", 4, s1.LastIndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.LastIndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.LastIndexOf("rig"));
- AssertEquals("basic string index", 4, s1.LastIndexOf("i"));
- AssertEquals("basic string index - no", -1,
- s1.LastIndexOf("rag"));
-
-
-
- AssertEquals("stepped char index", 1,
- s1.LastIndexOf('r', s1.Length-1));
- AssertEquals("stepped char index", 4,
- s1.LastIndexOf('i', s1.Length-1));
- AssertEquals("stepped char index", 2,
- s1.LastIndexOf('i', 3));
- AssertEquals("stepped char index", -1,
- s1.LastIndexOf('i', 1));
-
- AssertEquals("stepped limited char index",
- 1, s1.LastIndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 4, s1.LastIndexOf('i', 6, 3));
- AssertEquals("stepped limited char index",
- 2, s1.LastIndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('i', 1, 2));
-
- s1 = "original original";
- AssertEquals("stepped string index #1",
- 9, s1.LastIndexOf("original", s1.Length));
- AssertEquals("stepped string index #2",
- 0, s1.LastIndexOf("original", s1.Length-2));
- AssertEquals("stepped string index #3",
- -1, s1.LastIndexOf("original", s1.Length-11));
- AssertEquals("stepped string index #4",
- -1, s1.LastIndexOf("translator", 2));
- AssertEquals("stepped limited string index #1",
- 10, s1.LastIndexOf("rig", s1.Length-1, 10));
- AssertEquals("stepped limited string index #2",
- -1, s1.LastIndexOf("rig", s1.Length, 3));
- AssertEquals("stepped limited string index #3",
- 10, s1.LastIndexOf("rig", s1.Length-2, 15));
- AssertEquals("stepped limited string index #4",
- -1, s1.LastIndexOf("rig", s1.Length-2, 3));
- }
-
- public void TestLastIndexOfAny() {
- string s1 = ".bcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 8, s1.LastIndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.LastIndexOfAny(c1, 7));
- AssertEquals("out of vowels", -1, s1.LastIndexOfAny(c1, 3));
- AssertEquals("second vowel in range",
- 4, s1.LastIndexOfAny(c1, s1.Length-6, 4));
- AssertEquals("second vowel out of range",
- -1, s1.LastIndexOfAny(c1, s1.Length-6, 3));
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestPadLeft() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadLeft(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadLeft(s1.Length-1));
- AssertEquals("Some padding",
- " Hi!", s1.PadLeft(5));
- }
-
- public void TestPadRight() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadRight(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadRight(s1.Length-1));
- AssertEquals("Some padding",
- "Hi! ", s1.PadRight(5));
- }
-
- public void TestRemove() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.Remove(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(s1.Length,s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
-
- AssertEquals("basic remove", "oinal",
- s1.Remove(1, 3));
- }
-
- public void TestReplace() {
- string s1 = "original";
-
- AssertEquals("non-hit char", s1, s1.Replace('q','s'));
- AssertEquals("single char", "oxiginal", s1.Replace('r', 'x'));
- AssertEquals("double char", "orxgxnal", s1.Replace('i', 'x'));
-
- bool errorThrown = false;
- try {
- string s = s1.Replace(null, "feh");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("should get null arg exception", errorThrown);
-
- AssertEquals("replace as remove", "ornal",
- s1.Replace("igi", null));
- AssertEquals("non-hit string", s1, s1.Replace("spam", "eggs"));
- AssertEquals("single string", "orirumal",
- s1.Replace("gin", "rum"));
- AssertEquals("double string", "oreigeinal",
- s1.Replace("i", "ei"));
-
- AssertEquals ("result longer", ":!:", "::".Replace ("::", ":!:"));
- }
-
- public void TestSplit() {
- string s1 = "abcdefghijklm";
- char[] c1 = {'q', 'r'};
- AssertEquals("No splitters", s1, (s1.Split(c1))[0]);
-
- char[] c2 = {'a', 'e', 'i', 'o', 'u'};
- string[] chunks = s1.Split(c2);
- AssertEquals("First chunk", "", chunks[0]);
- AssertEquals("Second chunk", "bcd", chunks[1]);
- AssertEquals("Third chunk", "fgh", chunks[2]);
- AssertEquals("Fourth chunk", "jklm", chunks[3]);
-
- {
- bool errorThrown = false;
- try {
- chunks = s1.Split(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Split out of range", errorThrown);
- }
-
- chunks = s1.Split(c2, 2);
- AssertEquals("Limited chunk", 2, chunks.Length);
- AssertEquals("First limited chunk", "", chunks[0]);
- AssertEquals("Second limited chunk", "bcdefghijklm", chunks[1]);
-
- string s3 = "1.0";
- char[] c3 = {'.'};
- chunks = s3.Split(c3,2);
- AssertEquals("1.0 split length", 2, chunks.Length);
- AssertEquals("1.0 split first chunk", "1", chunks[0]);
- AssertEquals("1.0 split second chunk", "0", chunks[1]);
-
- string s4 = "1.0.0";
- char[] c4 = {'.'};
- chunks = s4.Split(c4,2);
- AssertEquals("1.0.0 split length", 2, chunks.Length);
- AssertEquals("1.0.0 split first chunk", "1", chunks[0]);
- AssertEquals("1.0.0 split second chunk", "0.0", chunks[1]);
-
- string s5 = ".0.0";
- char[] c5 = {'.'};
- chunks = s5.Split (c5, 2);
- AssertEquals(".0.0 split length", 2, chunks.Length);
- AssertEquals(".0.0 split first chunk", "", chunks[0]);
- AssertEquals(".0.0 split second chunk", "0.0", chunks[1]);
-
- string s6 = ".0";
- char[] c6 = {'.'};
- chunks = s6.Split (c6, 2);
- AssertEquals(".0 split length", 2, chunks.Length);
- AssertEquals(".0 split first chunk", "", chunks[0]);
- AssertEquals(".0 split second chunk", "0", chunks[1]);
-
- string s7 = "0.";
- char[] c7 = {'.'};
- chunks = s7.Split (c7, 2);
- AssertEquals("0. split length", 2, chunks.Length);
- AssertEquals("0. split first chunk", "0", chunks[0]);
- AssertEquals("0. split second chunk", "", chunks[1]);
-
- string s8 = "0.0000";
- char[] c8 = {'.'};
- chunks = s8.Split (c8, 2);
- AssertEquals("0.0000/2 split length", 2, chunks.Length);
- AssertEquals("0.0000/2 split first chunk", "0", chunks[0]);
- AssertEquals("0.0000/2 split second chunk", "0000", chunks[1]);
-
- chunks = s8.Split (c8, 3);
- AssertEquals("0.0000/3 split length", 2, chunks.Length);
- AssertEquals("0.0000/3 split first chunk", "0", chunks[0]);
- AssertEquals("0.0000/3 split second chunk", "0000", chunks[1]);
-
- chunks = s8.Split (c8, 1);
- AssertEquals("0.0000/1 split length", 1, chunks.Length);
- AssertEquals("0.0000/1 split first chunk", "0.0000", chunks[0]);
-
- chunks = s1.Split(c2, 1);
- AssertEquals("Single split", 1, chunks.Length);
- AssertEquals("Single chunk", s1, chunks[0]);
-
- chunks = s1.Split(c2, 0);
- AssertEquals("Zero split", 0, chunks.Length);
- }
-
- public void TestStartsWith() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.StartsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null StartsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.StartsWith("o"));
- Assert("should match 2", s1.StartsWith("orig"));
- Assert("should fail", !s1.StartsWith("rig"));
- }
-
- public void TestSubstring() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string s = s1.Substring(s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- errorThrown = false;
- try {
- string s = s1.Substring(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- AssertEquals("basic substring", "inal",
- s1.Substring(4));
- AssertEquals("midstring", "igin",
- s1.Substring(2, 4));
- AssertEquals("at end", "",
- s1.Substring(s1.Length, 0));
- }
-
- public void TestToCharArray() {
- string s1 = "original";
- char[] c1 = s1.ToCharArray();
- AssertEquals("right array size", s1.Length, c1.Length);
- AssertEquals("basic char array", s1,
- new String(c1));
-
- bool errorThrown = false;
- try {
- s1.ToCharArray(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- c1 = s1.ToCharArray(0, 3);
- AssertEquals("Starting char array", "ori", new String(c1));
- }
-
- public void TestToLower() {
- string s1 = "OrIgInAl";
- AssertEquals("lowercase failed", "original", s1.ToLower());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestToString() {
- string s1 = "original";
- AssertEquals("ToString failed!", s1, s1.ToString());
- }
-
- public void TestToUpper() {
- string s1 = "OrIgInAl";
- AssertEquals("uppercase failed", "ORIGINAL", s1.ToUpper());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestTrim() {
- string s1 = " original\t\n";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = "original";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = " \t \n ";
- AssertEquals("empty trim failed", "", s1.Trim());
- AssertEquals("empty trim failed", "", s1.Trim(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom trim failed",
- "original", s1.Trim(delims));
- }
-
- public void TestTrimEnd() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " original";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimEnd failed",
- "", s1.TrimEnd(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimEnd failed",
- "aaaoriginal", s1.TrimEnd(delims));
- }
-
- public void TestTrimStart() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = "original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimStart failed",
- "", s1.TrimStart(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimStart failed",
- "originalbbb", s1.TrimStart(delims));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeSpanTest.cs b/mcs/class/corlib/Test/System/TimeSpanTest.cs
deleted file mode 100755
index c3e59151ac3..00000000000
--- a/mcs/class/corlib/Test/System/TimeSpanTest.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// TimeSpanTest.cs - NUnit Test Cases for the System.TimeSpan struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2001 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class TimeSpanTest : TestCase
-{
- public TimeSpanTest() : base ("MonoTests.System.TimeSpanTest testcase") {}
- public TimeSpanTest (string name): base (name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeSpanTest));
- }
- }
-
- public void TestCtors ()
- {
- TimeSpan t1 = new TimeSpan (1234567890);
-
- AssertEquals ("A1", "00:02:03.4567890", t1.ToString ());
- t1 = new TimeSpan (1,2,3);
- AssertEquals ("A2", "01:02:03", t1.ToString ());
- t1 = new TimeSpan (1,2,3,4);
- AssertEquals ("A3", "1.02:03:04", t1.ToString ());
- t1 = new TimeSpan (1,2,3,4,5);
- AssertEquals ("A4", "1.02:03:04.0050000", t1.ToString ());
- t1 = new TimeSpan (-1,2,-3,4,-5);
- AssertEquals ("A5", "-22:02:56.0050000", t1.ToString ());
- t1 = new TimeSpan (0,25,0,0,0);
- AssertEquals ("A6", "1.01:00:00", t1.ToString ());
- }
-
- public void TestProperties ()
- {
- TimeSpan t1 = new TimeSpan (1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals ("A1", 1, t1.Days);
- AssertEquals ("A2", 2, t1.Hours);
- AssertEquals ("A3", 3, t1.Minutes);
- AssertEquals ("A4", 4, t1.Seconds);
- AssertEquals ("A5", 5, t1.Milliseconds);
- AssertEquals ("A6", -1, t2.Days);
- AssertEquals ("A7", -2, t2.Hours);
- AssertEquals ("A8", -3, t2.Minutes);
- AssertEquals ("A9", -4, t2.Seconds);
- AssertEquals ("A10", -5, t2.Milliseconds);
- }
-
- public void TestAdd ()
- {
- TimeSpan t1 = new TimeSpan (2,3,4,5,6);
- TimeSpan t2 = new TimeSpan (1,2,3,4,5);
- TimeSpan t3 = t1 + t2;
- TimeSpan t4 = t1.Add (t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals ("A1", 3, t3.Days);
- AssertEquals ("A2", 5, t3.Hours);
- AssertEquals ("A3", 7, t3.Minutes);
- AssertEquals ("A4", 9, t3.Seconds);
- AssertEquals ("A5", 11, t3.Milliseconds);
- AssertEquals ("A6", "3.05:07:09.0110000", t4.ToString ());
- try
- {
- t5 = TimeSpan.MaxValue + new TimeSpan (1);
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- Assert ("A7", exception);
- }
-
- public void TestCompare ()
- {
- TimeSpan t1 = new TimeSpan (-1);
- TimeSpan t2 = new TimeSpan (1);
- int res;
- bool exception;
-
- AssertEquals ("A1", -1, TimeSpan.Compare (t1, t2));
- AssertEquals ("A2", 1, TimeSpan.Compare (t2, t1));
- AssertEquals ("A3", 0, TimeSpan.Compare (t2, t2));
- AssertEquals ("A4", -1, TimeSpan.Compare (TimeSpan.MinValue, TimeSpan.MaxValue));
- AssertEquals ("A5", -1, t1.CompareTo (t2));
- AssertEquals ("A6", 1, t2.CompareTo (t1));
- AssertEquals ("A7", 0, t2.CompareTo (t2));
- AssertEquals ("A8", -1, TimeSpan.Compare (TimeSpan.MinValue, TimeSpan.MaxValue));
-
- AssertEquals ("A9", 1, TimeSpan.Zero.CompareTo (null));
-
- try
- {
- res = TimeSpan.Zero.CompareTo("");
- exception = false;
- }
- catch (ArgumentException)
- {
- exception = true;
- }
- Assert ("A10", exception);
-
- AssertEquals ("A11", false, t1 == t2);
- AssertEquals ("A12", false, t1 > t2);
- AssertEquals ("A13", false, t1 >= t2);
- AssertEquals ("A14", true, t1 != t2);
- AssertEquals ("A15", true, t1 < t2);
- AssertEquals ("A16", true, t1 <= t2);
- }
-
- public void TestNegateAndDuration ()
- {
- TimeSpan t1;
- bool exception;
-
- AssertEquals ("A1", "-00:00:00.0012345", new TimeSpan (12345).Negate ().ToString ());
- AssertEquals ("A2", "00:00:00.0012345", new TimeSpan (-12345).Duration ().ToString ());
-
- try
- {
- t1 = TimeSpan.MinValue.Negate ();
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- Assert ("A3", exception);
-
- try
- {
- t1 = TimeSpan.MinValue.Duration ();
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- AssertEquals ("A5", "-00:00:00.0000077", (-(new TimeSpan (77))).ToString ());
- AssertEquals("A6", "00:00:00.0000077", (+(new TimeSpan(77))).ToString());
- }
-
- public void TestEquals ()
- {
- TimeSpan t1 = new TimeSpan (1);
- TimeSpan t2 = new TimeSpan (2);
- string s = "justastring";
-
- AssertEquals ("A1", true, t1.Equals (t1));
- AssertEquals ("A2", false, t1.Equals (t2));
- AssertEquals ("A3", false, t1.Equals (s));
- AssertEquals ("A4", false, t1.Equals (null));
- AssertEquals ("A5", true, TimeSpan.Equals (t1, t1));
- AssertEquals ("A6", false, TimeSpan.Equals (t1, t2));
- AssertEquals ("A7", false, TimeSpan.Equals (t1, null));
- AssertEquals ("A8", false, TimeSpan.Equals (t1, s));
- AssertEquals ("A9", false, TimeSpan.Equals (s, t2));
- AssertEquals ("A10", true, TimeSpan.Equals (null,null));
- }
-
- public void TestFromXXXX ()
- {
- AssertEquals ("A1", "12.08:16:48", TimeSpan.FromDays (12.345).ToString ());
- AssertEquals ("A2", "12:20:42", TimeSpan.FromHours (12.345).ToString ());
- AssertEquals ("A3", "00:12:20.7000000", TimeSpan.FromMinutes (12.345).ToString ());
- AssertEquals ("A4", "00:00:12.3450000", TimeSpan.FromSeconds (12.345).ToString ());
- AssertEquals ("A5", "00:00:00.0120000", TimeSpan.FromMilliseconds (12.345).ToString ());
- AssertEquals ("A6", "00:00:00.0012345", TimeSpan.FromTicks (12345).ToString ());
- }
-
- public void TestGetHashCode ()
- {
- AssertEquals ("A1", 77, new TimeSpan (77).GetHashCode ());
- }
-
- private void TestParseHelper (string s, bool expectFormat, bool expectOverflow, string expect)
- {
- bool formatException = false;
- bool overflowException = false;
- string result = "junk ";
-
- try {
- result = TimeSpan.Parse (s).ToString ();
- }
- catch (OverflowException) {
- overflowException = true;
- }
- catch (FormatException) {
- formatException = true;
- }
- AssertEquals ("A1", expectFormat, formatException);
- AssertEquals ("A2", expectOverflow, overflowException);
-
- if (!expectOverflow && !expectFormat) {
- AssertEquals ("A3", expect, result);
- }
- }
-
- public void TestParse ()
- {
- TestParseHelper (" 13:45:15 ",false, false, "13:45:15");
- TestParseHelper (" -1:2:3 ", false, false, "-01:02:03");
-
- TestParseHelper (" 25:0:0 ",false, true, "dontcare");
- TestParseHelper ("aaa", true, false, "dontcare");
-
- TestParseHelper ("-21.23:59:59.9999999", false, false, "-21.23:59:59.9999999");
-
- TestParseHelper ("100000000000000.1:1:1", false, true, "dontcare");
- TestParseHelper ("24:60:60", false, true, "dontcare");
- TestParseHelper ("0001:0002:0003.12 ", false, false, "01:02:03.1200000");
-
- TestParseHelper (" 1:2:3:12345678 ", true, false, "dontcare");
- }
-
- public void TestSubstract ()
- {
- TimeSpan t1 = new TimeSpan (2,3,4,5,6);
- TimeSpan t2 = new TimeSpan (1,2,3,4,5);
- TimeSpan t3 = t1 - t2;
- TimeSpan t4 = t1.Subtract (t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals ("A1", "1.01:01:01.0010000", t3.ToString ());
- AssertEquals ("A2", "1.01:01:01.0010000", t4.ToString ());
- try {
- t5 = TimeSpan.MinValue - new TimeSpan (1);
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- Assert ("A3", exception);
- }
-
- public void TestToString ()
- {
- TimeSpan t1 = new TimeSpan (1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals ("A1", "1.02:03:04.0050000", t1.ToString ());
- AssertEquals ("A2", "-1.02:03:04.0050000", t2.ToString ());
- AssertEquals ("A3", "10675199.02:48:05.4775807", TimeSpan.MaxValue.ToString ());
- AssertEquals ("A4", "-10675199.02:48:05.4775808", TimeSpan.MinValue.ToString ());
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs
deleted file mode 100644
index c4440d3fee9..00000000000
--- a/mcs/class/corlib/Test/System/TimeZoneTest.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// TimeZoneTest.cs - NUnit Test Cases for the System.TimeZone struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Martin Baulig
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class TimeZoneTest : TestCase
-{
- private CultureInfo oldcult;
-
- public TimeZoneTest() : base ("MonoTests.System.TimeZoneTest testcase") {}
- public TimeZoneTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeZoneTest));
- }
- }
-
- protected override void SetUp ()
- {
- oldcult = Thread.CurrentThread.CurrentCulture;
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
-
- }
-
- protected override void TearDown ()
- {
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
- public void TestCtors ()
- {
- TimeZone t1 = TimeZone.CurrentTimeZone;
- AssertEquals("A01", "CET", t1.StandardName);
- AssertEquals("A02", "CEST", t1.DaylightName);
-
- DaylightTime d1 = t1.GetDaylightChanges (2002);
- AssertEquals("A03", "03/31/2002 01:00:00", d1.Start.ToString ("G"));
- AssertEquals("A04", "10/27/2002 01:00:00", d1.End.ToString ("G"));
- AssertEquals("A05", 36000000000L, d1.Delta.Ticks);
-
- DaylightTime d2 = t1.GetDaylightChanges (1996);
- AssertEquals("A06", "03/31/1996 01:00:00", d2.Start.ToString ("G"));
- AssertEquals("A07", "10/27/1996 01:00:00", d2.End.ToString ("G"));
- AssertEquals("A08", 36000000000L, d2.Delta.Ticks);
-
- DateTime d3 = new DateTime (2002,2,25);
- AssertEquals("A09", false, t1.IsDaylightSavingTime (d3));
- DateTime d4 = new DateTime (2002,4,2);
- AssertEquals("A10", true, t1.IsDaylightSavingTime (d4));
- DateTime d5 = new DateTime (2002,11,4);
- AssertEquals("A11", false, t1.IsDaylightSavingTime (d5));
-
- AssertEquals("A12", 36000000000L, t1.GetUtcOffset (d3).Ticks);
- AssertEquals("A13", 72000000000L, t1.GetUtcOffset (d4).Ticks);
- AssertEquals("A14", 36000000000L, t1.GetUtcOffset (d5).Ticks);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt16Test.cs b/mcs/class/corlib/Test/System/UInt16Test.cs
deleted file mode 100644
index cc62b30384e..00000000000
--- a/mcs/class/corlib/Test/System/UInt16Test.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-// UInt16Test.cs - NUnit Test Cases for the System.UInt16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class UInt16Test : TestCase
-{
- private const UInt16 MyUInt16_1 = 42;
- private const UInt16 MyUInt16_2 = 0;
- private const UInt16 MyUInt16_3 = 65535;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "65535";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null,
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {null,
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"65,535.00000",
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt16Test() : base ("MonoTests.System.UInt16Test testcase") {}
- public UInt16Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"65,535.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt16.MinValue, MyUInt16_2);
- AssertEquals(UInt16.MaxValue, MyUInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt16_3.CompareTo(MyUInt16_2) > 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_2) == 0);
- Assert(MyUInt16_1.CompareTo((UInt16)(42)) == 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_3) < 0);
- try {
- MyUInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt16_1.Equals(MyUInt16_1));
- Assert(MyUInt16_1.Equals((UInt16)(42)));
- Assert(MyUInt16_1.Equals((SByte)(42)) == false);
- Assert(MyUInt16_1.Equals(MyUInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt16_1.GetHashCode();
- MyUInt16_2.GetHashCode();
- MyUInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt16_1 == UInt16.Parse(MyString1));
- Assert(MyUInt16_2 == UInt16.Parse(MyString2));
- Assert(MyUInt16_3 == UInt16.Parse(MyString3));
- try {
- UInt16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = UInt16.MaxValue + 1;
- UInt16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt16.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt16.Parse(" 42 ", Nfi));
- try {
- UInt16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals("A1", MyString1, MyUInt16_1.ToString());
- AssertEquals("A2", MyString2, MyUInt16_2.ToString());
- AssertEquals("A3", MyString3, MyUInt16_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("A4:"+i.ToString(), Results1[i], MyUInt16_2.ToString(Formats1[i]));
- AssertEquals("A5:"+i.ToString(), Results2[i], MyUInt16_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("A6:"+i.ToString(), ResultsNfi1[i], MyUInt16_2.ToString(Formats1[i], Nfi));
- AssertEquals("A7:"+i.ToString(), ResultsNfi2[i], MyUInt16_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("A8", typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt32Test.cs b/mcs/class/corlib/Test/System/UInt32Test.cs
deleted file mode 100644
index da64ebd7087..00000000000
--- a/mcs/class/corlib/Test/System/UInt32Test.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// UInt32Test.cs - NUnit Test Cases for the System.UInt32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class UInt32Test : TestCase
-{
- private const UInt32 MyUInt32_1 = 42;
- private const UInt32 MyUInt32_2 = 0;
- private const UInt32 MyUInt32_3 = 4294967295;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "4294967295";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {"",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"4,294,967,295.00000",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt32Test() : base ("MonoTests.System.UInt32Test testcase") {}
- public UInt32Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"4,294,967,295.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt32.MinValue, MyUInt32_2);
- AssertEquals(UInt32.MaxValue, MyUInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt32_3.CompareTo(MyUInt32_2) > 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_2) == 0);
- Assert(MyUInt32_1.CompareTo((UInt32)(42)) == 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_3) < 0);
- Assert (1 == UInt32.Parse ("1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse ("1 "));
- Assert (1 == UInt32.Parse ("+1"));
-
- try {
- UInt32.Parse (" + 1 ");
- Fail ("Should raise FormatException1");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
-
- try {
- UInt32.Parse (" + ");
- Fail ("Should raise FormatException");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
- try {
- MyUInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt32_1.Equals(MyUInt32_1));
- Assert(MyUInt32_1.Equals((UInt32)(42)));
- Assert(MyUInt32_1.Equals((SByte)(42)) == false);
- Assert(MyUInt32_1.Equals(MyUInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt32_1.GetHashCode();
- MyUInt32_2.GetHashCode();
- MyUInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("Parse problem on \""+MyString1+"\"", MyUInt32_1 == UInt32.Parse(MyString1));
- Assert("Parse problem on \""+MyString2+"\"", MyUInt32_2 == UInt32.Parse(MyString2));
- Assert("Parse problem on \""+MyString3+"\"", MyUInt32_3 == UInt32.Parse(MyString3));
- try {
- UInt32.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Did not get ArgumentNullException type", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt32.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Did not get FormatException type", typeof(FormatException) == e.GetType());
- }
- try {
- // TODO: Use this after ToString() is completed. For now, hard code string that generates
- // exception.
- //double OverInt = (double)UInt32.MaxValue + 1;
- //UInt32.Parse(OverInt.ToString());
- UInt32.Parse("4294967296");
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("Did not get OverflowException type on '"+"4294967296"+"'. Instead, got: '"+e.GetType()+"'", typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt32.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt32.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt32.Parse(" 42 ", Nfi));
- try {
- UInt32.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt32.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- int TestNumber = 1;
- try {
- //test ToString()
- AssertEquals(MyString1, MyUInt32_1.ToString());
- TestNumber++;
- AssertEquals(MyString2, MyUInt32_2.ToString());
- TestNumber++;
- AssertEquals(MyString3, MyUInt32_3.ToString());
- } catch (Exception e) {
- Fail("TestToString: Failed on TestNumber=" + TestNumber
- + " with exception: " + e.ToString());
- }
-
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- try {
- AssertEquals(Results1[i], MyUInt32_2.ToString(Formats1[i]));
- } catch (Exception e) {
- Fail("TestToString: MyUInt32_2.ToString(Formats1[i]) i=" + i
- + ". e = " + e.ToString());
- }
-
- try {
- AssertEquals(Results2[i], MyUInt32_3.ToString(Formats2[i]));
- } catch (Exception e) {
- Fail("TestToString: MyUInt32_3.ToString(Formats2[i]) i=" + i
- + ". e = " + e.ToString());
- }
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt32_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt32_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt32_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt64Test.cs b/mcs/class/corlib/Test/System/UInt64Test.cs
deleted file mode 100644
index b1c2dac65f2..00000000000
--- a/mcs/class/corlib/Test/System/UInt64Test.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-// UInt64Test.cs - NUnit Test Cases for the System.UInt64 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class UInt64Test : TestCase
-{
- private const UInt64 MyUInt64_1 = 42;
- private const UInt64 MyUInt64_2 = 0;
- private const UInt64 MyUInt64_3 = 18446744073709551615;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "18446744073709551615";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {"",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt64Test() : base ("MonoTests.System.UInt64Test testcase") {}
- public UInt64Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt64Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt64.MinValue, MyUInt64_2);
- AssertEquals(UInt64.MaxValue, MyUInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt64_3.CompareTo(MyUInt64_2) > 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_2) == 0);
- Assert(MyUInt64_1.CompareTo((UInt64)(42)) == 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_3) < 0);
- try {
- MyUInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt64_1.Equals(MyUInt64_1));
- Assert(MyUInt64_1.Equals((UInt64)(42)));
- Assert(MyUInt64_1.Equals((SByte)(42)) == false);
- Assert(MyUInt64_1.Equals(MyUInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt64_1.GetHashCode();
- MyUInt64_2.GetHashCode();
- MyUInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt64_1 == UInt64.Parse(MyString1));
- Assert(MyUInt64_2 == UInt64.Parse(MyString2));
- Assert(MyUInt64_3 == UInt64.Parse(MyString3));
- try {
- UInt64.Parse(null);
- Fail("Should raise a ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- Assert(42 == UInt64.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt64.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt64.Parse(" 42 ", Nfi));
- try {
- UInt64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt64.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals(MyString1, MyUInt64_1.ToString());
- AssertEquals(MyString2, MyUInt64_2.ToString());
- AssertEquals(MyString3, MyUInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(Results1[i], MyUInt64_2.ToString(Formats1[i]));
- AssertEquals(Results2[i], MyUInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/VersionTest.cs b/mcs/class/corlib/Test/System/VersionTest.cs
deleted file mode 100644
index 32f4c17d6e5..00000000000
--- a/mcs/class/corlib/Test/System/VersionTest.cs
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// VersionTest.cs - NUnit Test Cases for the System.Version class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class VersionTest : TestCase
-{
- public VersionTest () : base ("MonoTests.System.VersionTest testcase") {}
- public VersionTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (VersionTest));
- }
- }
-
-
- public void TestCtors ()
- {
- Version v1;
- bool exception;
-
- /*
- v1 = new Version ();
- AssertEquals ("A1", 0, v1.Major);
- AssertEquals ("A2", 0, v1.Minor);
- AssertEquals ("A3", -1, v1.Build);
- AssertEquals ("A4", -1, v1.Revision);
- */
-
- v1 = new Version (23, 7);
- AssertEquals ("A5", 23, v1.Major);
- AssertEquals ("A6", 7, v1.Minor);
- AssertEquals ("A7", -1, v1.Build);
- AssertEquals ("A8", -1, v1.Revision);
-
- v1 = new Version (23, 7, 99);
- AssertEquals ("A9", 23, v1.Major);
- AssertEquals ("A10", 7, v1.Minor);
- AssertEquals ("A11", 99, v1.Build);
- AssertEquals ("A12", -1, v1.Revision);
-
- v1 = new Version (23, 7, 99, 42);
- AssertEquals ("A13", 23, v1.Major);
- AssertEquals ("A14", 7, v1.Minor);
- AssertEquals ("A15", 99, v1.Build);
- AssertEquals ("A16", 42, v1.Revision);
-
- try {
- v1 = new Version (23, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A17", exception);
-
- try {
- v1 = new Version (23, 7, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A18", exception);
-
- try {
- v1 = new Version (23, 7, 99, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A19", exception);
-
- }
-
- public void TestStringCtor ()
- {
- Version v1;
- bool exception;
-
- v1 = new Version("1.42.79");
- AssertEquals ("A1", 1, v1.Major);
- AssertEquals ("A2", 42, v1.Minor);
- AssertEquals ("A3", 79, v1.Build);
- AssertEquals ("A4", -1, v1.Revision);
-
-
- try {
- v1 = new Version ("1.42.-79");
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- try {
- v1 = new Version ("1");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A6", exception);
-
- try {
- v1 = new Version ("1.2.3.4.5");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- try {
- v1 = new Version ((string) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A6", exception);
-
-
- }
-
- public void TestClone ()
- {
- Version v1 = new Version (1, 2, 3, 4);
- Version v2 = (Version) v1.Clone ();
-
- Assert ("A1", v1.Equals (v2));
- Assert ("A2", !ReferenceEquals (v1, v2));
- }
-
- public void TestCompareTo ()
- {
- Assert ("A1", new Version (1, 2).CompareTo (new Version (1, 1)) > 0);
- Assert ("A2", new Version (1, 2, 3).CompareTo (new Version (2, 2, 3)) < 0);
- Assert ("A3", new Version (1, 2, 3, 4).CompareTo (new Version (1, 2, 2, 1)) > 0);
-
- Assert ("A4", new Version (1, 3).CompareTo (new Version (1, 2, 2, 1)) > 0);
- Assert ("A5", new Version (1, 2, 2).CompareTo (new Version (1, 2, 2, 1)) < 0);
-
- Assert ("A6", new Version (1, 2).CompareTo (new Version (1, 2)) == 0);
- Assert ("A7", new Version (1, 2, 3).CompareTo (new Version (1, 2, 3)) == 0);
-
- Assert ("A8", new Version (1, 1) < new Version (1, 2));
- Assert ("A9", new Version (1, 2) <= new Version (1, 2));
- Assert ("A10", new Version (1, 2) <= new Version (1, 3));
- Assert ("A11", new Version (1, 2) >= new Version (1, 2));
- Assert ("A12", new Version (1, 3) >= new Version (1, 2));
- Assert ("A13", new Version (1, 3) > new Version (1, 2));
-
- Version v1 = new Version(1, 2);
- bool exception;
-
- // LAMESPEC: Docs say this should throw a ArgumentNullException,
- // but it simply works. Seems any version is subsequent to null
- Assert ("A14:", v1.CompareTo (null) > 0);
-
- try {
- v1.CompareTo ("A string is not a version");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A15", exception);
-
- }
-
-
- public void TestEquals ()
- {
- Version v1 = new Version (1, 2);
- Version v2 = new Version (1, 2, 3, 4);
- Version v3 = new Version (1, 2, 3, 4);
-
- AssertEquals ("A1", true, v2.Equals (v3));
- AssertEquals ("A2", true, v2.Equals (v2));
- AssertEquals ("A3", false, v1.Equals (v3));
-
- AssertEquals ("A4", true, v2 == v3);
- AssertEquals ("A5", true, v2 == v2);
- AssertEquals ("A6", false, v1 == v3);
-
- AssertEquals ("A7", false, v2.Equals ((Version) null));
- AssertEquals ("A8", false, v2.Equals ("A string"));
-
- }
-
- public void TestToString ()
- {
- Version v1 = new Version (1,2);
- Version v2 = new Version (1,2,3);
- Version v3 = new Version (1,2,3,4);
-
- AssertEquals ("A1", "1.2", v1.ToString ());
- AssertEquals ("A2", "1.2.3", v2.ToString ());
- AssertEquals ("A3", "1.2.3.4", v3.ToString ());
-
- AssertEquals ("A4", "" , v3.ToString (0));
- AssertEquals ("A5", "1" , v3.ToString (1));
- AssertEquals ("A6", "1.2" , v3.ToString (2));
- AssertEquals ("A7", "1.2.3" , v3.ToString (3));
- AssertEquals ("A8", "1.2.3.4" , v3.ToString (4));
-
- bool exception;
-
- try {
- v2.ToString (4);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A9", exception);
-
- try {
- v3.ToString (42);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A10", exception);
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/corlib_test.build b/mcs/class/corlib/Test/corlib_test.build
deleted file mode 100644
index d0840a32f72..00000000000
--- a/mcs/class/corlib/Test/corlib_test.build
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for corlib_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="corlib_test" default="build">
- <property name="debug" value="true"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="corlib_linux_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="System.Security.Policy/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore_mono.dll"/>
- </references>
- <arg value="/r:..\..\lib\corlib.dll"/>
- <arg value="/r:..\..\lib\System.dll"/>
- <arg value="/nowarn:1595"/>
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- </csc>
-
- <csc target="library" output="corlib_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:corlib_res.dll"/>
- <arg value="/nowarn:1595"/>
- </csc>
-
- <csc target="library" output="corlib_reference.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- </csc>
-</target>
-
-
- <target name="test" depends="assemblies">
-<!-- Do not run the unit tests with mono corlib on ms.net. With all the icalls the results provide no useful info -->
-<!-- Change this to be "mint NUnitConsole" or "mono NUnitConsole" when those are ready to be run on Windows -->
-<!-- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_test.dll" failonerror="false"/> -->
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_reference.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="corlib_test.dll" failonerror="false"/>
- <delete file="corlib_linux_test.dll" failonerror="false"/>
- <delete file="corlib_reference.dll" failonerror="false"/>
-
- <delete file="corlib_test.pdb" failonerror="false"/>
- <delete file="corlib_linux_test.pdb" failonerror="false"/>
- <delete file="corlib_reference.pdb" failonerror="false"/>
-
- </target>
-</project>
diff --git a/mcs/class/corlib/Test/resources/AFile.txt b/mcs/class/corlib/Test/resources/AFile.txt
deleted file mode 100644
index 59072cba2d9..00000000000
--- a/mcs/class/corlib/Test/resources/AFile.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Mono.Tests.AllTests.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.AllTests.Suite);
- suite.AddTest(System.Collections.AllTests.Suite);
- suite.AddTest(System.Security.AllTests.Suite);
- suite.AddTest(System.Security.Cryptography.AllTests.Suite);
- suite.AddTest(System.IO.AllTests.Suite);
- suite.AddTest(System.Net.AllTests.Suite);
- suite.AddTest(System.Text.AllTests.Suite);
- suite.AddTest(System.Security.Permissions.AllTests.Suite);
- suite.AddTest(System.Resources.AllTests.Suite);
-// suite.AddTest(System.Security.Policy.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/resources/Empty.resources b/mcs/class/corlib/Test/resources/Empty.resources
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Test/resources/Empty.resources
+++ /dev/null
diff --git a/mcs/class/corlib/Test/resources/MyResources.resources b/mcs/class/corlib/Test/resources/MyResources.resources
deleted file mode 100644
index b486e9e5111..00000000000
--- a/mcs/class/corlib/Test/resources/MyResources.resources
+++ /dev/null
Binary files differ