+
+void XmlTestCase::InsertChildAfter()
+{
+ wxXmlNode *root = new wxXmlNode(wxXML_ELEMENT_NODE, "root");
+
+ root->InsertChildAfter(new wxXmlNode(wxXML_ELEMENT_NODE, "1"), NULL);
+ CheckXml(root, "1", NULL);
+
+ wxXmlNode *two = new wxXmlNode(wxXML_ELEMENT_NODE, "2");
+ root->AddChild(two);
+ wxXmlNode *three = new wxXmlNode(wxXML_ELEMENT_NODE, "3");
+ root->AddChild(three);
+ CheckXml(root, "1", "2", "3", NULL);
+
+ // check inserting in the middle:
+ root->InsertChildAfter(new wxXmlNode(wxXML_ELEMENT_NODE, "A"), root->GetChildren());
+ CheckXml(root, "1", "A", "2", "3", NULL);
+ root->InsertChildAfter(new wxXmlNode(wxXML_ELEMENT_NODE, "B"), two);
+ CheckXml(root, "1", "A", "2", "B", "3", NULL);
+
+ // and at the end:
+ root->InsertChildAfter(new wxXmlNode(wxXML_ELEMENT_NODE, "C"), three);
+ CheckXml(root, "1", "A", "2", "B", "3", "C", NULL);
+}