IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 917


Ignore:
Timestamp:
Jun 7, 2004, 4:41:19 PM (22 years ago)
Author:
desonia
Message:

added tests for empty list/vector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psDlist.c

    r911 r917  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-08 02:17:49 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-08 02:41:19 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    727727    }
    728728
     729    // now, see what happens with a zero-size vector/list
     730    vec = psVectorAlloc(1,PS_TYPE_PTR);
     731    vec->n = 0;
     732    list = psVectorToDlist(vec);
     733    if (list == NULL) {
     734        psError(__func__,"psVectorToDlist didn't create an empty list from an empty vector.");
     735        return 1;
     736    }
     737    psVectorFree(vec);
     738    psDlistFree(list,PS_FREE);
     739
     740    list = psDlistAlloc(NULL);
     741    vec = psDlistToVector(list);
     742    if (vec == NULL) {
     743        psError(__func__,"psVectorToDlist didn't create an empty vector from an empty list.");
     744        return 1;
     745    }
     746    psVectorFree(vec);
     747    psDlistFree(list,PS_FREE);
     748
    729749    psMemCheckLeaks(currentId,NULL,NULL);
    730750    psMemCheckCorruption(1);
Note: See TracChangeset for help on using the changeset viewer.