//[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4000", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4088", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4089", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4090", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4091", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4092", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4093", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4096", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4097", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4098", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4099", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4101", "4096" })] //[Variation("Test PI Buffer Boundaries with variable byte boundary", Params = new object[] { "4102", "4096" })] public int v1() { int initialVal = Convert.ToInt16(CurVariation.Params[0].ToString()); int bufferBoundary = Convert.ToInt16(CurVariation.Params[1].ToString()); if (!(IsCoreReader() || IsBinaryReader() || IsXmlTextReader() || IsXmlValidatingReader())) { return TEST_SKIPPED; } BufferBoundary bb = new BufferBoundary(BufferBoundary.START_TAG, BufferBoundary.END_TAG, "a", initialVal); bb.PrepareStream(); bb.bufferBoundaryLength = bufferBoundary; bb.StringAtBufferBoundary(); bb.FinishStream(); MemoryStream ms = bb.memoryStream; ms.Seek(0, SeekOrigin.Begin); ReloadSource(ms, ""); CError.WriteLine("Initial Buffer = " + initialVal); CError.WriteLine("Buffer Boundary = " + bufferBoundary); while (DataReader.Read()) { if (DataReader.NodeType == XmlNodeType.ProcessingInstruction) { CError.WriteLine("PI Name = " + DataReader.Name); bool equal = (DataReader.Value == bb.nodeValue.ToString()); if (!equal) return TEST_FAIL; } } return TEST_PASS; }
// Just in case this ones required. public MemoryStream GetStream(string sTag, string eTag, string content, int val) { BufferBoundary bb = new BufferBoundary(sTag, eTag, content, val); bb.PrepareStream(); bb.StringAtBufferBoundary(); bb.FinishStream(); MemoryStream ms = bb.memoryStream; ms.Seek(0, SeekOrigin.Begin); return ms; }