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
254f0e3c
Commit
254f0e3c
authored
Jul 19, 2020
by
pf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[JSON] CHECK in doctest only accepts std::string ? Use assert statement instead. Does the job
parent
578217ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
unit-udt_macro.cpp
test/src/unit-udt_macro.cpp
+7
-6
No files found.
test/src/unit-udt_macro.cpp
View file @
254f0e3c
...
@@ -29,6 +29,7 @@ SOFTWARE.
...
@@ -29,6 +29,7 @@ SOFTWARE.
#include <string>
#include <string>
#include <vector>
#include <vector>
#include <cassert>
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
...
@@ -221,7 +222,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -221,7 +222,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j
=
obj1
;
//via json object
nlohmann
::
json
j
=
obj1
;
//via json object
T
obj2
;
T
obj2
;
j
.
get_to
(
obj2
);
j
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
{
{
...
@@ -231,7 +232,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -231,7 +232,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j2
=
nlohmann
::
json
::
parse
(
s
);
nlohmann
::
json
j2
=
nlohmann
::
json
::
parse
(
s
);
T
obj2
;
T
obj2
;
j2
.
get_to
(
obj2
);
j2
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
{
{
...
@@ -241,7 +242,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -241,7 +242,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_msgpack
(
buf
);
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_msgpack
(
buf
);
T
obj2
;
T
obj2
;
j2
.
get_to
(
obj2
);
j2
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
{
{
...
@@ -251,7 +252,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -251,7 +252,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_bson
(
buf
);
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_bson
(
buf
);
T
obj2
;
T
obj2
;
j2
.
get_to
(
obj2
);
j2
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
{
{
...
@@ -261,7 +262,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -261,7 +262,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_cbor
(
buf
);
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_cbor
(
buf
);
T
obj2
;
T
obj2
;
j2
.
get_to
(
obj2
);
j2
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
{
{
...
@@ -271,7 +272,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
...
@@ -271,7 +272,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_ubjson
(
buf
);
nlohmann
::
json
j2
=
nlohmann
::
json
::
from_ubjson
(
buf
);
T
obj2
;
T
obj2
;
j2
.
get_to
(
obj2
);
j2
.
get_to
(
obj2
);
CHECK
(
obj1
==
obj2
);
assert
(
obj1
==
obj2
);
}
}
}
}
}
}
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