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
9eae039c
"...composable_kernel.git" did not exist on "853e797ec2496e148708578877f3a554cc1d6900"
Commit
9eae039c
authored
Jan 24, 2015
by
Jesse Beder
Browse files
Merge
parents
0c280724
2c340f05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
include/yaml-cpp/node/impl.h
include/yaml-cpp/node/impl.h
+2
-0
test/node/node_test.cpp
test/node/node_test.cpp
+11
-0
No files found.
include/yaml-cpp/node/impl.h
View file @
9eae039c
...
@@ -393,6 +393,7 @@ inline const Node Node::operator[](const Node& key) const {
...
@@ -393,6 +393,7 @@ inline const Node Node::operator[](const Node& key) const {
throw
InvalidNode
();
throw
InvalidNode
();
EnsureNodeExists
();
EnsureNodeExists
();
key
.
EnsureNodeExists
();
key
.
EnsureNodeExists
();
m_pMemory
->
merge
(
*
key
.
m_pMemory
);
detail
::
node
&
value
=
detail
::
node
&
value
=
static_cast
<
const
detail
::
node
&>
(
*
m_pNode
).
get
(
*
key
.
m_pNode
,
m_pMemory
);
static_cast
<
const
detail
::
node
&>
(
*
m_pNode
).
get
(
*
key
.
m_pNode
,
m_pMemory
);
return
Node
(
value
,
m_pMemory
);
return
Node
(
value
,
m_pMemory
);
...
@@ -403,6 +404,7 @@ inline Node Node::operator[](const Node& key) {
...
@@ -403,6 +404,7 @@ inline Node Node::operator[](const Node& key) {
throw
InvalidNode
();
throw
InvalidNode
();
EnsureNodeExists
();
EnsureNodeExists
();
key
.
EnsureNodeExists
();
key
.
EnsureNodeExists
();
m_pMemory
->
merge
(
*
key
.
m_pMemory
);
detail
::
node
&
value
=
m_pNode
->
get
(
*
key
.
m_pNode
,
m_pMemory
);
detail
::
node
&
value
=
m_pNode
->
get
(
*
key
.
m_pNode
,
m_pMemory
);
return
Node
(
value
,
m_pMemory
);
return
Node
(
value
,
m_pMemory
);
}
}
...
...
test/node/node_test.cpp
View file @
9eae039c
...
@@ -261,6 +261,17 @@ TEST(NodeTest, CloneNull) {
...
@@ -261,6 +261,17 @@ TEST(NodeTest, CloneNull) {
EXPECT_EQ
(
NodeType
::
Null
,
clone
.
Type
());
EXPECT_EQ
(
NodeType
::
Null
,
clone
.
Type
());
}
}
TEST
(
NodeTest
,
KeyNodeExitsScope
)
{
Node
node
;
{
Node
temp
(
"Hello, world"
);
node
[
temp
]
=
0
;
}
for
(
const
auto
&
kv
:
node
)
{
(
void
)
kv
;
}
}
TEST
(
NodeTest
,
DefaultNodeStyle
)
{
TEST
(
NodeTest
,
DefaultNodeStyle
)
{
Node
node
;
Node
node
;
EXPECT_EQ
(
EmitterStyle
::
Default
,
node
.
Style
());
EXPECT_EQ
(
EmitterStyle
::
Default
,
node
.
Style
());
...
...
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