source: trunk/oldtest/src/matlab/test_make_metric.m @ 2038

Last change on this file since 2038 was 154, checked in by dkearney, 18 years ago

modified matlab bindings and tests.
includes all popular functions available in RpLibrary? and RpUnits
compile and run, but not all tests work as they should
some of these functions will be removed soon because the id field is
no longer a valid argument. path ids should be incorporated in paths from now on.

File size: 1.5 KB
Line 
1% ----------------------------------------------------------------------
2%  TEST: Matlab's Rappture Library Test Functions.
3%
4%   [err] = test_make_metric(unitName)
5%
6%
7% ======================================================================
8%  AUTHOR:  Derrick Kearney, Purdue University
9%  Copyright (c) 2004-2005  Purdue Research Foundation
10%
11%  See the file "license.terms" for information on usage and
12%  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13% ======================================================================
14
15function [err] = test_make_metric(unitName)
16    err = 1;
17    disp(sprintf('\n\nTESTING rpUnitsMakeMetric\n'));
18    [unitHandle,err] = rpUnitsFind(unitName);
19    if ~err && unitHandle
20        [err] = rpUnitsMakeMetric(unitHandle);
21        if ~err
22            [unitHandle,err] = rpUnitsFind(['c',unitName]);
23            if ~err
24                [retStr,err] = rpUnitsGetUnitsName(unitHandle);
25                if ~err
26                    disp(sprintf ('centi-%s = %s\n', unitName,retStr));
27                else
28                    disp(sprintf('Error in rpUnitsGetUnitsName testing rpUnitsMakeMetric\n'));
29                end
30            else
31                disp(sprintf('Error in rpUnitsFind testing rpUnitsMakeMetric\n'));
32            end
33        else
34            disp(sprintf('Error within rpUnitsMakeMetric function\n'));
35        end
36    else
37        disp(sprintf ('rpUnitsFind FAILED while testing rpUnitsGetUnits\n'));
38    end
39return
Note: See TracBrowser for help on using the repository browser.