comparison testing/utp_1.1/generic_utps/utp_902.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 % Tests that the model <MODEL> has a meaningful description.
4 %
5 % </TestDescription>
6 %
7 % $Id: utp_902.m,v 1.3 2010/07/27 07:37:28 hewitson Exp $
8 %
9
10 function result = utp_902(cl, model_name, pl)
11
12 % <SyntaxDescription>
13 %
14 % Test that the model <MODEL> has a meaningful description.
15 %
16 % </SyntaxDescription>
17
18 try
19
20 % <SyntaxCode>
21 pl = combine(pl, plist('built-in', model_name));
22 mdl = feval(cl, pl);
23 % </SyntaxCode>
24 stest = true;
25 catch err
26 disp(err.message)
27 msg = [err.message ' - ' err.stack(1).name ' - line ' num2str(err.stack(1).line)];
28 stest = false;
29 end
30
31 % <AlgoDescription>
32 %
33 % 1) Check that the description of the object is not empty and not equal to 'none'
34 %
35 % </AlgoDescription>
36
37 atest = true;
38 if stest
39 msg = '';
40 % <AlgoCode>
41 % check we have an ssm model
42 if ~isa(mdl, 'ssm'), atest = false; end
43 % check description is not empty
44 if isempty(mdl.description)
45 atest = false;
46 end
47
48 % </AlgoCode>
49 else
50 atest = false;
51 end
52
53 % Return a result structure
54 dd = dbstack;
55 mfilename = dd(2).file(1:end-2);
56 result = utp_prepare_result(atest, stest, dbstack, mfilename, msg);
57 end % END UTP_901