Mercurial > hg > ltpda
diff m-toolbox/test/repo_tests/test_provenance.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/repo_tests/test_provenance.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,39 @@ +function test_provenance(varargin) + +if nargin == 0 + [conn, username] = mysql_connect('localhost', 'ltpda_test'); +else + conn = varargin{1}; + username = varargin{2}; +end + +%% Submit a mfir + +p = provenance; + +sinfo.conn = conn; +sinfo.username = username; +sinfo.experiment_title = 'submit provenance'; +sinfo.experiment_description = 'this is just a test of the whole thing'; +sinfo.reference_ids = ''; +sinfo.additional_comments = 'none'; +sinfo.additional_authors = 'no one'; + + +[ids, cid] = ltpda_obj_submit(p, sinfo); + +%% Retrieve the object + +q = ltpda_obj_retrieve(conn, cid); + +%% Close connection +if nargin == 0 + close(conn); +end + + +%% Test + +if p ~= q + error('### provenance objects are not the same.') +end