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
This commit is contained in:
Krzysztof Wicher 2018-03-07 17:39:46 -08:00 коммит произвёл Dan Moseley
Родитель 59f6987b7f
Коммит 303f204485
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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;
}
}
}