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
9880b608
Commit
9880b608
authored
Jan 24, 2015
by
Jesse Beder
Browse files
Merge from core
parents
1aa25e76
ad712c4f
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1356 additions
and
1314 deletions
+1356
-1314
test/integration/encoding_test.cpp
test/integration/encoding_test.cpp
+1
-1
test/integration/gen_emitter_test.cpp
test/integration/gen_emitter_test.cpp
+1136
-1136
test/integration/handler_spec_test.cpp
test/integration/handler_spec_test.cpp
+176
-166
test/integration/handler_test.cpp
test/integration/handler_test.cpp
+3
-4
test/mock_event_handler.h
test/mock_event_handler.h
+5
-3
util/read.cpp
util/read.cpp
+5
-2
util/sandbox.cpp
util/sandbox.cpp
+5
-2
yaml-cpp-config-version.cmake.in
yaml-cpp-config-version.cmake.in
+11
-0
yaml-cpp-config.cmake.in
yaml-cpp-config.cmake.in
+14
-0
No files found.
test/integration/encoding_test.cpp
View file @
9880b608
...
@@ -95,7 +95,7 @@ class EncodingTest : public HandlerTest {
...
@@ -95,7 +95,7 @@ class EncodingTest : public HandlerTest {
void
Run
()
{
void
Run
()
{
InSequence
sequence
;
InSequence
sequence
;
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnSequenceStart
(
_
,
"?"
,
0
));
EXPECT_CALL
(
handler
,
OnSequenceStart
(
_
,
"?"
,
0
,
EmitterStyle
::
Block
));
for
(
std
::
size_t
i
=
0
;
i
<
m_entries
.
size
();
i
++
)
{
for
(
std
::
size_t
i
=
0
;
i
<
m_entries
.
size
();
i
++
)
{
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"!"
,
0
,
m_entries
[
i
]));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"!"
,
0
,
m_entries
[
i
]));
}
}
...
...
test/integration/gen_emitter_test.cpp
View file @
9880b608
This diff is collapsed.
Click to expand it.
test/integration/handler_spec_test.cpp
View file @
9880b608
This diff is collapsed.
Click to expand it.
test/integration/handler_test.cpp
View file @
9880b608
...
@@ -11,8 +11,7 @@ using ::testing::_;
...
@@ -11,8 +11,7 @@ using ::testing::_;
ASSERT_THROW(statement, ParserException); \
ASSERT_THROW(statement, ParserException); \
try { \
try { \
statement; \
statement; \
} \
} catch (const ParserException& e) { \
catch (const ParserException& e) { \
EXPECT_EQ(e.msg, message); \
EXPECT_EQ(e.msg, message); \
}
}
...
@@ -26,7 +25,7 @@ TEST_F(HandlerTest, NoEndOfMapFlow) {
...
@@ -26,7 +25,7 @@ TEST_F(HandlerTest, NoEndOfMapFlow) {
TEST_F
(
HandlerTest
,
PlainScalarStartingWithQuestionMark
)
{
TEST_F
(
HandlerTest
,
PlainScalarStartingWithQuestionMark
)
{
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnMapStart
(
_
,
"?"
,
0
));
EXPECT_CALL
(
handler
,
OnMapStart
(
_
,
"?"
,
0
,
EmitterStyle
::
Block
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"foo"
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"foo"
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"?bar"
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"?bar"
));
EXPECT_CALL
(
handler
,
OnMapEnd
());
EXPECT_CALL
(
handler
,
OnMapEnd
());
...
@@ -36,7 +35,7 @@ TEST_F(HandlerTest, PlainScalarStartingWithQuestionMark) {
...
@@ -36,7 +35,7 @@ TEST_F(HandlerTest, PlainScalarStartingWithQuestionMark) {
TEST_F
(
HandlerTest
,
NullStringScalar
)
{
TEST_F
(
HandlerTest
,
NullStringScalar
)
{
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnDocumentStart
(
_
));
EXPECT_CALL
(
handler
,
OnMapStart
(
_
,
"?"
,
0
));
EXPECT_CALL
(
handler
,
OnMapStart
(
_
,
"?"
,
0
,
EmitterStyle
::
Block
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"foo"
));
EXPECT_CALL
(
handler
,
OnScalar
(
_
,
"?"
,
0
,
"foo"
));
EXPECT_CALL
(
handler
,
OnNull
(
_
,
0
));
EXPECT_CALL
(
handler
,
OnNull
(
_
,
0
));
EXPECT_CALL
(
handler
,
OnMapEnd
());
EXPECT_CALL
(
handler
,
OnMapEnd
());
...
...
test/mock_event_handler.h
View file @
9880b608
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/eventhandler.h"
#include "gmock/gmock.h"
#include "gmock/gmock.h"
...
@@ -14,11 +15,12 @@ class MockEventHandler : public EventHandler {
...
@@ -14,11 +15,12 @@ class MockEventHandler : public EventHandler {
MOCK_METHOD4
(
OnScalar
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
MOCK_METHOD4
(
OnScalar
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
const
std
::
string
&
));
const
std
::
string
&
));
MOCK_METHOD
3
(
OnSequenceStart
,
MOCK_METHOD
4
(
OnSequenceStart
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
));
EmitterStyle
::
value
));
MOCK_METHOD0
(
OnSequenceEnd
,
void
());
MOCK_METHOD0
(
OnSequenceEnd
,
void
());
MOCK_METHOD3
(
OnMapStart
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
));
MOCK_METHOD4
(
OnMapStart
,
void
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
EmitterStyle
::
value
));
MOCK_METHOD0
(
OnMapEnd
,
void
());
MOCK_METHOD0
(
OnMapEnd
,
void
());
};
};
}
}
util/read.cpp
View file @
9880b608
#include <iostream>
#include <iostream>
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/yaml.h" // IWYU pragma: keep
#include "yaml-cpp/yaml.h" // IWYU pragma: keep
...
@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
...
@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
virtual
void
OnAlias
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnAlias
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnScalar
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
virtual
void
OnScalar
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
const
std
::
string
&
)
{}
const
std
::
string
&
)
{}
virtual
void
OnSequenceStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnSequenceStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
YAML
::
EmitterStyle
::
value
style
)
{}
virtual
void
OnSequenceEnd
()
{}
virtual
void
OnSequenceEnd
()
{}
virtual
void
OnMapStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnMapStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
YAML
::
EmitterStyle
::
value
style
)
{}
virtual
void
OnMapEnd
()
{}
virtual
void
OnMapEnd
()
{}
};
};
...
...
util/sandbox.cpp
View file @
9880b608
#include <iostream>
#include <iostream>
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/yaml.h" // IWYU pragma: keep
#include "yaml-cpp/yaml.h" // IWYU pragma: keep
...
@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
...
@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
virtual
void
OnAlias
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnAlias
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnScalar
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
virtual
void
OnScalar
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
const
std
::
string
&
)
{}
const
std
::
string
&
)
{}
virtual
void
OnSequenceStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnSequenceStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
YAML
::
EmitterStyle
::
value
style
)
{}
virtual
void
OnSequenceEnd
()
{}
virtual
void
OnSequenceEnd
()
{}
virtual
void
OnMapStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnMapStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
YAML
::
EmitterStyle
::
value
style
)
{}
virtual
void
OnMapEnd
()
{}
virtual
void
OnMapEnd
()
{}
};
};
...
...
yaml-cpp-config-version.cmake.in
0 → 100644
View file @
9880b608
set(PACKAGE_VERSION "@YAML_CPP_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
yaml-cpp-config.cmake.in
0 → 100644
View file @
9880b608
# - Config file for the yaml-cpp package
# It defines the following variables
# YAML_CPP_INCLUDE_DIR - include directory
# YAML_CPP_LIBRARIES - libraries to link against
# Compute paths
get_filename_component(YAML_CPP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(YAML_CPP_INCLUDE_DIR "@CONFIG_INCLUDE_DIRS@")
# Our library dependencies (contains definitions for IMPORTED targets)
include("${YAML_CPP_CMAKE_DIR}/yaml-cpp-targets.cmake")
# These are IMPORTED targets created by yaml-cpp-targets.cmake
set(YAML_CPP_LIBRARIES "@EXPORT_TARGETS@")
Prev
1
2
Next
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