Changeset 733
- Timestamp:
- May 18, 2004, 4:16:58 PM (22 years ago)
- Location:
- trunk/psLib/test
- Files:
-
- 2 edited
-
collections/Makefile (modified) (2 diffs)
-
image/tst_psImage.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/Makefile
r714 r733 3 3 ## Makefile: test/collections 4 4 ## 5 ## $Revision: 1. 5$ $Name: not supported by cvs2svn $6 ## $Date: 2004-05-1 8 02:34:00$5 ## $Revision: 1.6 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-05-19 02:16:58 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 53 53 54 54 %.o : %.c 55 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $< 55 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $< 56 56 57 57 % : %.o 58 $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $< 58 $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $< 59 59 60 60 %.lint: %.c 61 61 splint +posixlib -exportlocal -realcompare $(INCLUDE_GLOBAL) $? > $@; cat $@ 62 62 63 %.d: %.c 64 $(CC) -M $(CFLAGS) $< > $@.tmp 65 sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' $@.tmp > $@ 66 $(RM) -f $@.tmp 63 67 -
trunk/psLib/test/image/tst_psImage.c
r720 r733 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-05-1 8 23:28:33$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-05-19 02:16:58 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 26 26 testDescription tests[] = { 27 {testImageAlloc,"546 -testImageAlloc",0},28 {testImageSubset,"547 -testImageSubset",0},27 {testImageAlloc,"546/548-testImageAlloc/Free",0}, 28 {testImageSubset,"547/549-testImageSubset",0}, 29 29 {NULL} 30 30 }; … … 44 44 int testImageAlloc(void) 45 45 { 46 46 int currentId = psMemGetId(); 47 47 psImage* image = NULL; 48 48 unsigned int sizes = 6; … … 217 217 } 218 218 219 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no 220 // children is freed. 219 221 psImageFree(image); 222 psMemCheckLeaks(currentId,NULL,NULL); 223 psMemCheckCorruption(1); 224 220 225 } 221 226 } 227 228 // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null. 229 psImageFree(NULL); 230 psMemCheckLeaks(currentId,NULL,NULL); 231 psMemCheckCorruption(1); 232 233 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple 234 // children isfreed. 235 image = psImageAlloc(100,100,PS_TYPE_F32); 236 psImageSubset(NULL,image,50,50,0,0); 237 psImageSubset(NULL,image,50,50,20,20); 238 239 psImageFree(image); 240 241 psMemCheckLeaks(currentId,NULL,NULL); 242 psMemCheckCorruption(1); 222 243 223 244 return 0; … … 227 248 int testImageSubset(void) 228 249 { 250 int currentId = psMemGetId(); 229 251 psImage preSubsetStruct; 230 252 psImage* original; … … 442 464 } 443 465 466 psLogMsg(__func__, PS_LOG_INFO, "psImageFreeChildren shall deallocate any children images of a " 467 "psImage structure"); 468 469 psImageFreeChildren(original); 470 471 // Verify the returned psImage structure member Nchildren is set to zero. 472 if (original->nChildren != 0) { 473 psError(__func__,"psImageFreeChildren 474 row+cols)."); 475 return 25; 476 } 477 478 479 psImageFree(original); 480 psMemCheckLeaks(currentId,NULL,NULL); 481 psMemCheckCorruption(1); 482 444 483 return 0; 445 484 } 446
Note:
See TracChangeset
for help on using the changeset viewer.
