comparison m-toolbox/m/dev/test_getInfo.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 % Checks the getInfo call for all class methods
2 %
3
4 classes = utils.helper.ltpda_classes;
5 fails = {};
6 for jj=1:numel(classes)
7 cl = classes{jj};
8 disp(sprintf('=========== %s ===============', cl))
9 % Class info
10 try
11 % get meta info for this class
12 ci = eval(sprintf('?%s', cl));
13 % Get methods
14 ms = ci.Methods;
15
16 % Check if this is an abstract class
17 try
18 o = feval(cl);
19 abstract = false;
20 catch
21 abstract = true;
22 end
23
24 if ~abstract
25 % Go through methods
26 for kk=1:numel(ms)
27 m = ms{kk};
28 % If this is not an inherited
29 if strcmp(m.DefiningClass.Name, cl)
30 disp(sprintf(' -- checking %s/%s', cl, m.Name));
31 if strcmp(m.Access, 'public') && ~m.Static && ~strcmp(m.Name, 'Contents')
32 cmd = sprintf('%s.getInfo(''%s'')', cl, m.Name);
33 ii = [];
34 try
35 ii = eval(cmd);
36 end
37 if ~isa(ii, 'minfo')
38 fails = [fails sprintf('%s/%s', cl, m.Name)];
39 end
40 end
41 else
42 warning('!!! Skipping inherited method %s/%s', cl, m.Name);
43 end
44 end
45 end
46 catch
47 warning('!!! Couldn''t get meta info for class %s', cl);
48 end
49 end
50
51 fd = fopen('getinfo_fails.txt', 'w+');
52 for j=1:numel(fails)
53 fprintf(fd, '%s\n', fails{j});
54 end
55 fclose(fd)
56 edit getinfo_fails.txt
57