Mercurial > hg > ltpda
comparison testing/utp_1.1/generic_utps/check_axis_sets.m @ 44:409a22968d5e default
Add unit tests
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 18:42:11 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
43:bc767aaa99a8 | 44:409a22968d5e |
---|---|
1 function atest = check_axis_sets(io) | |
2 atest = true; | |
3 % SET 'None' | |
4 if ~isempty(io(1).sets), atest = false; end | |
5 if ~isempty(io(1).plists), atest = false; end | |
6 % Check all Sets | |
7 if ~any(strcmpi(io(2).sets, '1D')), atest = false; end | |
8 if ~any(strcmpi(io(2).sets, '2D')), atest = false; end | |
9 if ~any(strcmpi(io(2).sets, '3D')), atest = false; end | |
10 if numel(io(2).plists) ~= numel(io(2).sets), atest = false; end | |
11 % SET '1D' | |
12 % Check key | |
13 if ~io(3).plists.isparam('axis'), atest = false; end | |
14 if ~io(3).plists.isparam('dim'), atest = false; end | |
15 if ~io(3).plists.isparam('option'), atest = false; end | |
16 % Check default value | |
17 if ~isequal(io(3).plists.find('axis'), 'y'), atest = false; end | |
18 if ~isEmptyDouble(io(3).plists.find('dim')), atest = false; end | |
19 if ~isEmptyChar(io(3).plists.find('option')), atest = false; end | |
20 % Check options | |
21 if ~isequal(io(3).plists.getOptionsForParam('axis'), {'y'}), atest = false; end | |
22 if ~isequal(io(3).plists.getOptionsForParam('dim'), {[]}), atest = false; end | |
23 if ~isequal(io(3).plists.getOptionsForParam('option'), {''}), atest = false; end | |
24 % SET '2D' | |
25 % Check key | |
26 if ~io(4).plists.isparam('axis'), atest = false; end | |
27 if ~io(4).plists.isparam('dim'), atest = false; end | |
28 if ~io(4).plists.isparam('option'), atest = false; end | |
29 % Check default value | |
30 if ~isequal(io(4).plists.find('axis'), 'y'), atest = false; end | |
31 if ~isEmptyDouble(io(4).plists.find('dim')), atest = false; end | |
32 if ~isEmptyChar(io(4).plists.find('option')), atest = false; end | |
33 % Check options | |
34 if ~isequal(io(4).plists.getOptionsForParam('axis'), {'x', 'y', 'xy'}), atest = false; end | |
35 if ~isequal(io(4).plists.getOptionsForParam('dim'), {[]}), atest = false; end | |
36 if ~isequal(io(4).plists.getOptionsForParam('option'), {''}), atest = false; end | |
37 % SET '3D' | |
38 % Check key | |
39 if ~io(5).plists.isparam('axis'), atest = false; end | |
40 if ~io(5).plists.isparam('dim'), atest = false; end | |
41 if ~io(5).plists.isparam('option'), atest = false; end | |
42 % Check default value | |
43 if ~isequal(io(5).plists.find('axis'), 'z'), atest = false; end | |
44 if ~isEmptyDouble(io(5).plists.find('dim')), atest = false; end | |
45 if ~isEmptyChar(io(5).plists.find('option')), atest = false; end | |
46 % Check options | |
47 if ~isequal(io(5).plists.getOptionsForParam('axis'), {'x', 'y', 'z', 'xyz'}), atest = false; end | |
48 if ~isequal(io(5).plists.getOptionsForParam('dim'), {[]}), atest = false; end | |
49 if ~isequal(io(5).plists.getOptionsForParam('option'), {''}), atest = false; end | |
50 | |
51 end |