Merge pull request #922 from ermshiperete/novell-bug-599689
authorMarek Safar <marek.safar@gmail.com>
Thu, 27 Feb 2014 15:41:04 +0000 (16:41 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 27 Feb 2014 15:41:04 +0000 (16:41 +0100)
Fix Novell bug 599689

mcs/class/System.XML/System.Xml.Schema/XmlSchemaException.cs
mcs/class/System.XML/System.Xml_test.dll.sources
mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaExceptionTests.cs [new file with mode: 0644]

index 649df76f1222ddbfe2b77fba9e59fd842883d1ed..c18c7536a0c55861438425ce6545b6a5d7e3a159 100644 (file)
@@ -157,7 +157,7 @@ namespace System.Xml.Schema
 
                private static string GetMessage (string message, string sourceUri, int lineNumber, int linePosition, XmlSchemaObject sourceObj)
                {
-                       string msg = "XmlSchema error: " + message;
+                       string msg = message;
                        if (lineNumber > 0)
                                msg += String.Format (CultureInfo.InvariantCulture, " XML {0} Line {1}, Position {2}.",
                                        (sourceUri != null && sourceUri != "") ? "URI: " + sourceUri + " ." : "",
index f03ff065a2e535c0b6d435cf8794dbf6f700d616..bf25cf598911e0e75e376f15fee57539aea6c87d 100644 (file)
@@ -105,6 +105,7 @@ System.Xml.Xsl/MsxslScriptTests.cs
 System.Xml/XmlExceptionCas.cs
 System.Xml/XmlSecureResolverCas.cs
 System.Xml.Schema/XmlSchemaExceptionCas.cs
+System.Xml.Schema/XmlSchemaExceptionTests.cs
 System.Xml.Xsl/XsltArgumentListCas.cs
 System.Xml.Xsl/XsltCompileExceptionCas.cs
 System.Xml.Xsl/XsltCompileExceptionTests.cs
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaExceptionTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaExceptionTests.cs
new file mode 100644 (file)
index 0000000..0f34a9c
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (c) 2014 SIL International
+// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)
+//
+// Unit tests for XmlSchemaException
+//
+// Author:
+//     Eberhard Beilharz <eb1@sil.org>
+//
+using System;
+using System.Xml.Schema;
+using NUnit.Framework;
+
+namespace MonoTests.System.Xml
+{
+       [TestFixture]
+       public class XmlSchemaExceptionTests
+       {
+               [Test]
+               public void Bug599689_ToStringMatchesDotNet ()
+               {
+                       Assert.AreEqual ("System.Xml.Schema.XmlSchemaException: Test",
+                               new XmlSchemaException ("Test").ToString (),
+                               "Novell bug #599689 (https://bugzilla.novell.com/show_bug.cgi?id=599689) not fixed.");
+               }
+       }
+}
+