Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
test/src/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")
...
@@ -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]"
)
TEST_CASE
(
"MessagePack roundtrips"
,
"[hide]"
)
{
{
SECTION
(
"input from msgpack-python"
)
SECTION
(
"input from msgpack-python"
)
...
@@ -656,7 +681,7 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
...
@@ -656,7 +681,7 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
"test/data/json_roundtrip/roundtrip30.json"
,
"test/data/json_roundtrip/roundtrip30.json"
,
"test/data/json_roundtrip/roundtrip31.json"
,
"test/data/json_roundtrip/roundtrip31.json"
,
"test/data/json_roundtrip/roundtrip32.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/pass1.json"
,
"test/data/json_tests/pass2.json"
,
"test/data/json_tests/pass2.json"
,
"test/data/json_tests/pass3.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