summaryrefslogtreecommitdiff
path: root/test/test-persistence.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-23 00:39:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-23 00:39:06 +0000
commitb59ba638083122456bfeab0ff1fc7e3f3af99423 (patch)
tree7874eb95e40d7bd1d8d8d2ecd513d98dfd936704 /test/test-persistence.cpp
parentImplement loading asset, mesh and face definitions (diff)
downloadilt-b59ba638083122456bfeab0ff1fc7e3f3af99423.tar.bz2
ilt-b59ba638083122456bfeab0ff1fc7e3f3af99423.tar.xz
ilt-b59ba638083122456bfeab0ff1fc7e3f3af99423.zip
Support parsing string values in persistence read
Diffstat (limited to 'test/test-persistence.cpp')
-rw-r--r--test/test-persistence.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test-persistence.cpp b/test/test-persistence.cpp
index faa0d19..6bee010 100644
--- a/test/test-persistence.cpp
+++ b/test/test-persistence.cpp
@@ -208,6 +208,14 @@ BOOST_FIXTURE_TEST_CASE(load_vector_ptr, JPP)
BOOST_CHECK(to->vptr.at(3)->str.empty());
}
+BOOST_FIXTURE_TEST_CASE(test_conversion, JPP)
+{
+ auto to = load_json<std::unique_ptr<TestObject>>(FIXTURESDIR "json/conv.json");
+ BOOST_REQUIRE(to);
+ BOOST_CHECK_EQUAL(to->bl, true);
+ BOOST_CHECK_EQUAL(to->flt, 3.14F);
+}
+
struct SharedTestObject : public Persistence::Persistable {
SharedTestObject() = default;