Mercurial > hg > ltpda
comparison m-toolbox/classes/tests/@ltpda_obj_tests/test_copy.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 copy() method works. | |
2 function res = test_copy(varargin) | |
3 | |
4 utp = varargin{1}; | |
5 | |
6 % get test data | |
7 data = utp.getTestData; | |
8 if ~isempty(data) | |
9 % shallow copy | |
10 c = copy(data,0); | |
11 assert(c==data); | |
12 % deep copy | |
13 c = copy(data,1); | |
14 % The deep copy should not be the same object. At least the UUID | |
15 % changes. | |
16 % assert(c~=data); | |
17 % Check with the appropriate exceptions | |
18 % LTPDAprefs('Display', 'verboseLevel', 2); | |
19 assert(eq(c,data,utp.configPlist)); | |
20 % LTPDAprefs('Display', 'verboseLevel', -1); | |
21 end | |
22 | |
23 res = sprintf('%s/copy seems to work', class(data)); | |
24 end |