FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
msgpack-c/test/boost_string_ref.cpp at cpp_master · msgpack/msgpack-c · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
msgpack
/
msgpack-c
Public
Notifications
You must be signed in to change notification settings
Fork
936
Star
3.3k
Code
Issues
92
Pull requests
11
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
msgpack-c
/
test
/
boost_string_ref.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (45 loc) · 1.31 KB
Breadcrumbs
msgpack-c
/
test
/
boost_string_ref.cpp
Copy path
File metadata and controls
57 lines (45 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
include
<
msgpack.hpp
>
#
include
<
sstream
>
#
include
<
iterator
>
#
define
BOOST_TEST_MODULE
MSGPACK_BOOST
#
include
<
boost/test/unit_test.hpp
>
#
ifdef
HAVE_CONFIG_H
#
include
"
config.h
"
#
endif
#
if
defined(MSGPACK_NO_BOOST)
BOOST_AUTO_TEST_CASE
(empty)
{
}
#
else
//
defined(MSGPACK_NO_BOOST)
#
if
(BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 53
BOOST_AUTO_TEST_CASE
(pack_convert_string_ref)
{
std::stringstream ss;
std::string s =
"
ABC
"
;
boost::string_ref
val1
(s);
msgpack::pack
(ss, val1);
msgpack::object_handle oh;
std::string
const
& str = ss.
str
();
msgpack::unpack
(oh, str.
data
(), str.
size
());
boost::string_ref val2 = oh.
get
().
as
<boost::string_ref>();
BOOST_CHECK
(val1 == val2);
}
BOOST_AUTO_TEST_CASE
(object_strinf_ref)
{
std::string s =
"
ABC
"
;
boost::string_ref
val1
(s);
msgpack::object
obj
(val1);
boost::string_ref val2 = obj.
as
<boost::string_ref>();
BOOST_CHECK
(val1 == val2);
}
BOOST_AUTO_TEST_CASE
(object_with_zone_string_ref)
{
msgpack::zone z;
std::string s =
"
ABC
"
;
boost::string_ref
val1
(s);
msgpack::object
obj
(val1, z);
boost::string_ref val2 = obj.
as
<boost::string_ref>();
BOOST_CHECK
(val1 == val2);
}
#
endif
//
(BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 53
#
endif
//
defined(MSGPACK_NO_BOOST)
Back
|
FazBrowse Home
|
New Git URL