comparison m-toolbox/test/repo_tests/test_specwin.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function test_specwin(varargin)
2 % A test function to submit a specwin to the repository. The specwin is then
3 % retrieved and compared to the original one.
4 %
5 % Usage: test_specwin() - connects to Hannover repository
6 % test_specwin(conn) - connects to the repository specified by
7 % the database conn object.
8 %
9 % M Hewitson 24-02-08
10 %
11 % $Id: test_specwin.m,v 1.4 2008/02/24 10:17:54 hewitson Exp $
12 %
13
14 if nargin == 0
15 conn = mysql_connect('130.75.117.67', 'ltpda_test');
16 else
17 conn = varargin{1};
18 end
19 %% Submit a timeformat
20 p = specwin('Hanning', 100);
21
22 sinfo.conn = conn;
23 sinfo.experiment_title = 'submit specwin';
24 sinfo.experiment_description = 'this is just a test of the whole thing';
25 sinfo.analysis_description = 'just submitting';
26 sinfo.quantity = 'none';
27 sinfo.keywords = 'none';
28 sinfo.reference_ids = '1,2';
29 sinfo.additional_comments = 'none';
30 sinfo.additional_authors = 'no one';
31
32
33 [ids, cid] = ltpda_obj_submit(p, sinfo);
34
35 %% Retrieve the object
36
37 q = ltpda_obj_retrieve(conn, ids);
38
39 %% Close connection
40 if nargin == 0
41 close(conn);
42 end
43
44
45 %% Test
46
47 if p ~= q
48 error('### specwin objects are not the same.')
49 end