Changeset 125 for trunk/test
- Timestamp:
- Nov 4, 2005 3:19:11 PM (18 years ago)
- Location:
- trunk/test/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/src/RpLibraryF_test.f
r115 r125 32 32 END SUBROUTINE test_element 33 33 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 34 45 SUBROUTINE test_get_str(lib,path) 35 46 integer lib 36 47 character*100 path, retText 37 48 38 print *,"TESTING GET : path = ",path49 print *,"TESTING GET STRING: path = ",path 39 50 40 call rp_lib_get (lib, path, retText)51 call rp_lib_get_str(lib, path, retText) 41 52 42 53 print *,"retText = ",retText … … 46 57 integer lib 47 58 double precision rslt, rp_lib_get_double 48 character*100 path , retText59 character*100 path 49 60 50 print *,"TESTING GET : path = ",path61 print *,"TESTING GET DOUBLE: path = ",path 51 62 52 63 rslt = rp_lib_get_double(lib, path) … … 58 69 IMPLICIT NONE 59 70 60 integer rp_lib, rp_units_convert_dbl, rp_units_add_presets 61 integer rp_lib_element_obj 71 integer rp_lib 62 72 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 67 75 68 76 call getarg(1,inFile) … … 70 78 ! print *,"dict key = ",driver 71 79 72 ok = rp_units_add_presets("all")73 74 80 ! TESTING ELEMENT 75 !call test_element(driver, "input.number(min)")76 81 path = "input.number(min)" 77 82 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) 80 87 81 88 ! TESTING GET STRING -
trunk/test/src/RpLibrary_test.cc
r115 r125 16 16 int test_element (RpLibrary* lib, std::string path ); 17 17 int test_get (RpLibrary* lib, std::string path ); 18 int test_getString (RpLibrary* lib, std::string path ); 19 int test_getDouble (RpLibrary* lib, std::string path ); 18 20 19 21 int test_element (RpLibrary* lib, std::string path ) … … 32 34 std::cout << "searchEle id = :" << searchEle->nodeId() << ":" << std::endl; 33 35 std::cout << "searchEle type = :" << searchEle->nodeType() << ":" << std::endl; 36 retVal = 0; 37 } 38 39 return retVal; 40 } 41 42 int 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; 34 55 retVal = 0; 35 56 } … … 135 156 RpLibrary lib2; 136 157 137 if (argc < 3)158 if (argc < 2) 138 159 { 139 printf("usage: RpLibrary_test infile.xml outfile.xml\n");160 printf("usage: RpLibrary_test infile.xml\n"); 140 161 return EXIT_FAILURE; 141 162 } … … 152 173 test_getString(lib, "output.curve.about.label"); 153 174 175 lib->put("input.number(test_one).default", "3000"); 176 test_get(lib, "input.number(test_one).default"); 154 177 lib->put("input.number(test).default", "1000"); 155 178 test_getString(lib, "input.number(test).default");
Note: See TracChangeset
for help on using the changeset viewer.