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
4cbef5c6
Commit
4cbef5c6
authored
10 years ago
by
Daniel Espinosa
Browse files
Options
Downloads
Patches
Plain Diff
Ported SerializableDualKeyMap tests to GXml.Element API
parent
9f68fd75
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/SerializableGeeDualKeyMapTest.vala
+11
-14
11 additions, 14 deletions
test/SerializableGeeDualKeyMapTest.vala
with
11 additions
and
14 deletions
test/SerializableGeeDualKeyMapTest.vala
+
11
−
14
View file @
4cbef5c6
...
...
@@ -143,30 +143,27 @@ class SerializableGeeDualKeyMapTest : GXmlTest
c
.
set
(
o3
.
owner
,
o3
.
name
,
o3
);
c
.
set
(
o4
.
owner
,
o4
.
name
,
o4
);
var
doc
=
new
xDocument
();
var
root
=
(
xElement
)
doc
.
create_element
(
"root"
);
var
root
=
doc
.
create_element
(
"root"
);
doc
.
childs
.
add
(
root
);
c
.
serialize
(
root
);
if
(!
root
.
has_child_nodes
())
{
stdout
.
printf
(
@"ERROR: root node have no childs $(doc)\n"
);
assert_not_reached
();
}
c
.
serialize
(
(
xNode
)
root
);
assert
(
root
.
childs
.
size
==
4
);
bool
found1
=
false
;
bool
found2
=
false
;
bool
found3
=
false
;
bool
found4
=
false
;
int
nodes
=
0
;
int
i
=
0
;
foreach
(
GXml
.
x
Node
n
in
root
.
child
_node
s
)
{
foreach
(
GXml
.
Node
n
in
root
.
childs
)
{
nodes
++;
if
(
n
is
x
Element
&&
n
.
node_
name
==
"spaces"
)
{
if
(
n
is
Element
&&
n
.
name
==
"spaces"
)
{
i
++;
var
name
=
((
xElement
)
n
).
get_attribute_node
(
"name"
);
var
owner
=
((
xElement
)
n
).
get_attribute_node
(
"owner"
);
var
name
=
n
.
attrs
.
get
(
"name"
);
var
owner
=
n
.
attrs
.
get
(
"owner"
);
if
(
name
!=
null
&&
owner
!=
null
)
{
if
(
name
.
node_
value
==
"Big"
&&
owner
.
node_
value
==
"Floor"
)
found1
=
true
;
if
(
name
.
node_
value
==
"Small"
&&
owner
.
node_
value
==
"Wall"
)
found2
=
true
;
if
(
name
.
node_
value
==
"Bigger"
&&
owner
.
node_
value
==
"Floor"
)
found3
=
true
;
if
(
name
.
node_
value
==
"Smallest"
&&
owner
.
node_
value
==
"Wall"
)
found4
=
true
;
if
(
name
.
value
==
"Big"
&&
owner
.
value
==
"Floor"
)
found1
=
true
;
if
(
name
.
value
==
"Small"
&&
owner
.
value
==
"Wall"
)
found2
=
true
;
if
(
name
.
value
==
"Bigger"
&&
owner
.
value
==
"Floor"
)
found3
=
true
;
if
(
name
.
value
==
"Smallest"
&&
owner
.
value
==
"Wall"
)
found4
=
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