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:
authorAtsushi Eno <atsushieno@gmail.com>2009-04-22 12:08:52 +0400
committerAtsushi Eno <atsushieno@gmail.com>2009-04-22 12:08:52 +0400
commitfb729447e3aadce8776095a09e72301e6d0452aa (patch)
treea30f29e42195e060e355190f82bb23f7cd5eb8ea /mcs/class/System.XML/Test
parent8a93fd5b62b178af93d13e5060556d254bac3fc1 (diff)
2009-04-22 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaValidator.cs : quick fix for bug #496205. Reset xsi:type and endelement. * XmlSchemaValidatorTests.cs : added test for bug #496192 and #496205. * 496192.xml, 496192.xsd : new test files. svn path=/trunk/mcs/; revision=132351
Diffstat (limited to 'mcs/class/System.XML/Test')
-rw-r--r--mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog4
-rw-r--r--mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs8
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/496192.xml8
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/496192.xsd34
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/ChangeLog4
5 files changed, 58 insertions, 0 deletions
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
index 4e63bdf1d58..ee5c0051ce5 100644
--- a/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
+++ b/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaValidatorTests.cs : added test for bug #496192 and #496205.
+
2009-01-30 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaValidatorTests.cs : added test for bug #469713.
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 3f8971ac7a6..b91c7879d0d 100644
--- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
@@ -146,6 +146,14 @@ namespace MonoTests.System.Xml
</Message>";
Validate (xml, xsd);
}
+
+ [Test]
+ public void Bug496192_496205 ()
+ {
+ using (var xmlr = new StreamReader ("Test/XmlFiles/496192.xml"))
+ using (var xsdr = new StreamReader ("Test/XmlFiles/496192.xsd"))
+ Validate (xmlr.ReadToEnd (), xsdr.ReadToEnd ());
+ }
}
}
diff --git a/mcs/class/System.XML/Test/XmlFiles/496192.xml b/mcs/class/System.XML/Test/XmlFiles/496192.xml
new file mode 100644
index 00000000000..3dddc6495e6
--- /dev/null
+++ b/mcs/class/System.XML/Test/XmlFiles/496192.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Person xmlns="http://tempuri.org/Person.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Firstname="Daniel" Lastname="Stutz">
+ <Addresses>
+ <Address Street="Teststreet" ZIP="8000" City="Zich"/>
+ <Address xsi:type="HotelAddress" Street="" ZIP="" City="Angaga" Country="Maldives" RoomNo="34"/>
+ </Addresses>
+</Person>
diff --git a/mcs/class/System.XML/Test/XmlFiles/496192.xsd b/mcs/class/System.XML/Test/XmlFiles/496192.xsd
new file mode 100644
index 00000000000..973f7498baa
--- /dev/null
+++ b/mcs/class/System.XML/Test/XmlFiles/496192.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema id="Person"
+ targetNamespace="http://tempuri.org/Person.xsd"
+ xmlns="http://tempuri.org/Person.xsd"
+ elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="Person" type="Person"/>
+ <xs:complexType name="Person" mixed="false">
+ <xs:sequence>
+ <xs:element name="Addresses" type="ArrayOfAddress" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="Firstname" type="xs:string" use="required"/>
+ <xs:attribute name="Middlename" type="xs:string" use="optional"/>
+ <xs:attribute name="Lastname" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="Address">
+ <xs:attribute name="Street" type="xs:string" use="required"/>
+ <xs:attribute name="ZIP" type="xs:string" use="required"/>
+ <xs:attribute name="City" type="xs:string" use="required"/>
+ <xs:attribute name="Country" type="xs:string" use="optional"/>
+ </xs:complexType>
+ <xs:complexType name="HotelAddress">
+ <xs:complexContent>
+ <xs:extension base="Address">
+ <xs:attribute name="RoomNo" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="ArrayOfAddress">
+ <xs:sequence>
+ <xs:element name="Address" type="Address" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/ChangeLog b/mcs/class/System.XML/Test/XmlFiles/ChangeLog
index eb9746930fa..a298d6e31a5 100644
--- a/mcs/class/System.XML/Test/XmlFiles/ChangeLog
+++ b/mcs/class/System.XML/Test/XmlFiles/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * 496192.xml, 496192.xsd : new test files.
+
2005-10-27 Atsushi Enomoto <atsushi@ximian.com>
* 79683.dtd : added for bug #79683.