Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
adc0e7e7
Commit
adc0e7e7
authored
May 08, 2012
by
beder
Browse files
Tweaked node iterator tests
parent
bd9103f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
test/new-api/nodetests.cpp
test/new-api/nodetests.cpp
+6
-0
No files found.
test/new-api/nodetests.cpp
View file @
adc0e7e7
...
@@ -332,18 +332,24 @@ namespace Test
...
@@ -332,18 +332,24 @@ namespace Test
int
seq
[]
=
{
1
,
3
,
5
,
7
};
int
seq
[]
=
{
1
,
3
,
5
,
7
};
int
i
=
0
;
int
i
=
0
;
for
(
YAML
::
const_iterator
it
=
node
.
begin
();
it
!=
node
.
end
();
++
it
)
{
for
(
YAML
::
const_iterator
it
=
node
.
begin
();
it
!=
node
.
end
();
++
it
)
{
YAML_ASSERT
(
i
<
4
);
int
x
=
seq
[
i
++
];
int
x
=
seq
[
i
++
];
YAML_ASSERT
(
it
->
as
<
int
>
()
==
x
);
YAML_ASSERT
(
it
->
as
<
int
>
()
==
x
);
}
}
YAML_ASSERT
(
i
==
4
);
return
true
;
return
true
;
}
}
TEST
IterateMap
()
TEST
IterateMap
()
{
{
YAML
::
Node
node
=
YAML
::
Load
(
"{a: A, b: B, c: C}"
);
YAML
::
Node
node
=
YAML
::
Load
(
"{a: A, b: B, c: C}"
);
int
i
=
0
;
for
(
YAML
::
const_iterator
it
=
node
.
begin
();
it
!=
node
.
end
();
++
it
)
{
for
(
YAML
::
const_iterator
it
=
node
.
begin
();
it
!=
node
.
end
();
++
it
)
{
YAML_ASSERT
(
i
<
3
);
i
++
;
YAML_ASSERT
(
it
->
first
.
as
<
char
>
()
+
'A'
-
'a'
==
it
->
second
.
as
<
char
>
());
YAML_ASSERT
(
it
->
first
.
as
<
char
>
()
+
'A'
-
'a'
==
it
->
second
.
as
<
char
>
());
}
}
YAML_ASSERT
(
i
==
3
);
return
true
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment