comparison m-toolbox/classes/tests/database/@ltpda_xydata_table/test_xydata_xunits.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 %
2 % DESCRIPTION: Tests the 'xydata' table of the database.
3 %
4 % CHECKS: - Check that the 'xunits' contains the correct
5 % xunits from the test data.
6 %
7 % VERSION: $Id: test_xydata_xunits.m,v 1.2 2011/05/25 16:25:31 ingo Exp $
8 %
9 function varargout = test_xydata_xunits(varargin)
10
11 utp = varargin{1};
12
13 if ~utp.testRunner.skipRepoTests()
14
15 dbTable = 'xydata';
16 tableField = 'xunits';
17
18 % Check that the metadata was set with a submit PLIST
19 try
20 for nn = 1:numel(utp.objIds)
21
22 val = getTableEntry(utp, dbTable, tableField, utp.objIds(nn));
23
24 % Check that we get only one result for the query
25 assert(numel(val)==1)
26
27 % Check that the 'xunits' contains the correct xunits from the test
28 % data.
29 assert(strcmp(val{1}, char(utp.testData(nn).xunits)))
30
31 end
32 catch Me
33 throw(Me);
34 end
35
36 varargout{1} = sprintf('Test the field ''%s'' of the database table ''%s'' with the database %s ', tableField, dbTable, utp.testRunner.repositoryPlist.find('database'));
37 else
38 varargout{1} = 'Skip database test';
39 end
40 end