mirror of
https://github.com/nlohmann/json.git
synced 2026-04-26 09:49:26 +00:00
Fix NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT with an empty JSON instance (#4508)
* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance * fix ci_static_analysis_clang (ci_clang_tidy) * change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance
This commit is contained in:
committed by
GitHub
parent
6057b31df7
commit
2134cb947a
@@ -551,6 +551,13 @@ TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRU
|
||||
CHECK(p3.getName() == "");
|
||||
CHECK(p3.getAge() == 0);
|
||||
CHECK(p3.getMetadata() == nullptr);
|
||||
|
||||
// check default value in case of empty json
|
||||
const json j4;
|
||||
T p4 = j4.get<T>();
|
||||
CHECK(p4.getName() == "");
|
||||
CHECK(p4.getAge() == 0);
|
||||
CHECK(p4.getMetadata() == nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user