Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_timeformat.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_timeformat(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 timeformat | |
11 default_matlab_str = 'yyyy-mm-dd HH:MM:SS'; | |
12 default_matlab_nr = 31; | |
13 default_java_str = 'yyyy-MM-dd HH:mm:ss'; | |
14 | |
15 p = timeformat(getappdata(0, 'time_format_str'),... | |
16 default_matlab_str,... | |
17 default_matlab_nr,... | |
18 default_java_str); | |
19 | |
20 | |
21 sinfo.conn = conn; | |
22 sinfo.username = username; | |
23 sinfo.experiment_title = 'submit timeformat'; | |
24 sinfo.experiment_description = 'this is just a test of the whole thing'; | |
25 sinfo.reference_ids = ''; | |
26 sinfo.additional_comments = 'none'; | |
27 sinfo.additional_authors = 'no one'; | |
28 | |
29 | |
30 [ids, cid] = ltpda_obj_submit(p, sinfo); | |
31 | |
32 %% Retrieve the object | |
33 | |
34 q = ltpda_obj_retrieve(conn, cid); | |
35 | |
36 %% Close connection | |
37 if nargin == 0 | |
38 close(conn); | |
39 end | |
40 | |
41 | |
42 %% Test | |
43 | |
44 if p ~= q | |
45 error('### timeformat objects are not the same.') | |
46 end |