comparison testing/utp_1.1/utps/ao/utp_ao_and.m @ 45:a59cdb8aaf31 database-connection-manager

Merge
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 19:07:22 +0100
parents 409a22968d5e
children
comparison
equal deleted inserted replaced
42:f90d4f666cc7 45:a59cdb8aaf31
1 % UTP_AO_AND a set of UTPs for the ao/and method
2 %
3 % M Hewitson 06-08-08
4 %
5 % $Id: utp_ao_and.m,v 1.1 2010/09/23 19:48:49 ingo Exp $
6 %
7
8 % <MethodDescription>
9 %
10 % The AND method of the ao class performs a logical AND of the y data of
11 % the two inputs.
12 %
13 % </MethodDescription>
14
15 function results = utp_ao_and(varargin)
16
17 % Check the inputs
18 if nargin == 0
19
20 % Some keywords
21 class = 'ao';
22 mthd = 'and';
23
24 results = [];
25 disp('******************************************************');
26 disp('**** Running UTPs for ao/and');
27 disp('******************************************************');
28
29 % Run the tests
30 results = [results utp_01]; % getInfo call
31 results = [results utp_generic_aop_rule1(@and)]; % Rule 1
32 results = [results utp_generic_aop_rule2(@and)]; % Rule 2
33 results = [results utp_generic_aop_rule3(@and)]; % Rule 3
34 results = [results utp_generic_aop_rule4(@and)]; % Rule 4
35 results = [results utp_generic_aop_rule5(@and)]; % Rule 5
36 results = [results utp_generic_aop_rule6(@and)]; % Rule 6
37 results = [results utp_generic_aop_rule7(@and)]; % Rule 7
38 results = [results utp_generic_aop_rule8(@and)]; % Rule 8
39 results = [results utp_generic_aop_rule9(@and)]; % Rule 9
40 results = [results utp_generic_aop_rule10(@and)]; % Rule 10
41 results = [results utp_generic_aop_rule11(@and)]; % Rule 11
42 results = [results utp_generic_aop_negative_tests(@and)]; % Negative tests
43
44 disp('Done.');
45 disp('******************************************************');
46
47 elseif nargin == 1 % Check for UTP functions
48 if strcmp(varargin{1}, 'isutp')
49 results = 1;
50 else
51 results = 0;
52 end
53 else
54 error('### Incorrect inputs')
55 end
56
57 %% UTP_01
58
59 % <TestDescription>
60 %
61 % Tests that the getInfo call works for this method.
62 %
63 % </TestDescription>
64 function result = utp_01
65
66
67 % <SyntaxDescription>
68 %
69 % Test that the getInfo call works for no sets, all sets, and each set
70 % individually.
71 %
72 % </SyntaxDescription>
73
74 try
75 % <SyntaxCode>
76 % Call for no sets
77 io(1) = eval([class '.getInfo(''' mthd ''', ''None'')']);
78 % Call for all sets
79 io(2) = eval([class '.getInfo(''' mthd ''')']);
80 % Call for each set
81 for kk=1:numel(io(2).sets)
82 io(kk+2) = eval([class '.getInfo(''' mthd ''', ''' io(2).sets{kk} ''')']);
83 end
84 % </SyntaxCode>
85 stest = true;
86 catch err
87 disp(err.message)
88 stest = false;
89 end
90
91 % <AlgoDescription>
92 %
93 % 1) Check that getInfo call returned an minfo object in all cases.
94 % 2) Check that all plists have the correct parameters.
95 %
96 % </AlgoDescription>
97
98 atest = true;
99 if stest
100 % <AlgoCode>
101 % check we have minfo objects
102 if isa(io, 'minfo')
103 % SET 'None'
104 if ~isempty(io(1).sets), atest = false; end
105 if ~isempty(io(1).plists), atest = false; end
106 % Check all Sets
107 if ~any(strcmpi(io(2).sets, 'Default')), atest = false; end
108 if numel(io(2).plists) ~= numel(io(2).sets), atest = false; end
109 % SET 'Default'
110 if io(3).plists.nparams ~= 0, atest = false; end
111 % Check key
112 % Check default value
113 % Check options
114 end
115 % </AlgoCode>
116 else
117 atest = false;
118 end
119
120 % Return a result structure
121 result = utp_prepare_result(atest, stest, dbstack, mfilename);
122 end % END UTP_01
123
124 end
125