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:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2017-11-24 16:05:39 +0300
committerGitHub <noreply@github.com>2017-11-24 16:05:39 +0300
commit5ef930b5f82c48e1601916aaeb42e53f32e4003b (patch)
tree437a994834afa755c16ebdc7ed260f59e57e44c2 /mcs/class/System.XML
parent7b4dfeebc40cf8c027819b8b7bd85a4e7c87ad50 (diff)
[bcl] Build some assemblies with -warnaserror (#5295)
* [bcl] Build some assemblies with -warnaserror This ensures that we keep the build warning free. We'll only opt-in a few assemblies that already have zero warnings. We also only apply this when using csc as mcs might raise different warnings. For now just opt-in assemblies in the net_4_x profile.
Diffstat (limited to 'mcs/class/System.XML')
-rw-r--r--mcs/class/System.XML/Makefile2
-rwxr-xr-xmcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs2
-rw-r--r--mcs/class/System.XML/Test/System.Xml.Serialization/XmlAttributesTests.cs2
-rw-r--r--mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationReaderTests.cs4
-rw-r--r--mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs1
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs2
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs15
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs6
-rw-r--r--mcs/class/System.XML/Test/System.Xml/nist_dom/fundamental/Element/Element.cs2
9 files changed, 14 insertions, 22 deletions
diff --git a/mcs/class/System.XML/Makefile b/mcs/class/System.XML/Makefile
index 76ec9ecd8e6..59a3bae4024 100644
--- a/mcs/class/System.XML/Makefile
+++ b/mcs/class/System.XML/Makefile
@@ -26,6 +26,8 @@ endif
TEST_LIB_REFS = System.Data System.Core
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+LIBRARY_WARN_AS_ERROR = yes
+
ifneq (bare/,$(intermediate))
LIB_REFS += secxml/System
ifndef MOBILE_PROFILE
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
index 8c5d01cd9bf..bb4935a6ea8 100755
--- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
@@ -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;
diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlAttributesTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlAttributesTests.cs
index 269ef05a6f3..a1104c4bb74 100644
--- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlAttributesTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlAttributesTests.cs
@@ -110,7 +110,7 @@ namespace MonoTests.System.XmlSerialization
try {
Serialize (10, ao);
Assert.Fail ("Should be invalid.");
- } catch (InvalidOperationException ex) {
+ } catch (InvalidOperationException) {
}
}
diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationReaderTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationReaderTests.cs
index d680419129c..ce2b3e75cef 100644
--- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationReaderTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationReaderTests.cs
@@ -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 ();
diff --git a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs
index bed1699a976..71d4e1b795e 100644
--- a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs
@@ -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 ();
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs
index dc21f0ba58f..3b188b7cfbe 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs
@@ -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");
}
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
index 26f461aeb30..764ce368cfc 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
@@ -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 ()
{
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
index 1f4bc137986..ffbb1f50357 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
@@ -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;
diff --git a/mcs/class/System.XML/Test/System.Xml/nist_dom/fundamental/Element/Element.cs b/mcs/class/System.XML/Test/System.Xml/nist_dom/fundamental/Element/Element.cs
index d8661db3889..d0ed6c9f3d4 100644
--- a/mcs/class/System.XML/Test/System.Xml/nist_dom/fundamental/Element/Element.cs
+++ b/mcs/class/System.XML/Test/System.Xml/nist_dom/fundamental/Element/Element.cs
@@ -1764,7 +1764,7 @@ namespace nist_dom.fundamental
{
employeeIdElement.SetAttributeNode(newAttribute);//.node.
}
- catch(System.InvalidOperationException ex)
+ catch(System.InvalidOperationException)
{
computedValue = "InvalidOperationException";
}