summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-08-17 01:17:20 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-08-17 01:17:20 +0100
commit995b6e46b5e00cdb3f234bf26d88dcae50afb0ed (patch)
tree4423886b7dcbada4ea02264d6c12206283dc34ff
parentInitial support for operating on local (classes) (diff)
downloadslicer-1.5.1.tar.bz2
slicer-1.5.1.tar.xz
slicer-1.5.1.zip
Add [json] test cases for local class operationsslicer-1.5.1
-rw-r--r--slicer/test/initial/localClass.json1
-rw-r--r--slicer/test/initial/localSub2Class.json1
-rw-r--r--slicer/test/initial/localSubClass.json1
-rw-r--r--slicer/test/serializers.cpp16
4 files changed, 19 insertions, 0 deletions
diff --git a/slicer/test/initial/localClass.json b/slicer/test/initial/localClass.json
new file mode 100644
index 0000000..161b83d
--- /dev/null
+++ b/slicer/test/initial/localClass.json
@@ -0,0 +1 @@
+{"a":1,"b":"Two"}
diff --git a/slicer/test/initial/localSub2Class.json b/slicer/test/initial/localSub2Class.json
new file mode 100644
index 0000000..2f4a5f1
--- /dev/null
+++ b/slicer/test/initial/localSub2Class.json
@@ -0,0 +1 @@
+{"a":1,"b":"Two","c":3.1,"d":4,"slicer-typeid":"::Locals::LocalSub2Class"}
diff --git a/slicer/test/initial/localSubClass.json b/slicer/test/initial/localSubClass.json
new file mode 100644
index 0000000..4af0ae5
--- /dev/null
+++ b/slicer/test/initial/localSubClass.json
@@ -0,0 +1 @@
+{"a":1,"b":"Two","c":3.1}
diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp
index f9ee4c1..1fbceb8 100644
--- a/slicer/test/serializers.cpp
+++ b/slicer/test/serializers.cpp
@@ -15,6 +15,7 @@
#include <types.h>
#include <json.h>
#include <xml.h>
+#include <locals.h>
#include <fstream>
#include "helpers.h"
#include <definedDirs.h>
@@ -487,6 +488,21 @@ BOOST_AUTO_TEST_CASE( json_objectmapMember )
verifyByFile<TestJson::HasProperitiesPtr, Slicer::JsonFileDeserializer>("objectmapMember.json", checkObjectMapMember);
}
+BOOST_AUTO_TEST_CASE( json_localClass )
+{
+ verifyByFile<Locals::LocalClassPtr, Slicer::JsonFileDeserializer>("localClass.json");
+}
+
+BOOST_AUTO_TEST_CASE( json_localSub2Class )
+{
+ verifyByFile<Locals::LocalClassPtr, Slicer::JsonFileDeserializer>("localSub2Class.json");
+}
+
+BOOST_AUTO_TEST_CASE( json_localSubClass )
+{
+ verifyByFile<Locals::LocalSubClassPtr, Slicer::JsonFileDeserializer>("localSub2Class.json");
+}
+
BOOST_AUTO_TEST_CASE( json_simpleArray )
{
verifyByFile<TestModule::SimpleSeq, Slicer::JsonFileDeserializer>("simpleArray1.json");