Changeset 200 for trunk/test/src/RpLibrary_test.cc
- Timestamp:
- Feb 20, 2006 2:37:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/src/RpLibrary_test.cc
r192 r200 23 23 int test_copy (RpLibrary* fromLib, std::string fromPath, 24 24 RpLibrary* toLib, std::string toPath); 25 int test_remove (RpLibrary* lib, std::string path); 25 26 26 27 int test_element (RpLibrary* lib, std::string path ) … … 172 173 return retVal; 173 174 } 175 176 int test_remove (RpLibrary* lib, std::string path) 177 { 178 RpLibrary* getRslt = NULL; 179 int retVal = 1; 180 std::cout << "TESTING REMOVE:" << std::endl; 181 // std::cout << "lib's xml:" << std::endl << lib->xml() << std::endl; 182 if (lib) { 183 lib->remove(path); 184 if (lib) { 185 getRslt = lib->element(path); 186 if (getRslt) { 187 std::cout << "FAILURE: " << path << " not removed" << std::endl; 188 std::cout << "lib's xml:" << std::endl << lib->xml() << std::endl; 189 } 190 else { 191 std::cout << "SUCCESS: " << path << " removed" << std::endl; 192 retVal = 0; 193 } 194 } 195 } 196 197 return retVal; 198 } 199 174 200 175 201 /* … … 231 257 } 232 258 259 if (!childEle) { 260 std::cout << "No more children" << std::endl; 261 } 262 233 263 return retVal; 234 264 } … … 276 306 test_children(lib,"input","number"); 277 307 308 std::cout << lib->xml() << std::endl; 309 310 RpLibrary* remEle = lib->element("input.test.(min)"); 311 test_remove(remEle,""); 312 remEle->remove(); 313 test_remove(lib, "input.test.(min)"); 314 test_remove(lib, "input.test.(max)"); 278 315 std::cout << lib->xml() << std::endl; 279 316
Note: See TracChangeset
for help on using the changeset viewer.