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
6f99d5b2
Unverified
Commit
6f99d5b2
authored
Apr 08, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
fixed test case
One test case for CBOR and MessagePack assumed little endianess.
parent
d62d48fc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
12 deletions
+2
-12
unit-cbor.cpp
test/src/unit-cbor.cpp
+1
-6
unit-msgpack.cpp
test/src/unit-msgpack.cpp
+1
-6
No files found.
test/src/unit-cbor.cpp
View file @
6f99d5b2
...
@@ -727,14 +727,9 @@ TEST_CASE("CBOR")
...
@@ -727,14 +727,9 @@ TEST_CASE("CBOR")
const
auto
result
=
json
::
to_cbor
(
j
);
const
auto
result
=
json
::
to_cbor
(
j
);
CHECK
(
result
==
expected
);
CHECK
(
result
==
expected
);
// restore value (reverse array for endianess)
double
restored
;
std
::
reverse
(
expected
.
begin
(),
expected
.
end
());
memcpy
(
&
restored
,
expected
.
data
(),
sizeof
(
double
));
CHECK
(
restored
==
v
);
// roundtrip
// roundtrip
CHECK
(
json
::
from_cbor
(
result
)
==
j
);
CHECK
(
json
::
from_cbor
(
result
)
==
j
);
CHECK
(
json
::
from_cbor
(
result
)
==
v
);
}
}
}
}
...
...
test/src/unit-msgpack.cpp
View file @
6f99d5b2
...
@@ -676,14 +676,9 @@ TEST_CASE("MessagePack")
...
@@ -676,14 +676,9 @@ TEST_CASE("MessagePack")
const
auto
result
=
json
::
to_msgpack
(
j
);
const
auto
result
=
json
::
to_msgpack
(
j
);
CHECK
(
result
==
expected
);
CHECK
(
result
==
expected
);
// restore value (reverse array for endianess)
double
restored
;
std
::
reverse
(
expected
.
begin
(),
expected
.
end
());
memcpy
(
&
restored
,
expected
.
data
(),
sizeof
(
double
));
CHECK
(
restored
==
v
);
// roundtrip
// roundtrip
CHECK
(
json
::
from_msgpack
(
result
)
==
j
);
CHECK
(
json
::
from_msgpack
(
result
)
==
j
);
CHECK
(
json
::
from_msgpack
(
result
)
==
v
);
}
}
}
}
}
}
...
...
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