IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 733


Ignore:
Timestamp:
May 18, 2004, 4:16:58 PM (22 years ago)
Author:
desonia
Message:

changed *.d again to not use 'sed -i' (which is not supported in OS/X).

Location:
trunk/psLib/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/Makefile

    r714 r733  
    33##  Makefile:   test/collections
    44##
    5 ##  $Revision: 1.5 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-05-18 02:34:00 $
     5##  $Revision: 1.6 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-05-19 02:16:58 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5353
    5454%.o : %.c
    55         $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $< 
     55        $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $<
    5656
    5757%   : %.o
    58         $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $< 
     58        $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $<
    5959
    6060%.lint: %.c
    6161        splint +posixlib -exportlocal -realcompare $(INCLUDE_GLOBAL) $? > $@; cat $@
    6262
     63%.d: %.c
     64        $(CC) -M $(CFLAGS) $< > $@.tmp
     65        sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' $@.tmp > $@
     66        $(RM) -f $@.tmp
    6367
  • trunk/psLib/test/image/tst_psImage.c

    r720 r733  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-05-18 23:28:33 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-05-19 02:16:58 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525
    2626testDescription tests[] = {
    27                               {testImageAlloc,"546-testImageAlloc",0},
    28                               {testImageSubset,"547-testImageSubset",0},
     27                              {testImageAlloc,"546/548-testImageAlloc/Free",0},
     28                              {testImageSubset,"547/549-testImageSubset",0},
    2929                              {NULL}
    3030                          };
     
    4444int testImageAlloc(void)
    4545{
    46 
     46    int currentId = psMemGetId();
    4747    psImage* image = NULL;
    4848    unsigned int sizes = 6;
     
    217217            }
    218218
     219            // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no
     220            // children is freed.
    219221            psImageFree(image);
     222            psMemCheckLeaks(currentId,NULL,NULL);
     223            psMemCheckCorruption(1);
     224
    220225        }
    221226    }
     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);
    222243
    223244    return 0;
     
    227248int testImageSubset(void)
    228249{
     250    int currentId = psMemGetId();
    229251    psImage preSubsetStruct;
    230252    psImage* original;
     
    442464    }
    443465
     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
    444483    return 0;
    445484}
    446 
Note: See TracChangeset for help on using the changeset viewer.