comparison m-toolbox/test/repo_tests/test_history.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_history(varargin)
2
3 if nargin == 0
4 [conn, username] = mysql_connect('130.75.117.63', 'ltpda_test');
5 else
6 conn = varargin{1};
7 username = varargin{2};
8 end
9
10 %% Submit a mfir
11
12 a1 = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 10, 'fs', 100));
13 a2 = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 10, 'fs', 100));
14 a3 = a1 + a2;
15
16 p = a3.hist;
17
18 sinfo.conn = conn;
19 sinfo.username = username;
20 sinfo.experiment_title = 'submit history';
21 sinfo.experiment_description = 'this is just a test of the whole thing';
22 sinfo.reference_ids = '';
23 sinfo.additional_comments = 'none';
24 sinfo.additional_authors = 'no one';
25
26
27 [ids, cid] = ltpda_obj_submit(p, sinfo);
28
29 %% Retrieve the object
30
31 q = ltpda_obj_retrieve(conn, cid);
32
33 %% Close connection
34 if nargin == 0
35 close(conn);
36 end
37
38
39 %% Test
40
41 if p ~= q
42 error('### history objects are not the same.')
43 end