Changeset 3111
- Timestamp:
- Feb 2, 2005, 11:58:49 AM (21 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 2 edited
-
tst_psList.c (modified) (7 diffs)
-
verified/tst_psList.stderr (modified) (4 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."); -
trunk/psLib/test/collections/verified/tst_psList.stderr
r3108 r3111 18 18 <DATE><TIME>|<HOST>|I|testListAdd 19 19 psListAdd shall add an element to list 20 <DATE><TIME>|<HOST>|I|testListAdd 21 Following should generate an error for using NULL list. 20 22 <DATE><TIME>|<HOST>|E|psListAdd (psList.c:<LINENO>) 21 23 Specified psList reference is NULL. 24 <DATE><TIME>|<HOST>|I|testListAdd 25 Following should generate an error msg to add NULL data 22 26 <DATE><TIME>|<HOST>|E|psListAdd (psList.c:<LINENO>) 23 27 Specified data item is NULL. … … 25 29 Following should error with invalid insert location 26 30 <DATE><TIME>|<HOST>|E|psListIteratorSet (psList.c:<LINENO>) 27 Specified location, - 7, is invalid.31 Specified location, -6, is invalid. 28 32 <DATE><TIME>|<HOST>|I|testListAdd 29 33 Following should be a warning. … … 133 137 <DATE><TIME>|<HOST>|E|psListAddAfter (psList.c:<LINENO>) 134 138 Specified iterator is NULL. 139 <DATE><TIME>|<HOST>|I|testListAddAfter 140 Non-mutable list should generate error message 141 <DATE><TIME>|<HOST>|E|psListAddAfter (psList.c:<LINENO>) 142 Specified iterator indicates list is non-mutable. 135 143 136 144 ---> TESTPOINT PASSED (psList{psListAddAfter} | tst_psList.c) … … 150 158 <DATE><TIME>|<HOST>|E|psListAddBefore (psList.c:<LINENO>) 151 159 Specified iterator is NULL. 160 <DATE><TIME>|<HOST>|I|testListAddBefore 161 Non-mutable list should generate error message 162 <DATE><TIME>|<HOST>|E|psListAddBefore (psList.c:<LINENO>) 163 Specified iterator indicates list is non-mutable. 152 164 153 165 ---> TESTPOINT PASSED (psList{psListAddBefore} | tst_psList.c)
Note:
See TracChangeset
for help on using the changeset viewer.
