Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -358,7 +358,7 @@ namespace MonoTests.System.Xml
XmlDocument document = new XmlDocument ();
document.Load (reader);
document.Validate (null);
} catch (Exception e) {
} catch (Exception) {
if (!shouldFail)
throw;
return;

View File

@ -110,7 +110,7 @@ namespace MonoTests.System.XmlSerialization
try {
Serialize (10, ao);
Assert.Fail ("Should be invalid.");
} catch (InvalidOperationException ex) {
} catch (InvalidOperationException) {
}
}

View File

@ -81,7 +81,7 @@ namespace MonoTests.System.XmlSerialization
try {
ToEnum ("One", values, "Some.Type.Name");
Assert.Fail ("#C1");
} catch (InvalidCastException ex) {
} catch (InvalidCastException) {
}
values.Clear ();
@ -90,7 +90,7 @@ namespace MonoTests.System.XmlSerialization
try {
ToEnum ("One", values, "Some.Type.Name");
Assert.Fail ("#D1");
} catch (InvalidCastException ex) {
} catch (InvalidCastException) {
}
values.Clear ();

View File

@ -668,7 +668,6 @@ namespace MonoTests.System.Xml.XPath
[Test]
public void ReadSubtreeAttributesByIndex ()
{
XmlWriter xw;
XmlDocument doc = new XmlDocument ();
doc.LoadXml ("<u:Timestamp u:Id='ID1' xmlns:u='urn:foo'></u:Timestamp>");
XmlReader r = doc.CreateNavigator ().ReadSubtree ();

View File

@ -929,7 +929,7 @@ namespace MonoTests.System.Xml
if (success)
return;
Assert.Fail (s + "should fail");
} catch (XmlException ex) {
} catch (XmlException) {
if (success)
Assert.Fail (s + "should not fail");
}

View File

@ -2304,21 +2304,6 @@ namespace MonoTests.System.Xml
r.ReadAsync ();
}
Exception RunAsync (Action action)
{
var task = Task<Exception>.Run (async () => {
try {
action ();
return null;
} catch (Exception ex) {
return ex;
}
});
task.Wait ();
Assert.That (task.IsCompleted);
return task.Result;
}
[Test]
public void SimpleAsync ()
{

View File

@ -14,7 +14,7 @@ using System.Text;
using System.Xml;
using System.Xml.Schema;
using NUnit.Framework;
using System.Reflection;
using ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags;
using AssertType = NUnit.Framework.Assert;
@ -443,5 +443,15 @@ namespace MonoTests.System.Xml
var r2 = XmlReader.Create (r, c);
Assert.IsTrue (r2.Settings.Async);
}
[Test]
public void LegacyXmlSettingsAreDisabled ()
{
// Make sure LegacyXmlSettings are always disabled on Mono
// https://bugzilla.xamarin.com/show_bug.cgi?id=60621
var enableLegacyXmlSettingsMethod = typeof(XmlReaderSettings).GetMethod ("EnableLegacyXmlSettings",
BindingFlags.NonPublic | BindingFlags.Static);
Assert.IsFalse ((bool) enableLegacyXmlSettingsMethod.Invoke (null, null));
}
}
}

View File

@ -71,7 +71,9 @@ namespace MonoTests.System.Xml
{
// "normal" path
Evidence e = XmlSecureResolver.CreateEvidenceForUrl (Assembly.GetExecutingAssembly ().Location);
#pragma warning disable 612
Assert.AreEqual (2, e.Count, "Assembly.GetExecutingAssembly ().Location");
#pragma warning restore
bool url = false;
bool zone = false;
IEnumerator en = e.GetHostEnumerator ();
@ -86,7 +88,9 @@ namespace MonoTests.System.Xml
// file://
e = XmlSecureResolver.CreateEvidenceForUrl (Assembly.GetExecutingAssembly ().CodeBase);
#pragma warning disable 612
Assert.AreEqual (2, e.Count, "Assembly.GetExecutingAssembly ().CodeBase");
#pragma warning restore
url = false;
zone = false;
en = e.GetHostEnumerator ();
@ -106,7 +110,9 @@ namespace MonoTests.System.Xml
{
// http://
Evidence e = XmlSecureResolver.CreateEvidenceForUrl ("http://www.go-mono.com");
#pragma warning disable 612
Assert.AreEqual (3, e.Count, "http://www.go-mono.com");
#pragma warning restore
bool url = false;
bool zone = false;
bool site = false;

View File

@ -97,6 +97,7 @@ namespace MonoTests.System.Xml
}
[Test]
[Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
public void TestAsync ()
{
var loc = Assembly.GetExecutingAssembly ().Location;

View File

@ -482,6 +482,7 @@ namespace nist_dom.fundamental
//----------------------------------------------------------------------------
[Test]
[Ignore(".NET DOM implementation does not match W3C DOM specification.")]
public void core0009A()
{
string computedValue = "";//0;
@ -595,6 +596,7 @@ namespace nist_dom.fundamental
//----------------------------------------------------------------------------
[Test]
[Ignore(".NET DOM implementation does not match W3C DOM specification.")]
public void core0011A()
{
string computedValue = "";//"";

View File

@ -1764,7 +1764,7 @@ namespace nist_dom.fundamental
{
employeeIdElement.SetAttributeNode(newAttribute);//.node.
}
catch(System.InvalidOperationException ex)
catch(System.InvalidOperationException)
{
computedValue = "InvalidOperationException";
}

View File

@ -453,7 +453,8 @@ namespace nist_dom.fundamental
//----------------------------------------------------------------------------
[Test]
public void core0008M()
[Ignore(".NET DOM implementation does not match W3C DOM specification.")]
public void core0008M()
{
string computedValue = "";
string expectedValue = "False";