diff options
author | Krzysztof Wicher <mordotymoja@gmail.com> | 2018-03-08 04:39:46 +0300 |
---|---|---|
committer | Dan Moseley <danmose@microsoft.com> | 2018-03-08 04:39:46 +0300 |
commit | 303f2044859294dc68e46ad8d161d4a56b556e77 (patch) | |
tree | f73f72f7232dc426f1bbb8d3c134d0ac7dad4154 /src/System.Private.Xml | |
parent | 59f6987b7fc919a438060f6c502c3c9cf7c8af29 (diff) |
Close file in XmlSchemaSet tests in attempt to fix intermittent test failure (#27825)
* close file in XmlSchemaSet tests in attempt to fix intermittent test failure
* fix compilation problem
Diffstat (limited to 'src/System.Private.Xml')
-rw-r--r-- | src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs index 0acd938c88..269dffa070 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs @@ -635,15 +635,15 @@ namespace System.Xml.Tests string correctUri = Path.GetFullPath(path); _output.WriteLine("Include uri: " + includeUri); _output.WriteLine("Correct uri: " + correctUri); - Stream s = new FileStream(Path.GetFullPath(path), FileMode.Open, FileAccess.Read, FileShare.Read, 1); - XmlReader r = XmlReader.Create(s, new XmlReaderSettings(), includeUri); - _output.WriteLine("Reader uri: " + r.BaseURI); - XmlSchema som = null; - using (r) + using (Stream s = new FileStream(Path.GetFullPath(path), FileMode.Open, FileAccess.Read, FileShare.Read, 1)) { - som = XmlSchema.Read(r, new ValidationEventHandler(ValidationCallback)); + XmlReader r = XmlReader.Create(s, new XmlReaderSettings(), includeUri); + _output.WriteLine("Reader uri: " + r.BaseURI); + using (r) + { + return XmlSchema.Read(r, new ValidationEventHandler(ValidationCallback)); + } } - return som; } } } |