diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2009-03-16 10:37:44 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2009-03-16 10:37:44 +0300 |
commit | 68389cd912d7c955a9021a6351dd3b11ea883109 (patch) | |
tree | aca1ea3aad34bd529d207421a536f0201edd3742 /mcs/class/System.XML/Test | |
parent | c7a471732a459e7c8de5f757c5e49ef640578bc3 (diff) |
2009-03-16 Atsushi Enomoto <atsushi@ximian.com>
* XmlReaderBinarySupport.cs : ReadContentsAsBase64() could skip
EndElement at the next XmlReader.Read(). Fixed bug #480066.
* XmlReaderCommonTests.cs : added test for bug #480066.
svn path=/trunk/mcs/; revision=129404
Diffstat (limited to 'mcs/class/System.XML/Test')
-rw-r--r-- | mcs/class/System.XML/Test/System.Xml/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/mcs/class/System.XML/Test/System.Xml/ChangeLog b/mcs/class/System.XML/Test/System.Xml/ChangeLog index 08642948eb0..14f0bfd76cb 100644 --- a/mcs/class/System.XML/Test/System.Xml/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml/ChangeLog @@ -1,5 +1,9 @@ 2009-03-16 Atsushi Enomoto <atsushi@ximian.com> + * XmlReaderCommonTests.cs : added test for bug #480066. + +2009-03-16 Atsushi Enomoto <atsushi@ximian.com> + * XmlWriterTests.cs : only bogus XmlTextWriter ignores null namespace for namespae conflict check. diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs index f906c46e5b4..f03ea6ae6cc 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs @@ -2162,6 +2162,25 @@ namespace MonoTests.System.Xml foreach (byte b in buffer) sw.Write ("{0:X02}", b);
AssertEquals ("#3", "000102030405060708090A0B0C0D0E0F1011121314151617", sw.ToString ());
}
+
+ [Test]
+ public void ReadContentAsBase64_2 () // bug #480066
+ {
+ StringReader readerString = new StringReader ("<root><b64>TWFu</b64><b64>TWFu</b64>\r\n\t<b64>TWFu</b64><b64>TWFu</b64></root>");
+ XmlReaderSettings settingsXml = new XmlReaderSettings ();
+ settingsXml.XmlResolver = null;
+ using (var readerXml = XmlReader.Create (readerString, settingsXml)) {
+ readerXml.MoveToContent ();
+ readerXml.Read ();
+ readerXml.ReadStartElement ("b64");
+ const int bufferLength = 1024;
+ byte [] buffer = new byte [bufferLength];
+ readerXml.ReadContentAsBase64 (buffer, 0, bufferLength);
+ AssertEquals ("#1", XmlNodeType.EndElement, readerXml.NodeType);
+ readerXml.Read ();
+ AssertEquals ("#2", XmlNodeType.Element, readerXml.NodeType);
+ }
+ }
#endif
}
}
|