comparison testing/utp_1.1/utps/ssm/utp_ssm_addParameters.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 % UTP_SSM_ADDPARAMETERS a set of UTPs for the ssm/addParameters method
2 %
3 % M Hewitson 06-08-08
4 %
5 % $Id: utp_ssm_addParameters.m,v 1.1 2009/08/06 16:56:25 hewitson Exp $
6 %
7
8 % <MethodDescription>
9 %
10 % The addParameters method of the ssm class adds the given parameters to
11 % the model.
12 %
13 % </MethodDescription>
14
15 function results = utp_ssm_addParameters(varargin)
16
17 % Check the inputs
18 if nargin == 0
19
20 % Some keywords
21 class = 'ssm';
22 mthd = 'addParameters';
23
24 results = [];
25 disp('******************************************************');
26 disp(['**** Running UTPs for ' class '/' mthd]);
27 disp('******************************************************');
28
29 % Test miir objects
30 [sys1, sys2] = get_test_objects_ssm;
31
32 % Exception list for the UTPs:
33 [ple1,ple2,ple3,ple4,ple5,ple6] = get_test_ples();
34
35 % Run the tests
36 results = [results utp_02(mthd, [sys1 sys2], @algo_test_plist, plist('prop', 2), ple2)];
37 results = [results utp_03(mthd, [sys1 sys2 sys1; sys2 sys2 sys1], @algo_test_plist, plist('prop', 2), ple2)];
38 results = [results utp_04(mthd, sys1, sys2, sys1, @algo_test_plist, plist('prop', 2), ple2)];
39 results = [results utp_04(mthd, sys1, sys2, sys1, @algo_test_param, param('prop', 2), ple2)];
40 results = [results utp_05(mthd, sys1, [sys1 sys2 sys1; sys2 sys2 sys1], [sys2 sys1], @algo_test_plist, plist('prop', 2), ple2)];
41 results = [results utp_06(mthd, sys1, plist('prop', 2), ple2)];
42
43 disp('Done.');
44 disp('******************************************************');
45
46 elseif nargin == 1 % Check for UTP functions
47 if strcmp(varargin{1}, 'isutp')
48 results = 1;
49 else
50 results = 0;
51 end
52 else
53 error('### Incorrect inputs')
54 end
55
56 end
57
58 function atest = algo_test_plist(in, out, pli)
59
60 atest = true;
61 if ~eq(out.params.find(pli.params(1).key), pli.params(1).getVal), atest = false; end
62
63 end
64
65
66 function atest = algo_test_param(in, out, pli)
67
68 atest = true;
69 if ~eq(out.params.find(pli(1).key), pli(1).getVal), atest = false; end
70
71 end