comparison testing/utp_1.1/generic_utps/utp_11.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 % <TestDescription>
2 %
3 % Check that the <METHOD> method pass back the output objects to a list of
4 % output variables or to a single variable.
5 %
6 % </TestDescription>
7 function result = utp_11(method, obj1, ple1, varargin)
8
9 % <SyntaxDescription>
10 %
11 % Call the method with a list of output variables and with a single output
12 % variable. Additionaly check that the rebuild method works on the output.
13 %
14 % </SyntaxDescription>
15
16 if ~isempty(varargin)
17 pli = varargin{1};
18 else
19 pli = [];
20 end
21
22 try
23 % <SyntaxCode>
24 obj1 = obj1.setPlotinfo(plist('color', 'r'));
25 if isempty(pli)
26 o1 = feval(method, obj1);
27 else
28 o1 = feval(method, obj1, pli);
29 end
30 % </SyntaxCode>
31 stest = true;
32 catch err
33 disp(err.message)
34 stest = false;
35 end
36
37 % <AlgoDescription>
38 %
39 % 1) Check that the output contains the same plotinfo plist
40 %
41 % </AlgoDescription>
42
43 atest = true;
44 if stest
45 % <AlgoCode>
46 if ~eq(obj1(1).plotinfo, o1(1).plotinfo, ple1), atest = false; end
47 % </AlgoCode>
48 else
49 atest = false;
50 end
51
52 % Return a result structure
53 dd = dbstack;
54 mfilename = dd(2).file(1:end-2);
55 result = utp_prepare_result(atest, stest, dbstack, mfilename);
56 end % END UTP_30