Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gxml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Canek Peláez Valdés
Gxml
Commits
208f9e93
Commit
208f9e93
authored
10 years ago
by
Daniel Espinosa
Browse files
Options
Downloads
Patches
Plain Diff
Tested Node.childs.size and its iteration
parent
c920d05f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
gxml/libxml-ChildNodeList.vala
+0
-1
0 additions, 1 deletion
gxml/libxml-ChildNodeList.vala
test/SerializableGeeArrayListTest.vala
+8
-10
8 additions, 10 deletions
test/SerializableGeeArrayListTest.vala
with
8 additions
and
11 deletions
gxml/libxml-ChildNodeList.vala
+
0
−
1
View file @
208f9e93
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
test/SerializableGeeArrayListTest.vala
+
8
−
10
View file @
208f9e93
...
@@ -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
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment