diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-04-29 17:42:05 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-07 16:41:37 +0000 |
commit | 8cc7ef8b72e408cd7d0b7f347cd508137d471208 (patch) | |
tree | 735642dc351ac817e481765303031310d766a915 /test/test-persistance.cpp | |
parent | Fix dependent name lookup (diff) | |
download | ilt-8cc7ef8b72e408cd7d0b7f347cd508137d471208.tar.bz2 ilt-8cc7ef8b72e408cd7d0b7f347cd508137d471208.tar.xz ilt-8cc7ef8b72e408cd7d0b7f347cd508137d471208.zip |
Automatic type registration
Diffstat (limited to 'test/test-persistance.cpp')
-rw-r--r-- | test/test-persistance.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/test/test-persistance.cpp b/test/test-persistance.cpp index ffc8a3c..a4fda31 100644 --- a/test/test-persistance.cpp +++ b/test/test-persistance.cpp @@ -16,7 +16,7 @@ struct AbsObject : public Persistanace::Persistable { bool persist(Persistanace::PersistanceStore & store) override { - return STORE_MEMBER(base); + return STORE_TYPE && STORE_MEMBER(base); } virtual void dummy() const = 0; @@ -28,7 +28,7 @@ struct SubObject : public AbsObject { bool persist(Persistanace::PersistanceStore & store) override { - return AbsObject::persist(store) && STORE_MEMBER(sub); + return AbsObject::persist(store) && STORE_TYPE && STORE_MEMBER(sub); } void @@ -54,18 +54,12 @@ struct TestObject : public Persistanace::Persistable { bool persist(Persistanace::PersistanceStore & store) override { - return STORE_MEMBER(flt) && STORE_MEMBER(str) && STORE_MEMBER(bl) && STORE_MEMBER(pos) && STORE_MEMBER(flts) - && STORE_MEMBER(poss) && STORE_MEMBER(nest) && STORE_MEMBER(ptr) && STORE_MEMBER(aptr) - && STORE_MEMBER(vptr); + return STORE_TYPE && STORE_MEMBER(flt) && STORE_MEMBER(str) && STORE_MEMBER(bl) && STORE_MEMBER(pos) + && STORE_MEMBER(flts) && STORE_MEMBER(poss) && STORE_MEMBER(nest) && STORE_MEMBER(ptr) + && STORE_MEMBER(aptr) && STORE_MEMBER(vptr); } }; -BOOST_AUTO_TEST_CASE(setup) -{ - Persistanace::Persistable::addFactory("TestObject", std::make_unique<TestObject>); - Persistanace::Persistable::addFactory("SubObject", std::make_unique<SubObject>); -} - struct JPP : public Persistanace::JsonParsePersistance { template<typename T> T |