[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-patches
Subject: [Mono-patches] r99458 - trunk/mcs/class/System.XML/Test/System.Xml
From: "Gert Driesen (gert.driesen () pandora ! be)"
Date: 2008-03-31 19:04:17
Message-ID: 20080331190417.CFF219472C () mono-cvs ! ximian ! com
[Download RAW message or body]
Author: gert
Date: 2008-03-31 14:04:17 -0500 (Mon, 31 Mar 2008)
New Revision: 99458
Modified:
trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
trunk/mcs/class/System.XML/Test/System.Xml/NameTableTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlAttributeCollectionTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlCDataSectionTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlCharTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlCharacterDataTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlCommentTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDeclarationTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDefaultReader.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentFragmentTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTypeTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityReferenceTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlNamespaceManagerTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeListTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeReaderTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlProcessingInstructionTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlSignificantWhitespaceTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlTextTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlWhiteSpaceTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs
trunk/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs
Log:
* XmlDocumentTests.cs: Fixed line endings.
* XmlAttributeCollectionTests.cs: Fixed line endings.
* XmlDocumentEventTests.cs: Fixed line endings.
* XmlNodeTests.cs: Fixed line endings.
* XsdValidatingReaderTests.cs: Fixed line endings.
* XmlDocumentTypeTests.cs: Fixed line endings.
* XmlEntityReferenceTests.cs: Fixed line endings.
Modified: trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2008-03-31 18:58:04 UTC (rev \
99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2008-03-31 19:04:17 UTC (rev \
99458) @@ -1,5 +1,15 @@
2008-03-31 Gert Driesen <drieseng@users.sourceforge.net>
+ * XmlDocumentTests.cs: Fixed line endings.
+ * XmlAttributeCollectionTests.cs: Fixed line endings.
+ * XmlDocumentEventTests.cs: Fixed line endings.
+ * XmlNodeTests.cs: Fixed line endings.
+ * XsdValidatingReaderTests.cs: Fixed line endings.
+ * XmlDocumentTypeTests.cs: Fixed line endings.
+ * XmlEntityReferenceTests.cs: Fixed line endings.
+
+2008-03-31 Gert Driesen <drieseng@users.sourceforge.net>
+
* XmlAttributeTests.cs: Use Assert instead of deprecated Assertion
class. Improved a few tests. Added link to MS bug report for regression
in .NET 2.0. Numbered tests.
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/NameTableTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlAttributeCollectionTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlAttributeCollectionTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlAttributeCollectionTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -148,29 +148,29 @@
[Test]
public void InsertAfterReplacesInCorrectOrder ()
{
- XmlDocument testDoc = new XmlDocument ();
- XmlElement testElement = testDoc.CreateElement ("TestElement" );
- testDoc.AppendChild (testElement);
-
- XmlAttribute testAttr1 = testDoc.CreateAttribute ("TestAttribute1");
- testAttr1.Value = "First attribute";
- testElement.Attributes.Prepend (testAttr1);
-
- XmlAttribute testAttr2 = testDoc.CreateAttribute ("TestAttribute2");
- testAttr2.Value = "Second attribute";
- testElement.Attributes.InsertAfter (testAttr2, testAttr1);
-
- XmlAttribute testAttr3 = testDoc.CreateAttribute ("TestAttribute3");
- testAttr3.Value = "Third attribute";
- testElement.Attributes.InsertAfter (testAttr3, testAttr2);
-
- XmlAttribute outOfOrder = testDoc.CreateAttribute ("TestAttribute2");
- outOfOrder.Value = "Should still be second attribute";
- testElement.Attributes.InsertAfter (outOfOrder, testElement.Attributes [0]);
-
- AssertEquals ("First attribute", testElement.Attributes [0].Value);
- AssertEquals ("Should still be second attribute", testElement.Attributes \
[1].Value);
- AssertEquals ("Third attribute", testElement.Attributes [2].Value);
+ XmlDocument testDoc = new XmlDocument ();
+ XmlElement testElement = testDoc.CreateElement ("TestElement" );
+ testDoc.AppendChild (testElement);
+
+ XmlAttribute testAttr1 = testDoc.CreateAttribute ("TestAttribute1");
+ testAttr1.Value = "First attribute";
+ testElement.Attributes.Prepend (testAttr1);
+
+ XmlAttribute testAttr2 = testDoc.CreateAttribute ("TestAttribute2");
+ testAttr2.Value = "Second attribute";
+ testElement.Attributes.InsertAfter (testAttr2, testAttr1);
+
+ XmlAttribute testAttr3 = testDoc.CreateAttribute ("TestAttribute3");
+ testAttr3.Value = "Third attribute";
+ testElement.Attributes.InsertAfter (testAttr3, testAttr2);
+
+ XmlAttribute outOfOrder = testDoc.CreateAttribute ("TestAttribute2");
+ outOfOrder.Value = "Should still be second attribute";
+ testElement.Attributes.InsertAfter (outOfOrder, testElement.Attributes [0]);
+
+ AssertEquals ("First attribute", testElement.Attributes [0].Value);
+ AssertEquals ("Should still be second attribute", testElement.Attributes \
[1].Value); + AssertEquals ("Third attribute", testElement.Attributes [2].Value);
}
[Test]
@@ -200,18 +200,18 @@
{
string dtd = "<!DOCTYPE root [<!ELEMENT root EMPTY><!ATTLIST root attr CDATA \
'default'>]>"; string xml = dtd + "<root/>";
- XmlDocument doc = new XmlDocument();
- doc.LoadXml (xml);
-
- doc.DocumentElement.Attributes ["attr"].Value = "modified";
- doc.DocumentElement.RemoveAttribute("attr");
-
- XmlAttribute defAttr = doc.DocumentElement.Attributes ["attr"];
- AssertNotNull (defAttr);
- AssertEquals ("default", defAttr.Value);
+ XmlDocument doc = new XmlDocument();
+ doc.LoadXml (xml);
- defAttr.Value = "default"; // same value as default
- AssertEquals (true, defAttr.Specified);
+ doc.DocumentElement.Attributes ["attr"].Value = "modified";
+ doc.DocumentElement.RemoveAttribute("attr");
+
+ XmlAttribute defAttr = doc.DocumentElement.Attributes ["attr"];
+ AssertNotNull (defAttr);
+ AssertEquals ("default", defAttr.Value);
+
+ defAttr.Value = "default"; // same value as default
+ AssertEquals (true, defAttr.Specified);
}
}
}
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlAttributeCollectionTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlCDataSectionTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlCharTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlCharacterDataTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlCommentTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlDeclarationTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlDefaultReader.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -89,29 +89,29 @@
XmlElement el = document.CreateElement ("root");
el.AppendChild (document.CreateTextNode ("simple text node."));
document.AppendChild (el);
- AssertEquals (
-@"Inserting: Text into Element.
-Inserted: Text into Element.
-Inserting: Element into Document.
-Inserted: Element into Document.
-", EventLog);
+ AssertEquals (
+ "Inserting: Text into Element.\n" +
+ "Inserted: Text into Element.\n" +
+ "Inserting: Element into Document.\n" +
+ "Inserted: Element into Document.\n",
+ EventLog);
}
[Test]
- public void DefaultAttributeRemoval ()
- {
- XmlDocument doc = new XmlDocument ();
- doc.LoadXml ("<!DOCTYPE root [<!ELEMENT root (#PCDATA)><!ATTLIST root foo CDATA \
'foo-def'>]><root></root>");
- SetEvents (doc);
- doc.DocumentElement.RemoveAll ();
- AssertEquals (
-@"Removing: Attribute from Element.
-Removed: Attribute from Element.
-Inserting: Text into Attribute.
-Inserted: Text into Attribute.
-Inserting: Attribute into Element.
-Inserted: Attribute into Element.
-", EventLog);
- }
+ public void DefaultAttributeRemoval ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ doc.LoadXml ("<!DOCTYPE root [<!ELEMENT root (#PCDATA)><!ATTLIST root foo CDATA \
'foo-def'>]><root></root>"); + SetEvents (doc);
+ doc.DocumentElement.RemoveAll ();
+ AssertEquals (
+ "Removing: Attribute from Element.\n" +
+ "Removed: Attribute from Element.\n" +
+ "Inserting: Text into Attribute.\n" +
+ "Inserted: Text into Attribute.\n" +
+ "Inserting: Attribute into Element.\n" +
+ "Inserted: Attribute into Element.\n",
+ EventLog);
+ }
}
}
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentFragmentTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -599,63 +599,63 @@
[Test]
public void GetElementsByTagNameNs2 ()
{
- document.LoadXml (@"<root>
- <x:a xmlns:x='urn:foo' id='a'>
- <y:a xmlns:y='urn:foo' id='b'/>
- <x:a id='c' />
- <z id='d' />
- text node
- <?a processing instruction ?>
- <x:w id='e'/>
- </x:a>
- </root>");
- // id='b' has different prefix. Should not caught by (name),
- // while should caught by (name, ns).
- XmlNodeList nl = document.GetElementsByTagName ("x:a");
- AssertEquals (2, nl.Count);
- AssertEquals ("a", nl [0].Attributes ["id"].Value);
- AssertEquals ("c", nl [1].Attributes ["id"].Value);
+ document.LoadXml (@"<root>
+ <x:a xmlns:x='urn:foo' id='a'>
+ <y:a xmlns:y='urn:foo' id='b'/>
+ <x:a id='c' />
+ <z id='d' />
+ text node
+ <?a processing instruction ?>
+ <x:w id='e'/>
+ </x:a>
+ </root>");
+ // id='b' has different prefix. Should not caught by (name),
+ // while should caught by (name, ns).
+ XmlNodeList nl = document.GetElementsByTagName ("x:a");
+ AssertEquals (2, nl.Count);
+ AssertEquals ("a", nl [0].Attributes ["id"].Value);
+ AssertEquals ("c", nl [1].Attributes ["id"].Value);
- nl = document.GetElementsByTagName ("a", "urn:foo");
- AssertEquals (3, nl.Count);
- AssertEquals ("a", nl [0].Attributes ["id"].Value);
- AssertEquals ("b", nl [1].Attributes ["id"].Value);
- AssertEquals ("c", nl [2].Attributes ["id"].Value);
+ nl = document.GetElementsByTagName ("a", "urn:foo");
+ AssertEquals (3, nl.Count);
+ AssertEquals ("a", nl [0].Attributes ["id"].Value);
+ AssertEquals ("b", nl [1].Attributes ["id"].Value);
+ AssertEquals ("c", nl [2].Attributes ["id"].Value);
// name wildcard
- nl = document.GetElementsByTagName ("*");
- AssertEquals (6, nl.Count);
- AssertEquals ("root", nl [0].Name);
- AssertEquals ("a", nl [1].Attributes ["id"].Value);
- AssertEquals ("b", nl [2].Attributes ["id"].Value);
- AssertEquals ("c", nl [3].Attributes ["id"].Value);
- AssertEquals ("d", nl [4].Attributes ["id"].Value);
- AssertEquals ("e", nl [5].Attributes ["id"].Value);
+ nl = document.GetElementsByTagName ("*");
+ AssertEquals (6, nl.Count);
+ AssertEquals ("root", nl [0].Name);
+ AssertEquals ("a", nl [1].Attributes ["id"].Value);
+ AssertEquals ("b", nl [2].Attributes ["id"].Value);
+ AssertEquals ("c", nl [3].Attributes ["id"].Value);
+ AssertEquals ("d", nl [4].Attributes ["id"].Value);
+ AssertEquals ("e", nl [5].Attributes ["id"].Value);
// wildcard - local and ns
- nl = document.GetElementsByTagName ("*", "*");
- AssertEquals (6, nl.Count);
- AssertEquals ("root", nl [0].Name);
- AssertEquals ("a", nl [1].Attributes ["id"].Value);
- AssertEquals ("b", nl [2].Attributes ["id"].Value);
- AssertEquals ("c", nl [3].Attributes ["id"].Value);
- AssertEquals ("d", nl [4].Attributes ["id"].Value);
- AssertEquals ("e", nl [5].Attributes ["id"].Value);
+ nl = document.GetElementsByTagName ("*", "*");
+ AssertEquals (6, nl.Count);
+ AssertEquals ("root", nl [0].Name);
+ AssertEquals ("a", nl [1].Attributes ["id"].Value);
+ AssertEquals ("b", nl [2].Attributes ["id"].Value);
+ AssertEquals ("c", nl [3].Attributes ["id"].Value);
+ AssertEquals ("d", nl [4].Attributes ["id"].Value);
+ AssertEquals ("e", nl [5].Attributes ["id"].Value);
// namespace wildcard - namespace
- nl = document.GetElementsByTagName ("*", "urn:foo");
- AssertEquals (4, nl.Count);
- AssertEquals ("a", nl [0].Attributes ["id"].Value);
- AssertEquals ("b", nl [1].Attributes ["id"].Value);
- AssertEquals ("c", nl [2].Attributes ["id"].Value);
- AssertEquals ("e", nl [3].Attributes ["id"].Value);
+ nl = document.GetElementsByTagName ("*", "urn:foo");
+ AssertEquals (4, nl.Count);
+ AssertEquals ("a", nl [0].Attributes ["id"].Value);
+ AssertEquals ("b", nl [1].Attributes ["id"].Value);
+ AssertEquals ("c", nl [2].Attributes ["id"].Value);
+ AssertEquals ("e", nl [3].Attributes ["id"].Value);
// namespace wildcard - local only. I dare say, such usage is not XML-ish!
- nl = document.GetElementsByTagName ("a", "*");
- AssertEquals (3, nl.Count);
- AssertEquals ("a", nl [0].Attributes ["id"].Value);
- AssertEquals ("b", nl [1].Attributes ["id"].Value);
- AssertEquals ("c", nl [2].Attributes ["id"].Value);
+ nl = document.GetElementsByTagName ("a", "*");
+ AssertEquals (3, nl.Count);
+ AssertEquals ("a", nl [0].Attributes ["id"].Value);
+ AssertEquals ("b", nl [1].Attributes ["id"].Value);
+ AssertEquals ("c", nl [2].Attributes ["id"].Value);
}
[Test]
@@ -1087,36 +1087,36 @@
[Test]
public void LoadEntityReference ()
{
- string xml = "<!DOCTYPE root [<!ELEMENT root (#PCDATA)*><!ENTITY ent \
'val'>]><root attr='a &ent; string'>&ent;</root>";
- XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
- XmlDocument doc = new XmlDocument ();
- doc.Load (xtr);
- AssertEquals ("#text node", XmlNodeType.EntityReference,
- doc.DocumentElement.FirstChild.NodeType);
- AssertEquals ("#attribute", XmlNodeType.EntityReference,
- doc.DocumentElement.Attributes [0].ChildNodes [1].NodeType);
+ string xml = "<!DOCTYPE root [<!ELEMENT root (#PCDATA)*><!ENTITY ent \
'val'>]><root attr='a &ent; string'>&ent;</root>"; + XmlTextReader xtr = new \
XmlTextReader (xml, XmlNodeType.Document, null); + XmlDocument doc = new \
XmlDocument (); + doc.Load (xtr);
+ AssertEquals ("#text node", XmlNodeType.EntityReference,
+ doc.DocumentElement.FirstChild.NodeType);
+ AssertEquals ("#attribute", XmlNodeType.EntityReference,
+ doc.DocumentElement.Attributes [0].ChildNodes [1].NodeType);
}
[Test]
public void ReadNodeEmptyContent ()
{
- XmlTextReader xr = new XmlTextReader ("", XmlNodeType.Element, null);
- xr.Read ();
- Console.WriteLine (xr.NodeType);
- XmlNode n = document.ReadNode (xr);
- AssertNull (n);
+ XmlTextReader xr = new XmlTextReader ("", XmlNodeType.Element, null);
+ xr.Read ();
+ Console.WriteLine (xr.NodeType);
+ XmlNode n = document.ReadNode (xr);
+ AssertNull (n);
}
[Test]
public void ReadNodeWhitespace ()
{
- XmlTextReader xr = new XmlTextReader (" ", XmlNodeType.Element, null);
- xr.Read ();
- Console.WriteLine (xr.NodeType);
+ XmlTextReader xr = new XmlTextReader (" ", XmlNodeType.Element, null);
+ xr.Read ();
+ Console.WriteLine (xr.NodeType);
document.PreserveWhitespace = false; // Note this line.
- XmlNode n = document.ReadNode (xr);
- AssertNotNull (n);
- AssertEquals (XmlNodeType.Whitespace, n.NodeType);
+ XmlNode n = document.ReadNode (xr);
+ AssertNotNull (n);
+ AssertEquals (XmlNodeType.Whitespace, n.NodeType);
}
[Test]
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTypeTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTypeTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTypeTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -92,13 +92,13 @@
[ExpectedException (typeof (XmlException))]
public void IncorrectInternalSubset ()
{
- XmlDocument doc = new XmlDocument ();
- XmlDocumentType doctype = doc.CreateDocumentType (
- "root", "public-hogehoge", null,
- "invalid_intsubset");
- doctype = doc.CreateDocumentType ("root",
- "public-hogehoge", null,
- "<!ENTITY % pe1 '>'> <!ELEMENT e EMPTY%pe1;");
+ XmlDocument doc = new XmlDocument ();
+ XmlDocumentType doctype = doc.CreateDocumentType (
+ "root", "public-hogehoge", null,
+ "invalid_intsubset");
+ doctype = doc.CreateDocumentType ("root",
+ "public-hogehoge", null,
+ "<!ENTITY % pe1 '>'> <!ELEMENT e EMPTY%pe1;");
}
[Test]
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlDocumentTypeTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityReferenceTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityReferenceTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityReferenceTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -32,51 +32,51 @@
[Test]
public void DescendantsRecursively ()
{
- string dtd = "<!DOCTYPE root [<!ELEMENT root (#PCDATA)*>"
- + "<!ENTITY ent 'value'>"
- + "<!ENTITY ent2 'my &ent; string'>"
- + "]>";
- string xml = dtd + "<root>&ent;</root>";
- XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
- XmlDocument doc = new XmlDocument ();
- doc.Load (xtr);
- XmlEntity ent = (XmlEntity) doc.DocumentType.Entities.GetNamedItem ("ent2");
- AssertEquals ("ent2", ent.Name);
- AssertEquals ("my ", ent.FirstChild.Value);
- AssertNotNull (ent.FirstChild.NextSibling.FirstChild);
- AssertEquals ("value", ent.FirstChild.NextSibling.FirstChild.Value);
+ string dtd = "<!DOCTYPE root [<!ELEMENT root (#PCDATA)*>"
+ + "<!ENTITY ent 'value'>"
+ + "<!ENTITY ent2 'my &ent; string'>"
+ + "]>";
+ string xml = dtd + "<root>&ent;</root>";
+ XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
+ XmlDocument doc = new XmlDocument ();
+ doc.Load (xtr);
+ XmlEntity ent = (XmlEntity) doc.DocumentType.Entities.GetNamedItem ("ent2");
+ AssertEquals ("ent2", ent.Name);
+ AssertEquals ("my ", ent.FirstChild.Value);
+ AssertNotNull (ent.FirstChild.NextSibling.FirstChild);
+ AssertEquals ("value", ent.FirstChild.NextSibling.FirstChild.Value);
}
[Test]
public void ChildNodes ()
{
- XmlTextReader xtr = new XmlTextReader ("<!DOCTYPE root [<!ENTITY ent \
'ent-value'><!ENTITY el '<foo>hoge</foo><bar/>'>]><root/>",
- XmlNodeType.Document, null);
- XmlDocument doc = new XmlDocument ();
-
- doc.Load (xtr);
- XmlEntityReference ent = doc.CreateEntityReference ("ent");
- // ChildNodes are not added yet.
- AssertNull (ent.FirstChild);
- doc.DocumentElement.AppendChild (ent);
- // ChildNodes are added here.
- AssertNotNull (ent.FirstChild);
-
- ent = doc.CreateEntityReference ("foo");
- AssertNull (ent.FirstChild);
- // Entity value is empty when the matching DTD entity
- // node does not exist.
- doc.DocumentElement.AppendChild (ent);
- AssertNotNull (ent.FirstChild);
-
- AssertEquals (String.Empty, ent.FirstChild.Value);
+ XmlTextReader xtr = new XmlTextReader ("<!DOCTYPE root [<!ENTITY ent \
'ent-value'><!ENTITY el '<foo>hoge</foo><bar/>'>]><root/>", \
+ XmlNodeType.Document, null); + XmlDocument doc = new XmlDocument ();
+ doc.Load (xtr);
+ XmlEntityReference ent = doc.CreateEntityReference ("ent");
+ // ChildNodes are not added yet.
+ AssertNull (ent.FirstChild);
+ doc.DocumentElement.AppendChild (ent);
+ // ChildNodes are added here.
+ AssertNotNull (ent.FirstChild);
+
+ ent = doc.CreateEntityReference ("foo");
+ AssertNull (ent.FirstChild);
+ // Entity value is empty when the matching DTD entity
+ // node does not exist.
+ doc.DocumentElement.AppendChild (ent);
+ AssertNotNull (ent.FirstChild);
+
+ AssertEquals (String.Empty, ent.FirstChild.Value);
+
ent = doc.CreateEntityReference ("el");
- AssertEquals ("", ent.InnerText);
- doc.DocumentElement.AppendChild (ent);
- AssertEquals ("<foo>hoge</foo><bar />", ent.InnerXml);
- AssertEquals ("hoge", ent.InnerText);
- AssertEquals (XmlNodeType.Element, ent.FirstChild.NodeType);
+ AssertEquals ("", ent.InnerText);
+ doc.DocumentElement.AppendChild (ent);
+ AssertEquals ("<foo>hoge</foo><bar />", ent.InnerXml);
+ AssertEquals ("hoge", ent.InnerText);
+ AssertEquals (XmlNodeType.Element, ent.FirstChild.NodeType);
}
}
}
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityReferenceTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlEntityTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlNamespaceManagerTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeListTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeReaderTests.cs
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeTests.cs 2008-03-31 18:58:04 \
UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeTests.cs 2008-03-31 19:04:17 \
UTC (rev 99458) @@ -241,54 +241,54 @@
[Test]
public void Normalize2 ()
{
- XmlDocument doc = new XmlDocument ();
- doc.PreserveWhitespace = true;
- doc.LoadXml ("<root> </root>");
- XmlElement root = doc.DocumentElement;
- root.AppendChild (doc.CreateTextNode ("foo"));
- root.AppendChild (doc.CreateTextNode ("bar"));
- root.AppendChild (doc.CreateWhitespace (" "));
- root.AppendChild (doc.CreateTextNode ("baz"));
- doc.NodeInserted += new XmlNodeChangedEventHandler (OnChange);
- doc.NodeChanged += new XmlNodeChangedEventHandler (OnChange);
- doc.NodeRemoved += new XmlNodeChangedEventHandler (OnChange);
- AssertEquals ("Before Normalize()", 5, root.ChildNodes.Count);
- root.Normalize ();
- AssertEquals ("<root> foobar baz</root>", root.OuterXml);
- AssertEquals ("After Normalize()", 1, root.ChildNodes.Count);
+ XmlDocument doc = new XmlDocument ();
+ doc.PreserveWhitespace = true;
+ doc.LoadXml ("<root> </root>");
+ XmlElement root = doc.DocumentElement;
+ root.AppendChild (doc.CreateTextNode ("foo"));
+ root.AppendChild (doc.CreateTextNode ("bar"));
+ root.AppendChild (doc.CreateWhitespace (" "));
+ root.AppendChild (doc.CreateTextNode ("baz"));
+ doc.NodeInserted += new XmlNodeChangedEventHandler (OnChange);
+ doc.NodeChanged += new XmlNodeChangedEventHandler (OnChange);
+ doc.NodeRemoved += new XmlNodeChangedEventHandler (OnChange);
+ AssertEquals ("Before Normalize()", 5, root.ChildNodes.Count);
+ root.Normalize ();
+ AssertEquals ("<root> foobar baz</root>", root.OuterXml);
+ AssertEquals ("After Normalize()", 1, root.ChildNodes.Count);
}
int normalize2Count;
- private void OnChange (object o, XmlNodeChangedEventArgs e)
- {
- switch (normalize2Count) {
- case 0:
- AssertEquals ("Action0", XmlNodeChangedAction.Remove, e.Action);
- AssertEquals ("Value0", " ", e.Node.Value);
- break;
- case 1:
- AssertEquals ("Action1", XmlNodeChangedAction.Remove, e.Action);
- AssertEquals ("Value1", "bar", e.Node.Value);
- break;
- case 2:
- AssertEquals ("Action2", XmlNodeChangedAction.Remove, e.Action);
- AssertEquals ("Value2", " ", e.Node.Value);
- break;
- case 3:
- AssertEquals ("Action3", XmlNodeChangedAction.Remove, e.Action);
- AssertEquals ("Value3", "baz", e.Node.Value);
- break;
- case 4:
- AssertEquals ("Action4", XmlNodeChangedAction.Change, e.Action);
- AssertEquals ("Value4", " foobar baz", e.Node.Value);
- break;
- default:
- Fail (String.Format ("Unexpected event. Action = {0}, node type = {1}, node name \
= {2}, node value = {3}", e.Action, e.Node.NodeType, e.Node.Name, \
e.Node.Value));
- break;
- }
- normalize2Count++;
- }
+ private void OnChange (object o, XmlNodeChangedEventArgs e)
+ {
+ switch (normalize2Count) {
+ case 0:
+ AssertEquals ("Action0", XmlNodeChangedAction.Remove, e.Action);
+ AssertEquals ("Value0", " ", e.Node.Value);
+ break;
+ case 1:
+ AssertEquals ("Action1", XmlNodeChangedAction.Remove, e.Action);
+ AssertEquals ("Value1", "bar", e.Node.Value);
+ break;
+ case 2:
+ AssertEquals ("Action2", XmlNodeChangedAction.Remove, e.Action);
+ AssertEquals ("Value2", " ", e.Node.Value);
+ break;
+ case 3:
+ AssertEquals ("Action3", XmlNodeChangedAction.Remove, e.Action);
+ AssertEquals ("Value3", "baz", e.Node.Value);
+ break;
+ case 4:
+ AssertEquals ("Action4", XmlNodeChangedAction.Change, e.Action);
+ AssertEquals ("Value4", " foobar baz", e.Node.Value);
+ break;
+ default:
+ Fail (String.Format ("Unexpected event. Action = {0}, node type = {1}, node name \
= {2}, node value = {3}", e.Action, e.Node.NodeType, e.Node.Name, e.Node.Value)); \
+ break; + }
+ normalize2Count++;
+ }
[Test]
public void PrependChild()
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlNodeTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlProcessingInstructionTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlSignificantWhitespaceTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlTextTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Property changes on: trunk/mcs/class/System.XML/Test/System.Xml/XmlWhiteSpaceTests.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs 2008-03-31 \
18:58:04 UTC (rev 99457)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs 2008-03-31 \
19:04:17 UTC (rev 99458) @@ -230,17 +230,17 @@
vr.Read (); // bug
AssertEquals ("#4", "urn:a", vr.NamespaceURI);
}
-
- [Test]
- public void MultipleSchemaInSchemaLocation ()
- {
- XmlTextReader xtr = new XmlTextReader \
("Test/XmlFiles/xsd/multi-schemaLocation.xml");
- XmlValidatingReader vr = new XmlValidatingReader (xtr);
- while (!vr.EOF)
- vr.Read ();
- }
[Test]
+ public void MultipleSchemaInSchemaLocation ()
+ {
+ XmlTextReader xtr = new XmlTextReader \
("Test/XmlFiles/xsd/multi-schemaLocation.xml"); + XmlValidatingReader vr = new \
XmlValidatingReader (xtr); + while (!vr.EOF)
+ vr.Read ();
+ }
+
+ [Test]
public void ReadTypedValueSimpleTypeRestriction ()
{
string xml = "<root>xx</root><!-- after -->";
Property changes on: \
trunk/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs \
___________________________________________________________________
Name: svn:eol-style
+ CRLF
_______________________________________________
Mono-patches maillist - Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic