[JSON] CHECK in doctest only accepts std::string ? Use assert statement instead. Does the job
This commit is contained in:
parent
578217eaa3
commit
254f0e3cee
1 changed files with 7 additions and 6 deletions
|
@ -29,6 +29,7 @@ SOFTWARE.
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
@ -221,7 +222,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
|
|||
nlohmann::json j = obj1; //via json object
|
||||
T 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
|
|||
nlohmann::json j2 = nlohmann::json::parse(s);
|
||||
T 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
|
|||
nlohmann::json j2 = nlohmann::json::from_msgpack(buf);
|
||||
T 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
|
|||
nlohmann::json j2 = nlohmann::json::from_bson(buf);
|
||||
T 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
|
|||
nlohmann::json j2 = nlohmann::json::from_cbor(buf);
|
||||
T 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
|
|||
nlohmann::json j2 = nlohmann::json::from_ubjson(buf);
|
||||
T obj2;
|
||||
j2.get_to(obj2);
|
||||
CHECK(obj1 == obj2);
|
||||
assert(obj1 == obj2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue