Skip to content
Snippets Groups Projects
Commit 208f9e93 authored by Daniel Espinosa's avatar Daniel Espinosa
Browse files

Tested Node.childs.size and its iteration

parent c920d05f
Branches
Tags
No related merge requests found
...@@ -57,7 +57,6 @@ internal abstract class GXml.ChildNodeList : AbstractBidirList<xNode>, NodeList ...@@ -57,7 +57,6 @@ internal abstract class GXml.ChildNodeList : AbstractBidirList<xNode>, NodeList
public override int size { public override int size {
get { get {
if (head != null) { if (head != null) {
//GLib.warning ("At NodeChildNodeList: get_size");
int len = 1; int len = 1;
var cur = head; var cur = head;
while (cur->next != null) { while (cur->next != null) {
......
...@@ -73,21 +73,19 @@ class SerializableGeeArrayListTest : GXmlTest ...@@ -73,21 +73,19 @@ class SerializableGeeArrayListTest : GXmlTest
c.add (o1); c.add (o1);
c.add (o2); c.add (o2);
var doc = new xDocument (); var doc = new xDocument ();
var root = (xElement) doc.create_element ("root"); var root = doc.create_element ("root");
doc.childs.add (root); doc.childs.add (root);
c.serialize (root); c.serialize ((xNode) root);
if (!root.has_child_nodes ()) { assert (root.childs.size == 2);
stdout.printf (@"ERROR: root node have no childs $(doc)\n");
assert_not_reached ();
}
bool found1 = false; bool found1 = false;
bool found2 = false; bool found2 = false;
foreach (GXml.xNode n in root.child_nodes) { foreach (GXml.Node n in root.childs) {
if (n is xElement && n.node_name == "aelement") { GLib.message ("Node name ="+n.name);
if (n is Element && n.name == "aelement") {
var name = ((xElement) n).get_attribute_node ("name"); var name = ((xElement) n).get_attribute_node ("name");
if (name != null) { if (name != null) {
if (name.node_value == "Big") found1 = true; if (name.value == "Big") found1 = true;
if (name.node_value == "Small") found2 = true; if (name.value == "Small") found2 = true;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment