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
a441e1a1
Commit
a441e1a1
authored
Jan 12, 2012
by
Jesse Beder
Browse files
Added test for new API octal/hex conversion
parent
fb080209
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
test/new-api/nodetests.cpp
test/new-api/nodetests.cpp
+3
-1
No files found.
test/new-api/nodetests.cpp
View file @
a441e1a1
...
@@ -303,7 +303,7 @@ namespace Test
...
@@ -303,7 +303,7 @@ namespace Test
TEST
NumericConversion
()
TEST
NumericConversion
()
{
{
YAML
::
Node
node
=
YAML
::
Load
(
"[1.5, 1, .nan, .inf, -.inf]"
);
YAML
::
Node
node
=
YAML
::
Load
(
"[1.5, 1, .nan, .inf, -.inf
, 0x15, 015
]"
);
YAML_ASSERT
(
node
[
0
].
as
<
float
>
()
==
1.5
f
);
YAML_ASSERT
(
node
[
0
].
as
<
float
>
()
==
1.5
f
);
YAML_ASSERT
(
node
[
0
].
as
<
double
>
()
==
1.5
);
YAML_ASSERT
(
node
[
0
].
as
<
double
>
()
==
1.5
);
YAML_ASSERT_THROWS
(
node
[
0
].
as
<
int
>
(),
std
::
runtime_error
);
YAML_ASSERT_THROWS
(
node
[
0
].
as
<
int
>
(),
std
::
runtime_error
);
...
@@ -312,6 +312,8 @@ namespace Test
...
@@ -312,6 +312,8 @@ namespace Test
YAML_ASSERT
(
node
[
2
].
as
<
float
>
()
!=
node
[
2
].
as
<
float
>
());
YAML_ASSERT
(
node
[
2
].
as
<
float
>
()
!=
node
[
2
].
as
<
float
>
());
YAML_ASSERT
(
node
[
3
].
as
<
float
>
()
==
std
::
numeric_limits
<
float
>::
infinity
());
YAML_ASSERT
(
node
[
3
].
as
<
float
>
()
==
std
::
numeric_limits
<
float
>::
infinity
());
YAML_ASSERT
(
node
[
4
].
as
<
float
>
()
==
-
std
::
numeric_limits
<
float
>::
infinity
());
YAML_ASSERT
(
node
[
4
].
as
<
float
>
()
==
-
std
::
numeric_limits
<
float
>::
infinity
());
YAML_ASSERT
(
node
[
5
].
as
<
int
>
()
==
21
);
YAML_ASSERT
(
node
[
6
].
as
<
int
>
()
==
13
);
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