Fix #420862
authorRaja R Harinath <harinath@hurrynot.org>
Tue, 18 Nov 2008 18:27:40 +0000 (18:27 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Tue, 18 Nov 2008 18:27:40 +0000 (18:27 -0000)
In class/System.Data/System.Data:
* XmlConstants.cs (QnUnsignedShort): Rename from QnUsigned short
and fix the value too.
* XmlSchemaWriter.cs (XmlQualifiedName): Update to changes.

In class/System.Data/Test/System.Data:
* DataSetTest.cs (Bug420862): New test.

svn path=/trunk/mcs/; revision=119197

mcs/class/System.Data/System.Data/ChangeLog
mcs/class/System.Data/System.Data/XmlConstants.cs
mcs/class/System.Data/System.Data/XmlSchemaWriter.cs
mcs/class/System.Data/Test/System.Data/ChangeLog
mcs/class/System.Data/Test/System.Data/DataSetTest.cs

index f6904449278491c45df00c8f826d582808f34d20..ed159971210ada997d77c4ed5abe815b71e2077a 100644 (file)
@@ -1,3 +1,10 @@
+2008-11-18  Raja R Harinath  <harinath@hurrynot.org>
+
+       Fix #420862
+       * XmlConstants.cs (QnUnsignedShort): Rename from QnUsigned short
+       and fix the value too.
+       * XmlSchemaWriter.cs (XmlQualifiedName): Update to changes.
+
 2008-09-27  Raja R Harinath  <harinath@hurrynot.org>
 
        * DataView.cs: Convert into a partial class and sequester
index 9314805cbd3a20d8803bd99a3705be9a7f483d49..d23591f1202cc54a417d60ea5b9371e1f4235e39 100644 (file)
@@ -120,7 +120,7 @@ internal class XmlConstants
        public static XmlQualifiedName QnSbyte = new XmlQualifiedName ("byte", XmlSchema.Namespace);
        public static XmlQualifiedName QnFloat = new XmlQualifiedName ("float", XmlSchema.Namespace);
        public static XmlQualifiedName QnDuration = new XmlQualifiedName ("duration", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUsignedShort = new XmlQualifiedName ("usignedShort", XmlSchema.Namespace);
+       public static XmlQualifiedName QnUnsignedShort = new XmlQualifiedName ("unsignedShort", XmlSchema.Namespace);
        public static XmlQualifiedName QnUnsignedInt = new XmlQualifiedName ("unsignedInt", XmlSchema.Namespace);
        public static XmlQualifiedName QnUnsignedLong = new XmlQualifiedName ("unsignedLong", XmlSchema.Namespace);
        public static XmlQualifiedName QnUri = new XmlQualifiedName ("anyURI", XmlSchema.Namespace);
index 24ae106e04b02d17e00af4b792290c207c19644d..4a94e6ec866989a2787a6aecc9d0e56d35753603 100644 (file)
@@ -881,7 +881,7 @@ namespace System.Data
                                case TypeCode.Double: return XmlConstants.QnDouble;
                                case TypeCode.SByte: return XmlConstants.QnSbyte;
                                case TypeCode.Single: return XmlConstants.QnFloat;
-                               case TypeCode.UInt16: return XmlConstants.QnUsignedShort;
+                               case TypeCode.UInt16: return XmlConstants.QnUnsignedShort;
                                case TypeCode.UInt32: return XmlConstants.QnUnsignedInt;
                                case TypeCode.UInt64: return XmlConstants.QnUnsignedLong;
                        }
index adeaf60b9f6b6dcc88bbe67b35f1dafe74fa0d71..b98ea97b4398a751c5a626e725bac8ed7f8e32c5 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-18  Raja R Harinath  <harinath@hurrynot.org>
+
+       * DataSetTest.cs (Bug420862): New test.
+
 2008-09-16  brandin claar  <brandin.claar@gmail.com>
 
        * BinarySerializationTest.cs (TestDefaultValues): New.
index b7e10146717c8cdef6353a82fc42d7847d7e1234..1c28b166c1aeadffc1dda0bf10094245176e85b2 100644 (file)
@@ -37,6 +37,7 @@
 using NUnit.Framework;
 using System;
 using System.Xml;
+using System.Xml.Schema;
 using System.Xml.Serialization;
 using System.IO;
 using System.Data;
@@ -2089,6 +2090,33 @@ namespace MonoTests.System.Data
                                "deserialization after modification oes not give current values");
                 }
 
+               [Test]
+               public void Bug420862 ()
+               {
+                       DataSet ds = new DataSet ("d");
+                       DataTable dt = ds.Tables.Add ("t");
+                       dt.Columns.Add ("c", typeof (ushort));
+
+                       XmlSchema xs = XmlSchema.Read (new StringReader (ds.GetXmlSchema ()), null);
+                       xs.Compile (null);
+
+                       // follow the nesting of the schema in the foreach
+                       foreach (XmlSchemaElement d in xs.Items) {
+                               Assert.AreEqual ("d", d.Name);
+                               XmlSchemaChoice dsc = (XmlSchemaChoice) ((XmlSchemaComplexType) d.SchemaType).Particle;
+                               foreach (XmlSchemaElement t in dsc.Items) {
+                                       Assert.AreEqual ("t", t.Name);
+                                       XmlSchemaSequence tss = (XmlSchemaSequence) ((XmlSchemaComplexType) t.SchemaType).Particle;
+                                       foreach (XmlSchemaElement c in tss.Items) {
+                                               Assert.AreEqual ("c", c.Name);
+                                               Assert.AreEqual ("unsignedShort", c.SchemaTypeName.Name);
+                                               return;
+                                       }
+                               }
+                       }
+                       Assert.Fail ();
+               }
+
                 /// <summary>
                 /// Test for testing DataSet.Clear method with foriegn key relations
                 /// This is expected to clear all the related datatable rows also