diff m-toolbox/test/test_collection.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/test/test_collection.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,52 @@
+mc
+
+%% Empty
+
+c1 = collection
+
+%% With some objects
+
+c2 = collection(ao(1), plist('key', 'value'), ssm)
+
+c2r = c2.rebuild
+
+eq(c2r,c2, 'created', 'proctime', 'UUID')
+
+
+%% Vector
+
+c1 = collection(ao(1), ssm)
+c2 = collection(ao(1), pzmodel)
+
+cvc = collection([c1 c2])
+
+
+%% With plist
+
+c3 = collection()
+
+c3.addObjects(ao(2))
+
+c3.addObjects(ao(2), plist('key', 'value'))
+
+
+c3.addObjects(plist('objs', {ao(3), ssm}))
+
+c3.addObjects(plist('objs', [ao(4) ao(5)]))
+
+%% Save/load
+
+save(c3, 'c3.xml')
+
+c3l = collection('c3.xml')
+
+eq(c3, c3l)
+
+
+save(c3, 'c3.mat')
+
+c3l = collection('c3.mat')
+
+eq(c3, c3l)
+
+