public int v2_1() { ManagedNodeWriter mnw = new ManagedNodeWriter(); mnw.PutPattern("X"); int count = 0; do { mnw.PutPattern("E/"); count++; } while (count < 65536); mnw.PutText("<a/><b/>"); mnw.Finish(); CError.WriteIgnore(mnw.GetNodes() + "\n"); ReloadSource(new StringReader(mnw.GetNodes())); DataReader.PositionOnElement("ELEMENT_0"); CError.Compare(DataReader.ReadToDescendant("a"), "Couldnt go to Descendant"); int depth = DataReader.Depth; CError.Compare(DataReader.ReadToNextSibling("b"), "Couldnt go to NextSibling"); CError.Compare(DataReader.Depth, depth, "Depth is not correct"); CError.Compare(DataReader.NodeType, XmlNodeType.Element, "Nodetype is not correct"); while (DataReader.Read()) ; DataReader.Close(); return TEST_PASS; }
// Entry point. public static void Main(string[] args) { string filename = "temp.xml"; ManagedNodeWriter mw = new ManagedNodeWriter(filename); ManagedNodeWriter mnw = new ManagedNodeWriter(); mnw.PutPattern("X"); int count = 0; do { mnw.PutPattern("E/"); count++; } while (count < 65536); mnw.PutText("<a/>"); mnw.Finish(); StreamWriter sw = new StreamWriter(FilePathUtil.getStream("deep.xml")); sw.Write(mnw.GetNodes()); sw.Dispose(); }
public int v100() { ManagedNodeWriter mnw = new ManagedNodeWriter(); mnw.PutPattern("X"); do { mnw.OpenElement(); mnw.CloseElement(); } while (mnw.GetNodes().Length < 4096); mnw.Finish(); ReloadSource(new StringReader(mnw.GetNodes())); DataReader.PositionOnElement("ELEMENT_2"); XmlReader r = DataReader.ReadSubtree(); while (r.Read()) ; DataReader.Read(); CError.Compare(DataReader.Name, "ELEMENT_1", "Main name doesnt match"); CError.Compare(DataReader.Value, "", "Main value doesnt match"); CError.Compare(DataReader.NodeType.ToString().ToUpperInvariant(), "ENDELEMENT", "Main nodetype doesnt match"); DataReader.Close(); return TEST_PASS; }
public int v2_1() { ManagedNodeWriter mnw = new ManagedNodeWriter(); mnw.PutPattern("X"); int count = 0; do { mnw.PutPattern("E/"); count++; } while (count < 65536); mnw.PutText("<a/>"); mnw.Finish(); ReloadSource(new StringReader(mnw.GetNodes())); DataReader.PositionOnElement("ELEMENT_1"); CError.WriteLine("Reading to : a"); DataReader.ReadToDescendant("a"); CError.Compare(DataReader.Depth, 65536, "Depth is not correct"); CError.Compare(DataReader.NodeType, XmlNodeType.Element, "Nodetype is not correct"); while (DataReader.Read()) ; DataReader.Close(); return TEST_PASS; }