comparison m-toolbox/classes/tests/database/@ltpda_tsdata_table/test_tsdata_nsecs.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 'tsdata' table of the database.
3 %
4 % CHECKS: - Check that the 'nsecs' contains the correct
5 % number od seconds as the test data.
6 %
7 % VERSION: $Id: test_tsdata_nsecs.m,v 1.2 2011/05/25 16:25:31 ingo Exp $
8 %
9 function varargout = test_tsdata_nsecs(varargin)
10
11 utp = varargin{1};
12
13 if ~utp.testRunner.skipRepoTests()
14
15 dbTable = 'tsdata';
16 tableField = 'nsecs';
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 entry in the table is the same as the nsecs of
28 % the test data
29 assert(abs(val{1} - utp.testData(nn).nsecs) < 1e-12)
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