summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/json/abs.json2
-rw-r--r--test/fixtures/json/bad/empty_abs.json2
-rw-r--r--test/fixtures/json/bad/implicit_abs.json2
-rw-r--r--test/fixtures/json/bad/late_type.json2
-rw-r--r--test/fixtures/json/bad/wrong_type.json2
-rw-r--r--test/fixtures/json/bad_type.json2
-rw-r--r--test/fixtures/json/empty.json2
-rw-r--r--test/fixtures/json/implicit.json2
-rw-r--r--test/fixtures/json/load_object.json4
-rw-r--r--test/fixtures/json/nested.json8
-rw-r--r--test/fixtures/json/shared_ptr_diff.json10
-rw-r--r--test/fixtures/json/shared_ptr_diff_default.json6
-rw-r--r--test/fixtures/json/shared_ptr_null.json6
-rw-r--r--test/fixtures/json/shared_ptr_same.json6
-rw-r--r--test/fixtures/json/shared_ptr_wrong_type.json6
-rw-r--r--test/fixtures/json/vector_ptr.json2
-rw-r--r--test/test-persistence.cpp8
17 files changed, 36 insertions, 36 deletions
diff --git a/test/fixtures/json/abs.json b/test/fixtures/json/abs.json
index 8492df3..1b489ef 100644
--- a/test/fixtures/json/abs.json
+++ b/test/fixtures/json/abs.json
@@ -1,6 +1,6 @@
{
"aptr": {
- "@typeid": "SubObject",
+ "p.typeid": "SubObject",
"base": "set base",
"sub": "set sub"
}
diff --git a/test/fixtures/json/bad/empty_abs.json b/test/fixtures/json/bad/empty_abs.json
index 7d22001..5cc3598 100644
--- a/test/fixtures/json/bad/empty_abs.json
+++ b/test/fixtures/json/bad/empty_abs.json
@@ -1,5 +1,5 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 1,
"aptr": {},
"str": "after"
diff --git a/test/fixtures/json/bad/implicit_abs.json b/test/fixtures/json/bad/implicit_abs.json
index 573b323..bf81ee4 100644
--- a/test/fixtures/json/bad/implicit_abs.json
+++ b/test/fixtures/json/bad/implicit_abs.json
@@ -1,5 +1,5 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 1,
"aptr": {
"str": "trigger"
diff --git a/test/fixtures/json/bad/late_type.json b/test/fixtures/json/bad/late_type.json
index 171575a..d1d6f6c 100644
--- a/test/fixtures/json/bad/late_type.json
+++ b/test/fixtures/json/bad/late_type.json
@@ -1,4 +1,4 @@
{
"str": "trigger",
- "@typeid": "doesn't matter"
+ "p.typeid": "doesn't matter"
}
diff --git a/test/fixtures/json/bad/wrong_type.json b/test/fixtures/json/bad/wrong_type.json
index 777d791..4f19033 100644
--- a/test/fixtures/json/bad/wrong_type.json
+++ b/test/fixtures/json/bad/wrong_type.json
@@ -1,5 +1,5 @@
{
"ptr": {
- "@typeid": "SubObject"
+ "p.typeid": "SubObject"
}
}
diff --git a/test/fixtures/json/bad_type.json b/test/fixtures/json/bad_type.json
index f316bd1..70b9d1a 100644
--- a/test/fixtures/json/bad_type.json
+++ b/test/fixtures/json/bad_type.json
@@ -1,3 +1,3 @@
{
- "@typeid": "no such type"
+ "p.typeid": "no such type"
}
diff --git a/test/fixtures/json/empty.json b/test/fixtures/json/empty.json
index a9193a3..9575565 100644
--- a/test/fixtures/json/empty.json
+++ b/test/fixtures/json/empty.json
@@ -1,5 +1,5 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 1,
"ptr": {},
"str": "after"
diff --git a/test/fixtures/json/implicit.json b/test/fixtures/json/implicit.json
index 478cec6..6efc2ba 100644
--- a/test/fixtures/json/implicit.json
+++ b/test/fixtures/json/implicit.json
@@ -1,5 +1,5 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 1,
"ptr": {
"str": "trigger",
diff --git a/test/fixtures/json/load_object.json b/test/fixtures/json/load_object.json
index bb32298..c622885 100644
--- a/test/fixtures/json/load_object.json
+++ b/test/fixtures/json/load_object.json
@@ -1,5 +1,5 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 3.14,
"str": "Lovely string",
"bl": true,
@@ -48,7 +48,7 @@
[]
],
"ptr": {
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 3.14,
"str": "Lovely string"
}
diff --git a/test/fixtures/json/nested.json b/test/fixtures/json/nested.json
index 98951fc..1e271e3 100644
--- a/test/fixtures/json/nested.json
+++ b/test/fixtures/json/nested.json
@@ -1,14 +1,14 @@
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 1,
"ptr": {
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 2,
"ptr": {
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 3,
"ptr": {
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"flt": 4,
"ptr": null,
"str": "four"
diff --git a/test/fixtures/json/shared_ptr_diff.json b/test/fixtures/json/shared_ptr_diff.json
index bb18e33..043be4a 100644
--- a/test/fixtures/json/shared_ptr_diff.json
+++ b/test/fixtures/json/shared_ptr_diff.json
@@ -1,11 +1,11 @@
{
- "@typeid": "SharedTestObject",
+ "p.typeid": "SharedTestObject",
"sptr": {
- "@typeid": "SubObject",
- "@id": "someid"
+ "p.typeid": "SubObject",
+ "p.id": "someid"
},
"ssptr": {
- "@typeid": "SubObject",
- "@id": "some other id"
+ "p.typeid": "SubObject",
+ "p.id": "some other id"
}
}
diff --git a/test/fixtures/json/shared_ptr_diff_default.json b/test/fixtures/json/shared_ptr_diff_default.json
index 69f5e85..c78bc12 100644
--- a/test/fixtures/json/shared_ptr_diff_default.json
+++ b/test/fixtures/json/shared_ptr_diff_default.json
@@ -1,8 +1,8 @@
{
- "@typeid": "SharedTestObject",
+ "p.typeid": "SharedTestObject",
"sptr": {
- "@typeid": "SubObject",
- "@id": "someid"
+ "p.typeid": "SubObject",
+ "p.id": "someid"
},
"ssptr": {}
}
diff --git a/test/fixtures/json/shared_ptr_null.json b/test/fixtures/json/shared_ptr_null.json
index c2461e8..8669bf2 100644
--- a/test/fixtures/json/shared_ptr_null.json
+++ b/test/fixtures/json/shared_ptr_null.json
@@ -1,8 +1,8 @@
{
- "@typeid": "SharedTestObject",
+ "p.typeid": "SharedTestObject",
"sptr": {
- "@typeid": "SubObject",
- "@id": "someid"
+ "p.typeid": "SubObject",
+ "p.id": "someid"
},
"ssptr": null
}
diff --git a/test/fixtures/json/shared_ptr_same.json b/test/fixtures/json/shared_ptr_same.json
index 4115493..2838e82 100644
--- a/test/fixtures/json/shared_ptr_same.json
+++ b/test/fixtures/json/shared_ptr_same.json
@@ -1,8 +1,8 @@
{
- "@typeid": "SharedTestObject",
+ "p.typeid": "SharedTestObject",
"sptr": {
- "@typeid": "SubObject",
- "@id": "someid"
+ "p.typeid": "SubObject",
+ "p.id": "someid"
},
"ssptr": "someid"
}
diff --git a/test/fixtures/json/shared_ptr_wrong_type.json b/test/fixtures/json/shared_ptr_wrong_type.json
index 68f7533..5d4e655 100644
--- a/test/fixtures/json/shared_ptr_wrong_type.json
+++ b/test/fixtures/json/shared_ptr_wrong_type.json
@@ -1,8 +1,8 @@
{
- "@typeid": "SharedTestObject",
+ "p.typeid": "SharedTestObject",
"sptr": {
- "@typeid": "SubObject2",
- "@id": "someid"
+ "p.typeid": "SubObject2",
+ "p.id": "someid"
},
"ssptr": "someid"
}
diff --git a/test/fixtures/json/vector_ptr.json b/test/fixtures/json/vector_ptr.json
index 8a07a2e..654bd6c 100644
--- a/test/fixtures/json/vector_ptr.json
+++ b/test/fixtures/json/vector_ptr.json
@@ -1,7 +1,7 @@
{
"vptr": [
{
- "@typeid": "TestObject",
+ "p.typeid": "TestObject",
"str": "type"
},
{
diff --git a/test/test-persistence.cpp b/test/test-persistence.cpp
index e13cb7a..faa0d19 100644
--- a/test/test-persistence.cpp
+++ b/test/test-persistence.cpp
@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(write_test_dfl)
std::stringstream ss;
Persistence::JsonWritePersistence {ss}.saveState(to);
BOOST_CHECK_EQUAL(ss.str(),
- R"({"@typeid":"TestObject","flt":0,"str":"","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"vptr":[]})");
+ R"({"p.typeid":"TestObject","flt":0,"str":"","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"vptr":[]})");
}
BOOST_FIXTURE_TEST_CASE(write_test_loaded, JPP)
@@ -329,7 +329,7 @@ BOOST_FIXTURE_TEST_CASE(write_test_loaded, JPP)
std::stringstream ss;
Persistence::JsonWritePersistence {ss}.saveState(to);
BOOST_CHECK_EQUAL(ss.str(),
- R"({"@typeid":"TestObject","flt":3.14,"str":"Lovely string","bl":true,"pos":[3.14,6.28,1.57],"flts":[3.14,6.28,1.57,0,-1,-3.14],"poss":[[3.14,6.28,1.57],[0,-1,-3.14]],"nest":[[["a","b"],["c","d","e"]],[["f"]],[]],"ptr":{"@typeid":"TestObject","flt":3.14,"str":"Lovely string","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"vptr":[]},"vptr":[]})");
+ R"({"p.typeid":"TestObject","flt":3.14,"str":"Lovely string","bl":true,"pos":[3.14,6.28,1.57],"flts":[3.14,6.28,1.57,0,-1,-3.14],"poss":[[3.14,6.28,1.57],[0,-1,-3.14]],"nest":[[["a","b"],["c","d","e"]],[["f"]],[]],"ptr":{"p.typeid":"TestObject","flt":3.14,"str":"Lovely string","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"vptr":[]},"vptr":[]})");
}
BOOST_FIXTURE_TEST_CASE(write_test_loaded_abs, JPP)
@@ -338,7 +338,7 @@ BOOST_FIXTURE_TEST_CASE(write_test_loaded_abs, JPP)
std::stringstream ss;
Persistence::JsonWritePersistence {ss}.saveState(to);
BOOST_CHECK_EQUAL(ss.str(),
- R"({"@typeid":"TestObject","flt":0,"str":"","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"aptr":{"@typeid":"SubObject","base":"set base","sub":"set sub"},"vptr":[]})");
+ R"({"p.typeid":"TestObject","flt":0,"str":"","bl":false,"pos":[0,0,0],"flts":[],"poss":[],"nest":[],"aptr":{"p.typeid":"SubObject","base":"set base","sub":"set sub"},"vptr":[]})");
}
BOOST_FIXTURE_TEST_CASE(write_test_loaded_shared, JPP)
@@ -349,7 +349,7 @@ BOOST_FIXTURE_TEST_CASE(write_test_loaded_shared, JPP)
Persistence::JsonWritePersistence {ss}.saveState(to);
BOOST_CHECK_EQUAL(Persistence::seenSharedObjects.size(), 1);
BOOST_CHECK_EQUAL(ss.str(),
- R"({"@typeid":"SharedTestObject","sptr":{"@typeid":"SubObject","@id":"someid","base":"","sub":""},"ssptr":"someid"})");
+ R"({"p.typeid":"SharedTestObject","sptr":{"p.typeid":"SubObject","p.id":"someid","base":"","sub":""},"ssptr":"someid"})");
}
BOOST_DATA_TEST_CASE(write_special_strings, TEST_STRINGS, exp, in)