Mercurial > hg > ltpda
comparison m-toolbox/classes/tests/@ltpda_uo_tests/test_save_load.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 % Test the save and load methods work. | |
2 function res = test_save_load(varargin) | |
3 | |
4 res = ''; | |
5 utp = varargin{1}; | |
6 | |
7 if ~isempty(utp.className) | |
8 % Test object | |
9 obj = utp.getTestData; | |
10 % Test MAT | |
11 fname = [tempname '.mat']; | |
12 save(obj, fname); | |
13 new = feval(utp.className, fname); | |
14 delete(fname); | |
15 assert(new == obj); | |
16 % Test XML | |
17 fname = [tempname '.xml']; | |
18 save(obj, fname); | |
19 new = feval(utp.className, fname); | |
20 delete(fname); | |
21 assert(new == obj); | |
22 res = sprintf('Saving and loading objects of class %s works', class(obj)); | |
23 end | |
24 | |
25 end |