Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,228 @@
2010-01-24 Robert Jordan <robertj@gmx.net>
* DictionaryTest.cs: Add test case for bug #474009.
2009-09-22 Raja R Harinath <harinath@hurrynot.org>
* DictionaryTest.cs (ICollectionCopyTo): Test various odd
scenarios where .NET CopyTo does _not_ throw an exception.
(ICollectionCopyTo_ex1..4): Ensure that ArgumentExceptions are
thrown in appropriate cases.
2009-07-31 Raja R Harinath <harinath@hurrynot.org>
* ListTest.cs: Add a few testcases for IList interface, using null
values with a List<int>.
2009-07-31 Raja R Harinath <harinath@hurrynot.org>
* DictionaryTest.cs (KeyEnumerator_Current): New test. Test the
Keys slice enumerator.
(ValueEnumerator_Current): Likewise, for the Values slice.
2009-07-30 Raja R Harinath <harinath@hurrynot.org>
* ListTest.cs (Enumerator_Current): New test, includes
relevant parts of #491858 and #517415.
2009-07-30 Raja R Harinath <harinath@hurrynot.org>
* DictionaryTest.cs (Enumerator_Current): New test, includes
relevant parts of #491858 and #517415.
2009-04-02 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: add test for bug #328036.
2008-11-14 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: add tests for #444778.
2008-11-14 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: add tests for bug #444768.
2008-10-06 Zoltan Varga <vargaz@gmail.com>
* DictionaryTest.cs: Add a test for #432441.
2008-09-29 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: test for null argument for ContainsKey.
Patch by Jonathan Anderson <jonathan.l.anderson@gmail.com>
2008-09-24 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: add tests for bug #429530.
2008-09-12 Jb Evain <jbevain@novell.com>
* DictionaryTest.cs: add tests for #425693.
2008-06-16 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* DictionaryTest.cs: Add test for an incompatibility
2008-04-30 Gert Driesen <drieseng@users.sourceforge.net>
* DictionaryTest.cs: Added not working tests for bug #384723. Spaces
to tabs.
2008-03-21 Sebastien Pouliot <sebastien@ximian.com>
* EqualityComparerTest.cs: New. Add test cases for using null with
GetHashCode (bug #372892).
2008-01-06 Zoltan Varga <vargaz@gmail.com>
* ListTest.cs: Make some tests public.
2007-11-05 Sebastien Pouliot <sebastien@ximian.com>
* DictionaryTest.cs: Test case for #322783 based on Francisco Moraes
sample code.
2006-04-16 Jonathan Chambers <joncham@gmail.com>
* ListTest.cs: Test Contains after Remove.
Test for bug #81387.
2007-03-08 Gert Driesen <drieseng@users.sourceforge.net>
* ComparerTest.cs: Added test for bug #80929. Added tests to verify
binary serialization compatibility.
* IListTest.cs: Fixed header.
2007-03-07 Gert Driesen <drieseng@users.sourceforge.net>
* IListTest.cs: Added test for bug #80260.
2006-09-12 Gert Driesen <drieseng@users.sourceforge.net>
* ListTest.cs: Added tests for binary serialization, and Enumerator
version checks.
2006-05-08 Atsushi Enomoto <atsushi@ximian.com>
* ListTest.cs : test for bug #77277 by Kazuki Oikawa.
2006-03-16 Ankit Jain <jankit@novell.com>
* ListTest.cs: Add some tests for InsertRange.
2006-01-23 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs (IDictionary_*): Add a few tests for the
IDictionary explicit implementation.
2006-01-19 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs: Remove NotWorking annotations.
(Empty_CopyTo, Empty_Values_CopyTo): Fix tests to check that
CopyTo from an empty dictionary does not throw an exception when
'index==array.Length'.
(PlainEnumeratorReturnTest): Check the type of 'Entry' property too.
2006-01-19 Atsushi Enomoto <atsushi@ximian.com>
* DictionaryTest.cs : fixed several tests to not fail under .NET 2.0
and thus marked some as NotWorking. Numbered some assertions.
2005-12-21 Sebastien Pouliot <sebastien@ximian.com>
* ListTest.cs: Added test cases for #77039 for sorting a list with
IComparable (generic or not) and without IComparable (exception).
2005-12-20 Sebastien Pouliot <sebastien@ximian.com>
* ListTest.cs: Added test case for #76361 for sorting the list with a
generic comparer.
2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
* DictionaryTest.cs: Added test cases for CopyTo, including a test for
DictionaryEntry.
* ListTest.cs: Added test case for #77019 when copying from an empty
dictionary.
2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
* ListTest.cs: Added test case for a binary search with an empty list
(bug #77030). Removed IsReadOnly test case as this isn't part of the
public API anymore.
2005-08-16 Martin Baulig <martin@ximian.com>
* DictionaryTest.cs (IEnumeratorGenericTest): Reflect latest
`KeyValuePair<K,V>' API changes.
2005-06-27 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs (FailFastTest1, FailFastTest2, FailFastTest3):
New tests to ensure that enumerators are invalidated on
modifications to the dictionary.
2005-06-22 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs (KeyValueEnumeratorTest): Add test for infloop
if dictionary is read while it's being enumerated.
2005-06-20 David Waite <mass@akuma.org>
* ListTest.cs: Substantial new tests
2005-06-18 David Waite <mass@akuma.org>
* DictionaryTest.cs (AddTest3): Added test of simple interaction with
struct dictionary
(AddDuplicateTest,IndexerGetNullTest,IndexerSetNullTest): Added tests
for exceptional cases to verify correct exceptions
(TryGetValueTest): check return value from TryGetValue
(KeyValueEnumeratorTest): Added test from verification of ms.net beta2
behavior for non-generic IEnumerator/IDictionaryEnumerator behavior
against Dictionary<>
(SerializationTest): Added test to utilize serialization routines.
2005-06-16 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs (SliceCollectionsEnumeratorTest): New test
based on #75053.
2005-06-07 Ankit Jain <ankit@corewars.org>
* DictionaryTest.cs (KeyValueEnumeratorTest): Added new test.
2005-05-19 Raja R Harinath <rharinath@novell.com>
* ListTest.cs (TestGetRange): Add missing ';'. Actually compare
the length of the list.
2005-05-18 Miguel de Icaza <miguel@novell.com>
* ListTest.cs: Added.
2005-05-13 Atsushi Enomoto <atsushi@ximian.com>
* QueueTest.cs, StackTest.cs: They are now in System.dll
2005-05-05 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs (MyTest.GetHashCode): Add to silence a
compiler warning.
2005-04-04 Raja R Harinath <rharinath@novell.com>
* DictionaryTest.cs: Update.
2005-04-02 Ben Maurer <bmaurer@ximian.com>
* DictionaryTest.cs: new test.
2005-01-29 Ben Maurer <bmaurer@ximian.com>
* QueueTest.cs: new Test.
2004-12-27 Ben Maurer <bmaurer@ximian.com>
* StackTest.cs: new Test.

View File

@ -0,0 +1,148 @@
//
// MonoTests.System.Collections.Generic.Test.ComparerTest
//
// Authors:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// Copyright (C) 2007 Gert Driesen
// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using NUnit.Framework;
using System;
namespace MonoTests.System.Collections.Generic
{
[TestFixture]
public class ComparerTest
{
class CustomComparer : IComparable, IComparable<object>
{
int IComparable<object>.CompareTo (object other)
{
throw new NotImplementedException ();
}
int IComparable.CompareTo (object obj)
{
return 9;
}
}
#if NET_4_5
[Test]
public void Create ()
{
var comparer = Comparer<int>.Create ((a, b) => a - b);
Assert.AreEqual (-1, comparer.Compare (1, 2), "#1");
}
[Test]
public void Create_Invalid ()
{
try {
Comparer<int>.Create (null);
Assert.Fail ("#1");
} catch (ArgumentNullException) {
}
}
#endif
[Test]
public void DefaultComparer_UserComparable ()
{
IComparer c = Comparer<object>.Default;
Assert.AreEqual (-9, c.Compare (new object (), new CustomComparer ()), "#1");
Assert.AreEqual (9, c.Compare (new CustomComparer (), new object ()), "#2");
}
[Test]
public void DefaultComparer_NotComparableArgument ()
{
IComparer c = Comparer<object>.Default;
try {
c.Compare (new object (), new object ());
Assert.Fail ("#1");
} catch (ArgumentException) {
}
var o = new object ();
Assert.AreEqual (0, c.Compare (o, o), "#2");
}
#if !NET_4_0 // FIXME: the blob contains the 2.0 mscorlib version
[Test] // bug #80929
public void SerializeDefault ()
{
Comparer<int> c = Comparer<int>.Default;
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, c);
byte [] buffer = new byte [ms.Length];
ms.Position = 0;
ms.Read (buffer, 0, buffer.Length);
Assert.AreEqual (_serializedDefault, buffer);
}
#endif
[Test]
public void DeserializeDefault ()
{
MemoryStream ms = new MemoryStream ();
ms.Write (_serializedDefault, 0, _serializedDefault.Length);
ms.Position = 0;
BinaryFormatter bf = new BinaryFormatter ();
Comparer<int> c = (Comparer<int>) bf.Deserialize (ms);
Assert.IsNotNull (c);
}
private static readonly byte [] _serializedDefault = new byte [] {
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
0x89, 0x01, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f,
0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x47,
0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x2e, 0x47, 0x65, 0x6e, 0x65,
0x72, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72,
0x60, 0x31, 0x5b, 0x5b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
0x49, 0x6e, 0x74, 0x33, 0x32, 0x2c, 0x20, 0x6d, 0x73, 0x63, 0x6f,
0x72, 0x6c, 0x69, 0x62, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x3d, 0x32, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c,
0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
0x62, 0x37, 0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33,
0x34, 0x65, 0x30, 0x38, 0x39, 0x5d, 0x5d, 0x00, 0x00, 0x00, 0x00,
0x0b };
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
//
// Unit tests for System.Collections.Generic.EqualityComparer
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
namespace MonoTests.System.Collections.Generic {
[TestFixture]
public class EqualityComparerTest {
[Test]
public void Default_GetHashCode_Null ()
{
// https://bugzilla.novell.com/show_bug.cgi?id=372892
Assert.AreEqual (0, EqualityComparer<object>.Default.GetHashCode (null), "object");
Assert.AreEqual (0, EqualityComparer<string>.Default.GetHashCode (null), "string");
}
[Test]
public void NonGenericGetHashCodeForNullArgument ()
{
IEqualityComparer comparer = EqualityComparer<object>.Default;
Assert.AreEqual (0, comparer.GetHashCode (null));
}
[Test] // #703027
public void NonGenericEqualsForNullArguments ()
{
IEqualityComparer comparer = EqualityComparer<object>.Default;
Assert.IsTrue (comparer.Equals (null, null));
}
}
}
#endif

View File

@ -0,0 +1,53 @@
//
// MonoTests.System.Collections.Generic.Test.IListTest
//
// Authors:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// Copyright (C) 2007 Gert Driesen
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections.Generic;
using NUnit.Framework;
namespace MonoTests.System.Collections.Generic
{
[TestFixture]
public class IListTest
{
[Test] // bug #80260
public void CastToArray ()
{
IList<string> list = new string[] { "foo", "bar" };
string[] array = (string[]) list;
Assert.IsNotNull (array, "#1");
Assert.AreEqual (2, array.Length, "#2");
Assert.AreEqual ("foo", array [0], "#3");
Assert.AreEqual ("bar", array [1], "#4");
}
}
}
#endif

File diff suppressed because it is too large Load Diff