Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_fsdata.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_fsdata(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 f = 1:10; | |
13 p = fsdata(f, randn(size(f)), 1); | |
14 | |
15 sinfo.conn = conn; | |
16 sinfo.username = username; | |
17 sinfo.experiment_title = 'submit fsdata'; | |
18 sinfo.experiment_description = 'this is just a test of the whole thing'; | |
19 sinfo.reference_ids = ''; | |
20 sinfo.additional_comments = 'none'; | |
21 sinfo.additional_authors = 'no one'; | |
22 | |
23 | |
24 [ids, cid] = ltpda_obj_submit(p, sinfo); | |
25 | |
26 %% Retrieve the object | |
27 | |
28 q = ltpda_obj_retrieve(conn, cid); | |
29 | |
30 %% Close connection | |
31 if nargin == 0 | |
32 close(conn); | |
33 end | |
34 | |
35 | |
36 %% Test | |
37 | |
38 if p ~= q | |
39 error('### fsdata objects are not the same.') | |
40 end |