Test std::unique_ptr in generated code
This commit is contained in:
parent
683d87c366
commit
c71a9baa54
|
@ -128,8 +128,8 @@ void JsonGeneratorTests::testNesting()
|
|||
NestedTestStruct nested;
|
||||
nested.nested.emplace_front(vector<TestStruct>{ test });
|
||||
nested.deq.emplace_back(3.14);
|
||||
const string expectedJSON(
|
||||
"{\"nested\":[[{\"someInt\":42,\"someString\":\"the answer\",\"yetAnotherString\":\"but what was the question\"}]],\"deq\":[3.14]}");
|
||||
const string expectedJSON("{\"nested\":[[{\"someInt\":42,\"someString\":\"the answer\",\"yetAnotherString\":\"but what was the "
|
||||
"question\"}]],\"ptr\":null,\"deq\":[3.14]}");
|
||||
|
||||
// test serialization
|
||||
CPPUNIT_ASSERT_EQUAL(expectedJSON, string(nested.toJson().GetString()));
|
||||
|
|
|
@ -39,6 +39,7 @@ struct NestedTestStruct : public JsonSerializable<NestedTestStruct> {
|
|||
friend class JsonGeneratorTests;
|
||||
|
||||
list<vector<TestStruct>> nested;
|
||||
unique_ptr<TestStruct> ptr;
|
||||
|
||||
private:
|
||||
deque<double> deq;
|
||||
|
|
Loading…
Reference in New Issue