Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -348,7 +348,7 @@ namespace MonoTests.System.Drawing {
colconv.ConvertFromInvariantString ("hello");
Assert.Fail ("#1");
} catch (Exception ex) {
Assert.AreEqual (typeof (Exception), ex.GetType (), "#2");
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.InnerException, "#3");
Assert.AreEqual (typeof (FormatException), ex.InnerException.GetType (), "#3");
}
@@ -376,7 +376,7 @@ namespace MonoTests.System.Drawing {
colconv.ConvertFromString ("hello");
Assert.Fail ("#1");
} catch (Exception ex) {
Assert.AreEqual (typeof (Exception), ex.GetType (), "#2");
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.InnerException, "#3");
Assert.AreEqual (typeof (FormatException), ex.InnerException.GetType (), "#3");
}
@@ -413,7 +413,7 @@ namespace MonoTests.System.Drawing {
[Test]
public void ConvertFromString_FromHtml_PoundTooLarge ()
{
Assert.Throws<Exception> (() => colconv.ConvertFromString ("#100000000"));
Assert.Throws<ArgumentException> (() => colconv.ConvertFromString ("#100000000"));
}
}
}

View File

@@ -86,19 +86,19 @@ namespace MonoTests.System.Drawing {
[Test]
public void FromHtml_PoundNegative ()
{
Assert.Throws<Exception> (() => ColorTranslator.FromHtml ("#-1"));
Assert.Throws<ArgumentException> (() => ColorTranslator.FromHtml ("#-1"));
}
[Test]
public void FromHtml_PoundTooLarge ()
{
Assert.Throws<Exception> (() => ColorTranslator.FromHtml ("#100000000"));
Assert.Throws<ArgumentException> (() => ColorTranslator.FromHtml ("#100000000"));
}
[Test]
public void FromHtml_Unknown ()
{
Assert.Throws<Exception> (() => ColorTranslator.FromHtml ("unknown-color-test"));
Assert.Throws<ArgumentException> (() => ColorTranslator.FromHtml ("unknown-color-test"));
}
[Test]

View File

@@ -1260,6 +1260,7 @@ namespace MonoTests.System.Drawing {
}
}
#if !MOBILE
private void Compare (KnownColor kc, GetSysColorIndex index)
{
// we get BGR than needs to be converted into ARGB
@@ -1307,6 +1308,7 @@ namespace MonoTests.System.Drawing {
Compare (KnownColor.MenuBar, GetSysColorIndex.COLOR_MENUBAR);
Compare (KnownColor.MenuHighlight, GetSysColorIndex.COLOR_MENUHIGHLIGHT);
}
#endif
}
}

View File

@@ -195,11 +195,11 @@ namespace MonoTests.System.Drawing{
[Test]
public void GetHashCodeTest ()
{
Assert.AreEqual (0, pt1_1.GetHashCode (), "#1");
Assert.AreEqual (1, pt1_0.GetHashCode (), "#2");
Assert.AreEqual (32, pt1_1.GetHashCode (), "#1");
Assert.AreEqual (33, pt1_0.GetHashCode (), "#2");
Assert.AreEqual (1, pt0_1.GetHashCode (), "#3");
Point pt = new Point(0xFF, 0xFF00);
Assert.AreEqual (0xFFFF, pt.GetHashCode (), "#4");
Assert.AreEqual (57311, pt.GetHashCode (), "#4");
}
[Test]

View File

@@ -254,7 +254,7 @@ namespace MonoTests.System.Drawing
Hashtable ht = new Hashtable ();
ht.Add ("Width", 10);
ht.Add ("Height", 20);
Assert.Throws<InvalidCastException> (() => szconv.CreateInstance (null, ht));
Assert.Throws<ArgumentException> (() => szconv.CreateInstance (null, ht));
}
[Test]
@@ -263,7 +263,7 @@ namespace MonoTests.System.Drawing
Hashtable ht = new Hashtable ();
ht.Add ("width", 20);
ht.Add ("Height", 30);
Assert.Throws<NullReferenceException> (() => szconv.CreateInstance (null, ht));
Assert.Throws<ArgumentException> (() => szconv.CreateInstance (null, ht));
}
[Test]