Changeset 125 for trunk/test


Ignore:
Timestamp:
Nov 4, 2005 3:19:11 PM (18 years ago)
Author:
dkearney
Message:

1) removed "as" string from c++'s element() function because
the function does not have the capacity to return anything
other than RpLibrary? Instances
2) changed get() functions in library module to return strings.
this change was propagated to matlab, octave, c, fortran, c++
bindings.
3) fixed rpFreeLibrary inside of c interface, now function accepts
a pointer to a pointer to RpLibrary? (lib) and sets *lib equal to
null
4) added doxygen target to makefile. (make docs), to get graphics
you need the program named dot (debian: apt-get install graphviz)
otherwise you will get errors for the portion of the proceedure
where it is trying to create the graphics.

Location:
trunk/test/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/src/RpLibraryF_test.f

    r115 r125  
    3232      END SUBROUTINE  test_element
    3333
     34      SUBROUTINE  test_get(lib,path)
     35        integer lib
     36        character*100 path, retText
     37
     38        print *,"TESTING GET       : path = ",path
     39
     40        call rp_lib_get(lib, path, retText)
     41
     42        print *,"retText = ",retText
     43      END SUBROUTINE  test_get
     44
    3445      SUBROUTINE  test_get_str(lib,path)
    3546        integer lib
    3647        character*100 path, retText
    3748
    38         print *,"TESTING GET: path = ",path
     49        print *,"TESTING GET STRING: path = ",path
    3950
    40         call rp_lib_get(lib, path, retText)
     51        call rp_lib_get_str(lib, path, retText)
    4152
    4253        print *,"retText = ",retText
     
    4657        integer lib
    4758        double precision rslt, rp_lib_get_double
    48         character*100 path, retText
     59        character*100 path
    4960
    50         print *,"TESTING GET: path = ",path
     61        print *,"TESTING GET DOUBLE: path = ",path
    5162
    5263        rslt = rp_lib_get_double(lib, path)
     
    5869        IMPLICIT NONE
    5970
    60         integer rp_lib, rp_units_convert_dbl, rp_units_add_presets
    61         integer rp_lib_element_obj
     71        integer rp_lib
    6272
    63         integer driver, ok
    64         double precision T, Ef, kT, Emin, Emax, dE, f, E
    65         CHARACTER*100 inFile, strVal, path
    66         character*40 xy
     73        integer driver
     74        CHARACTER*100 inFile, path
    6775
    6876        call getarg(1,inFile)
     
    7078        ! print *,"dict key = ",driver
    7179
    72         ok = rp_units_add_presets("all")
    73 
    7480        ! TESTING ELEMENT
    75         !call test_element(driver, "input.number(min)")
    7681        path = "input.number(min)"
    7782        call test_element(driver, path)
    78         !call rp_lib_get(driver, path, strVal)
    79         !print *,"strVal = ",strVal
     83
     84        ! TESTING GET
     85        path = "input.number(min).current"
     86        call test_get(driver, path)
    8087
    8188        ! TESTING GET STRING
  • trunk/test/src/RpLibrary_test.cc

    r115 r125  
    1616int test_element (RpLibrary* lib, std::string path );
    1717int test_get (RpLibrary* lib, std::string path );
     18int test_getString (RpLibrary* lib, std::string path );
     19int test_getDouble (RpLibrary* lib, std::string path );
    1820
    1921int test_element (RpLibrary* lib, std::string path )
     
    3234        std::cout << "searchEle   id = :" << searchEle->nodeId()   << ":" << std::endl;
    3335        std::cout << "searchEle type = :" << searchEle->nodeType() << ":" << std::endl;
     36        retVal = 0;
     37    }
     38
     39    return retVal;
     40}
     41
     42int test_get (RpLibrary* lib, std::string path )
     43{
     44    int retVal = 1;
     45    std::string searchVal = lib->get(path);
     46
     47    std::cout << "TESTING GET       : path = " << path << std::endl;
     48
     49    if (searchVal.empty()) {
     50        std::cout << "searchVal is EMPTY STRING" << std::endl;
     51        retVal = 1;
     52    }
     53    else {
     54        std::cout << "searchVal = :" << searchVal << ":" << std::endl;
    3455        retVal = 0;
    3556    }
     
    135156    RpLibrary lib2;
    136157
    137     if (argc < 3)
     158    if (argc < 2)
    138159    {
    139         printf("usage: RpLibrary_test infile.xml outfile.xml\n");
     160        printf("usage: RpLibrary_test infile.xml\n");
    140161        return EXIT_FAILURE;
    141162    }
     
    152173    test_getString(lib, "output.curve.about.label");
    153174
     175    lib->put("input.number(test_one).default", "3000");
     176    test_get(lib, "input.number(test_one).default");
    154177    lib->put("input.number(test).default", "1000");
    155178    test_getString(lib, "input.number(test).default");
Note: See TracChangeset for help on using the changeset viewer.