Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 mc | |
2 | |
3 %% Empty | |
4 | |
5 c1 = collection | |
6 | |
7 %% With some objects | |
8 | |
9 c2 = collection(ao(1), plist('key', 'value'), ssm) | |
10 | |
11 c2r = c2.rebuild | |
12 | |
13 eq(c2r,c2, 'created', 'proctime', 'UUID') | |
14 | |
15 | |
16 %% Vector | |
17 | |
18 c1 = collection(ao(1), ssm) | |
19 c2 = collection(ao(1), pzmodel) | |
20 | |
21 cvc = collection([c1 c2]) | |
22 | |
23 | |
24 %% With plist | |
25 | |
26 c3 = collection() | |
27 | |
28 c3.addObjects(ao(2)) | |
29 | |
30 c3.addObjects(ao(2), plist('key', 'value')) | |
31 | |
32 | |
33 c3.addObjects(plist('objs', {ao(3), ssm})) | |
34 | |
35 c3.addObjects(plist('objs', [ao(4) ao(5)])) | |
36 | |
37 %% Save/load | |
38 | |
39 save(c3, 'c3.xml') | |
40 | |
41 c3l = collection('c3.xml') | |
42 | |
43 eq(c3, c3l) | |
44 | |
45 | |
46 save(c3, 'c3.mat') | |
47 | |
48 c3l = collection('c3.mat') | |
49 | |
50 eq(c3, c3l) | |
51 | |
52 |