Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_tsdata.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_tsdata(varargin) | |
2 | |
3 if nargin == 0 | |
4 [conn, username] = mysql_connect('localhost', 'ltpda_test'); | |
5 else | |
6 conn = varargin{1}; | |
7 username = varargin{2}; | |
8 end | |
9 | |
10 %% Submit a mfir | |
11 | |
12 p = tsdata(randn(1,10), 10); | |
13 | |
14 sinfo.conn = conn; | |
15 sinfo.username = username; | |
16 sinfo.experiment_title = 'submit tsdata'; | |
17 sinfo.experiment_description = 'this is just a test of the whole thing'; | |
18 sinfo.reference_ids = ''; | |
19 sinfo.additional_comments = 'none'; | |
20 sinfo.additional_authors = 'no one'; | |
21 | |
22 | |
23 [ids, cid] = ltpda_obj_submit(p, sinfo); | |
24 | |
25 %% Retrieve the object | |
26 | |
27 q = ltpda_obj_retrieve(conn, cid); | |
28 | |
29 %% Close connection | |
30 if nargin == 0 | |
31 close(conn); | |
32 end | |
33 | |
34 | |
35 %% Test | |
36 | |
37 if p ~= q | |
38 error('### tsdata objects are not the same.') | |
39 end |