Mercurial > hg > ltpda
comparison m-toolbox/classes/tests/database/@ltpda_tsdata_table/test_tsdata_yunits.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 'yunits' contains the correct | |
5 % yunits from the test data. | |
6 % | |
7 % VERSION: $Id: test_tsdata_yunits.m,v 1.2 2011/05/25 16:25:31 ingo Exp $ | |
8 % | |
9 function varargout = test_tsdata_yunits(varargin) | |
10 | |
11 utp = varargin{1}; | |
12 | |
13 if ~utp.testRunner.skipRepoTests() | |
14 | |
15 dbTable = 'tsdata'; | |
16 tableField = 'yunits'; | |
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 yunits of | |
28 % the test data | |
29 assert(strcmp(val{1}, char(utp.testData(nn).yunits))) | |
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 |