From f1e2bfe81083c4ee9aa82a70e5f5fe831c81857c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 1 May 2021 19:15:55 +0100 Subject: Name, rather than number, shared_ptr tests --- test/fixtures/json/shared_ptr1.json | 11 ----------- test/fixtures/json/shared_ptr2.json | 8 -------- test/fixtures/json/shared_ptr3.json | 8 -------- test/fixtures/json/shared_ptr_diff.json | 11 +++++++++++ test/fixtures/json/shared_ptr_diff_default.json | 8 ++++++++ test/fixtures/json/shared_ptr_same.json | 8 ++++++++ test/test-persistence.cpp | 12 ++++++------ 7 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 test/fixtures/json/shared_ptr1.json delete mode 100644 test/fixtures/json/shared_ptr2.json delete mode 100644 test/fixtures/json/shared_ptr3.json create mode 100644 test/fixtures/json/shared_ptr_diff.json create mode 100644 test/fixtures/json/shared_ptr_diff_default.json create mode 100644 test/fixtures/json/shared_ptr_same.json (limited to 'test') diff --git a/test/fixtures/json/shared_ptr1.json b/test/fixtures/json/shared_ptr1.json deleted file mode 100644 index bb18e33..0000000 --- a/test/fixtures/json/shared_ptr1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "@typeid": "SharedTestObject", - "sptr": { - "@typeid": "SubObject", - "@id": "someid" - }, - "ssptr": { - "@typeid": "SubObject", - "@id": "some other id" - } -} diff --git a/test/fixtures/json/shared_ptr2.json b/test/fixtures/json/shared_ptr2.json deleted file mode 100644 index 4115493..0000000 --- a/test/fixtures/json/shared_ptr2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@typeid": "SharedTestObject", - "sptr": { - "@typeid": "SubObject", - "@id": "someid" - }, - "ssptr": "someid" -} diff --git a/test/fixtures/json/shared_ptr3.json b/test/fixtures/json/shared_ptr3.json deleted file mode 100644 index 69f5e85..0000000 --- a/test/fixtures/json/shared_ptr3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@typeid": "SharedTestObject", - "sptr": { - "@typeid": "SubObject", - "@id": "someid" - }, - "ssptr": {} -} diff --git a/test/fixtures/json/shared_ptr_diff.json b/test/fixtures/json/shared_ptr_diff.json new file mode 100644 index 0000000..bb18e33 --- /dev/null +++ b/test/fixtures/json/shared_ptr_diff.json @@ -0,0 +1,11 @@ +{ + "@typeid": "SharedTestObject", + "sptr": { + "@typeid": "SubObject", + "@id": "someid" + }, + "ssptr": { + "@typeid": "SubObject", + "@id": "some other id" + } +} diff --git a/test/fixtures/json/shared_ptr_diff_default.json b/test/fixtures/json/shared_ptr_diff_default.json new file mode 100644 index 0000000..69f5e85 --- /dev/null +++ b/test/fixtures/json/shared_ptr_diff_default.json @@ -0,0 +1,8 @@ +{ + "@typeid": "SharedTestObject", + "sptr": { + "@typeid": "SubObject", + "@id": "someid" + }, + "ssptr": {} +} diff --git a/test/fixtures/json/shared_ptr_same.json b/test/fixtures/json/shared_ptr_same.json new file mode 100644 index 0000000..4115493 --- /dev/null +++ b/test/fixtures/json/shared_ptr_same.json @@ -0,0 +1,8 @@ +{ + "@typeid": "SharedTestObject", + "sptr": { + "@typeid": "SubObject", + "@id": "someid" + }, + "ssptr": "someid" +} diff --git a/test/test-persistence.cpp b/test/test-persistence.cpp index f94ca81..05a02bb 100644 --- a/test/test-persistence.cpp +++ b/test/test-persistence.cpp @@ -199,9 +199,9 @@ struct SharedTestObject : public Persistence::Persistable { } }; -BOOST_FIXTURE_TEST_CASE(load_shared_object1, JPP) +BOOST_FIXTURE_TEST_CASE(load_shared_object_diff, JPP) { - auto to = load_json>(FIXTURESDIR "json/shared_ptr1.json"); + auto to = load_json>(FIXTURESDIR "json/shared_ptr_diff.json"); BOOST_CHECK(to->sptr); BOOST_CHECK(to->ssptr); BOOST_CHECK_NE(to->sptr, to->ssptr); @@ -209,9 +209,9 @@ BOOST_FIXTURE_TEST_CASE(load_shared_object1, JPP) BOOST_CHECK_EQUAL(to->ssptr.use_count(), 1); } -BOOST_FIXTURE_TEST_CASE(load_shared_object2, JPP) +BOOST_FIXTURE_TEST_CASE(load_shared_object_same, JPP) { - auto to = load_json>(FIXTURESDIR "json/shared_ptr2.json"); + auto to = load_json>(FIXTURESDIR "json/shared_ptr_same.json"); BOOST_CHECK(to->sptr); BOOST_CHECK(to->ssptr); BOOST_CHECK_EQUAL(to->sptr, to->ssptr); @@ -219,9 +219,9 @@ BOOST_FIXTURE_TEST_CASE(load_shared_object2, JPP) BOOST_CHECK_EQUAL(to->ssptr.use_count(), 2); } -BOOST_FIXTURE_TEST_CASE(load_shared_object3, JPP) +BOOST_FIXTURE_TEST_CASE(load_shared_object_diff_default, JPP) { - auto to = load_json>(FIXTURESDIR "json/shared_ptr3.json"); + auto to = load_json>(FIXTURESDIR "json/shared_ptr_diff_default.json"); BOOST_CHECK(to->sptr); BOOST_CHECK(to->ssptr); BOOST_CHECK_NE(to->sptr, to->ssptr); -- cgit v1.2.3