Changeset 3111 for trunk/psLib/test/collections/tst_psList.c
- Timestamp:
- Feb 2, 2005, 11:58:49 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/collections/tst_psList.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psList.c
r3108 r3111 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-02-02 2 0:20:18 $8 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-02-02 21:58:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 185 185 } 186 186 187 // Verify error message is generate with non-mutable iterator 188 psLogMsg(__func__,PS_LOG_INFO,"Non-mutable list should generate error message"); 189 currentIterator->mutable = false; 190 if(psListAddAfter(currentIterator,data2)) { 191 psError(PS_ERR_UNKNOWN,true,"psListAddAfter should have generated error for non-mutable list add"); 192 return 7; 193 } 194 currentIterator->mutable = true; 195 187 196 psFree(data); 188 197 psFree(data1); … … 256 265 } 257 266 267 // Verify error message is generate with non-mutable iterator 268 psLogMsg(__func__,PS_LOG_INFO,"Non-mutable list should generate error message"); 269 currentIterator->mutable = false; 270 if(psListAddBefore(currentIterator,data2)) { 271 psError(PS_ERR_UNKNOWN,true,"psListAddBefore should have generated error for non-mutable list add"); 272 return 7; 273 } 274 currentIterator->mutable = true; 275 258 276 psFree(data1); 259 277 psFree(data2); … … 284 302 285 303 // 1. list is NULL (error) 304 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for using NULL list."); 286 305 if (psListAdd(NULL,PS_LIST_HEAD,data)) { 287 306 psError(PS_ERR_UNKNOWN, true,"psListAdd was given a NULL list, but returned a true/success."); … … 297 316 298 317 // 2. data is NULL (error, list should not grow) 318 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error msg to add NULL data"); 299 319 if (psListAdd(list, PS_LIST_HEAD,NULL)) { 300 320 psError(PS_ERR_UNKNOWN, true,"psListAdd successfully added a NULL data item?"); … … 428 448 *data = 7; 429 449 // Test requirment SDR-169 430 if ( ! psListAdd(list, 2,data) ) {450 if ( ! psListAdd(list,-2,data) ) { 431 451 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 2 position."); 432 452 return 32; 433 453 } 454 434 455 // Test requirment SDR-175 435 456 if (psMemGetRefCounter(data) != 2) { … … 439 460 psFree(data); 440 461 // verify that the size incremented 441 if (list->size != 6 || *(psS32 *)list-> head->next->next->data != 7) {462 if (list->size != 6 || *(psS32 *)list->tail->prev->data != 7) { 442 463 printListInt(list); 443 464 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2.");
Note:
See TracChangeset
for help on using the changeset viewer.
