Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
d362a072
Commit
d362a072
authored
Nov 16, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
💚
moved sample.json to standard test suite to run it with Valgrind
parent
a9744f39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
unit-msgpack.cpp
test/src/unit-msgpack.cpp
+26
-1
No files found.
test/src/unit-msgpack.cpp
View file @
d362a072
...
...
@@ -612,6 +612,31 @@ TEST_CASE("MessagePack")
}
}
// use this testcase outside [hide] to run it with Valgrind
TEST_CASE
(
"single MessagePack roundtrip"
)
{
SECTION
(
"sample.json"
)
{
std
::
string
filename
=
"test/data/json_testsuite/sample.json"
;
// parse JSON file
std
::
ifstream
f_json
(
filename
);
json
j1
=
json
::
parse
(
f_json
);
// parse MessagePack file
std
::
ifstream
f_msgpack
(
filename
+
".msgpack"
,
std
::
ios
::
binary
);
std
::
vector
<
uint8_t
>
packed
((
std
::
istreambuf_iterator
<
char
>
(
f_msgpack
)),
std
::
istreambuf_iterator
<
char
>
());
json
j2
;
CHECK_NOTHROW
(
j2
=
json
::
from_msgpack
(
packed
));
// compare parsed JSON values
CHECK
(
j1
==
j2
);
}
}
TEST_CASE
(
"MessagePack roundtrips"
,
"[hide]"
)
{
SECTION
(
"input from msgpack-python"
)
...
...
@@ -656,7 +681,7 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
"test/data/json_roundtrip/roundtrip30.json"
,
"test/data/json_roundtrip/roundtrip31.json"
,
"test/data/json_roundtrip/roundtrip32.json"
,
// "test/data/json_testsuite/sample.json",
"test/data/json_testsuite/sample.json"
,
// kills AppVeyor
"test/data/json_tests/pass1.json"
,
"test/data/json_tests/pass2.json"
,
"test/data/json_tests/pass3.json"
,
...
...
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