Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -189,21 +189,15 @@ namespace MonoTests.System.Collections.Specialized
{
BitVector32.Section s1 = BitVector32.CreateSection (32767);
BitVector32.Section s2 = BitVector32.CreateSection (32767, s1);
try {
BitVector32.Section s3 = BitVector32.CreateSection (4, s2);
Assert.Fail("Illegal section created");
} catch (ArgumentException) {}
BitVector32.Section s3 = BitVector32.CreateSection (4, s2);
}
[Test]
public void NegativeIndexer ()
{
BitVector32 bv = new BitVector32 (-1);
#if NET_2_0
Assert.IsTrue (bv [Int32.MinValue], "Int32.MinValue");
#else
Assert.IsFalse (bv [Int32.MinValue], "Int32.MinValue");
#endif
}
[Test]

View File

@@ -72,9 +72,7 @@ namespace MonoTests.System.Collections.Specialized
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#endif
public void Empty ()
{
HybridDictionary hd = new HybridDictionary ();

View File

@@ -62,11 +62,9 @@ namespace MonoCasTests.System.Collections.Specialized {
unit.GetObjectData ();
unit.GetAllValues_Type ();
unit.GetAllValues ();
#if NET_2_0
unit.Constructor_IEqualityComparer ();
unit.Constructor_Int_IEqualityComparer ();
unit.GetObjectData_IEqualityComparer ();
#endif
}
[Test]

View File

@@ -58,7 +58,6 @@ namespace MonoTests.System.Collections.Specialized {
{
}
#if NET_2_0
public UnitTestNameObjectCollectionBase (IEqualityComparer comparer)
: base (comparer)
{
@@ -68,7 +67,6 @@ namespace MonoTests.System.Collections.Specialized {
: base (capacity, comparer)
{
}
#endif
public bool _IsReadOnly {
get { return base.IsReadOnly; }
set { base.IsReadOnly = value; }
@@ -218,7 +216,6 @@ namespace MonoTests.System.Collections.Specialized {
{
new UnitTestNameObjectCollectionBase (Int32.MinValue);
}
#if NET_2_0
[Test]
public void Constructor_IEqualityComparer ()
{
@@ -281,7 +278,6 @@ namespace MonoTests.System.Collections.Specialized {
}
}
}
#endif
[Test]
public void Constructor_Provider_Comparer ()
{
@@ -443,7 +439,6 @@ namespace MonoTests.System.Collections.Specialized {
UnitTestNameObjectCollectionBase coll = new UnitTestNameObjectCollectionBase ();
coll.Add ("a", "!");
coll._IsReadOnly = true;
#if NET_2_0
try {
coll.Set (0, "1");
Assert.Fail ("#1");
@@ -453,10 +448,6 @@ namespace MonoTests.System.Collections.Specialized {
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
#else
coll.Set (0, "1");
Assert.AreEqual ("1", coll.Get (0), "Get(0)");
#endif
}
[Test]
@@ -499,7 +490,6 @@ namespace MonoTests.System.Collections.Specialized {
public void CopyTo_Array_Null ()
{
UnitTestNameObjectCollectionBase c = new UnitTestNameObjectCollectionBase ();
#if NET_2_0
try {
((ICollection)c).CopyTo (null, 0);
Assert.Fail ("#A1");
@@ -510,16 +500,12 @@ namespace MonoTests.System.Collections.Specialized {
Assert.IsNotNull (ex.ParamName, "#A5");
Assert.AreEqual ("array", ex.ParamName, "#A6");
}
#else
((ICollection) c).CopyTo (null, 0);
#endif
c.Add ("1", "mono");
try {
((ICollection) c).CopyTo (null, 0);
Assert.Fail ("#B1");
#if NET_2_0
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#B2");
Assert.IsNull (ex.InnerException, "#B3");
@@ -527,10 +513,6 @@ namespace MonoTests.System.Collections.Specialized {
Assert.IsNotNull (ex.ParamName, "#B5");
Assert.AreEqual ("array", ex.ParamName, "#B6");
}
#else
} catch (NullReferenceException) {
}
#endif
}
[Test]
@@ -542,21 +524,12 @@ namespace MonoTests.System.Collections.Specialized {
try {
((ICollection) c).CopyTo (array, -1);
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsNotNull (ex.ParamName, "#5");
}
#else
} catch (IndexOutOfRangeException ex) {
// Index was outside the bounds of the array
Assert.AreEqual (typeof (IndexOutOfRangeException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
#endif
}
[Test]
@@ -571,7 +544,6 @@ namespace MonoTests.System.Collections.Specialized {
try {
((ICollection) c).CopyTo (array, 2);
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentException ex) {
// Insufficient space in the target location to
// copy the information
@@ -580,14 +552,6 @@ namespace MonoTests.System.Collections.Specialized {
Assert.IsNotNull (ex.Message, "#4");
Assert.IsNull (ex.ParamName, "#5");
}
#else
} catch (IndexOutOfRangeException ex) {
// Index was outside the bounds of the array
Assert.AreEqual (typeof (IndexOutOfRangeException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
#endif
}
[Test]

View File

@@ -70,10 +70,8 @@ namespace MonoCasTests.System.Collections.Specialized {
unit.CaseInsensitive ();
unit.CopyTo ();
unit.Remove ();
#if NET_2_0
unit.Constructor_IEqualityComparer ();
unit.Constructor_Int_IEqualityComparer ();
#endif
}
[Test]

View File

@@ -201,11 +201,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Add_NVC_Null ()
{
new NameValueCollection ().Add (null);
@@ -340,11 +336,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (InvalidCastException))]
#else
[ExpectedException (typeof (ArrayTypeMismatchException))]
#endif
public void CopyTo_WrongTypeArray ()
{
Array a = Array.CreateInstance (typeof (DateTime), 3);
@@ -385,28 +377,19 @@ namespace MonoTests.System.Collections.Specialized {
}
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Constructor_Null_NVC ()
{
NameValueCollection nvc = new NameValueCollection((NameValueCollection)null);
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Constructor_Capacity_Null_NVC ()
{
NameValueCollection nvc = new NameValueCollection(10, (NameValueCollection)null);
}
#if NET_2_0
[Test]
public void Constructor_IEqualityComparer ()
{
@@ -448,7 +431,6 @@ namespace MonoTests.System.Collections.Specialized {
Assert.AreEqual (c2.Get ("KEY"), "value", "Constructor_NameValueCollection");
c2.Remove ("key");
}
#endif
class MyNVC : NameValueCollection
{
List<string> log;

View File

@@ -74,7 +74,7 @@ namespace MonoTests.System.Collections.Specialized {
[Test]
public void SimpleSyncRoot()
{
Assert.AreEqual(sc, sc.SyncRoot);
Assert.AreNotSame(sc, sc.SyncRoot);
}
[Test]

View File

@@ -57,11 +57,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void This_Null ()
{
StringDictionary sd = new StringDictionary ();
@@ -100,11 +96,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Add_NullKey ()
{
StringDictionary sd = new StringDictionary ();
@@ -112,11 +104,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void ContainsKey_Null ()
{
StringDictionary sd = new StringDictionary ();
@@ -124,11 +112,7 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Remove_Null ()
{
StringDictionary sd = new StringDictionary ();