Index: trunk/psLib/test/sys/tst_psMemory.c
===================================================================
--- trunk/psLib/test/sys/tst_psMemory.c	(revision 4877)
+++ trunk/psLib/test/sys/tst_psMemory.c	(revision 4898)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-08-25 23:42:07 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-30 01:14:13 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
 static psS32 TPmemCorruption( void );
 static psS32 TPmultipleFree( void );
+static psS32 memCheckTypes( void );
 void memProblemCallback( psMemBlock *ptr, const char *filename, unsigned int lineno );
 
@@ -53,4 +54,5 @@
                               {TPFreeReferencedMemory, 456, "freeReferencedMemory", 0, false},
                               {TPmultipleFree, 699, "multipleFree", -6, false},
+                              {memCheckTypes, 700, "psMemCheckType", 0, false},
                               {NULL}
                           };
@@ -534,2 +536,296 @@
     return 0;
 }
+
+static psS32 memCheckTypes( void )
+{
+    //    psArray *negative;
+    //    negative = psArrayAlloc(2);
+    //    psMetadata *neg;
+    //    neg = psMetadataAlloc();
+
+    psArray *array;
+    array = psArrayAlloc(100);
+    if ( !psMemCheckType(PS_DATA_ARRAY, array) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n");
+        psFree(array);
+        return 1;
+    }
+    //    if ( psMemCheckType(PS_DATA_ARRAY, neg) )
+    //    {
+    //        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n");
+    //        return 1;
+    //    }
+    psFree(array);
+
+    psBitSet *bits;
+    bits = psBitSetAlloc(100);
+    if ( !psMemCheckType(PS_DATA_BITSET, bits) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n");
+        psFree(bits);
+        return 1;
+    }
+    //    if ( psMemCheckType(PS_DATA_BITSET, negative) )
+    //    {
+    //        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n");
+    //        return 1;
+    //    }
+    psFree(bits);
+
+    psCube *cube;
+    cube = psCubeAlloc();
+    if ( !psMemCheckType(PS_DATA_CUBE, cube) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckCube failed in memCheckType. \n");
+        psFree(cube);
+        return 1;
+    }
+    psFree(cube);
+
+    /*
+        psFits *fits;
+        char *filename = "";
+        fits = psFitsAlloc(filename);
+        if ( !psMemCheckType(PS_DATA_FITS, fits) )
+        {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckFits failed in memCheckType. \n");
+            psFree(fits);
+            return 1;
+        }
+        psFree(fits);
+    */
+    psHash *hash;
+    hash = psHashAlloc(100);
+    if ( !psMemCheckType(PS_DATA_HASH, hash) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHash failed in memCheckType. \n");
+        psFree(hash);
+        return 1;
+    }
+    psFree(hash);
+
+    psHistogram *histogram;
+    histogram = psHistogramAlloc(1.1, 2.2, 2);
+    if ( !psMemCheckType(PS_DATA_HISTOGRAM, histogram) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHistogram failed in memCheckType. \n");
+        psFree(histogram);
+        return 1;
+    }
+    psFree(histogram);
+
+    psImage *image;
+    image = psImageAlloc(5, 5, PS_TYPE_F32);
+    if ( !psMemCheckType(PS_DATA_IMAGE, image) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckImage failed in memCheckType. \n");
+        psFree(image);
+        return 1;
+    }
+    psFree(image);
+
+    psKernel *kernel;
+    kernel = psKernelAlloc(0, 1, 0, 1);
+    if ( !psMemCheckType(PS_DATA_KERNEL, kernel) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckKernel failed in memCheckType. \n");
+        psFree(kernel);
+        return 1;
+    }
+    psFree(kernel);
+
+    psList *list;
+    list = psListAlloc(NULL);
+    if ( !psMemCheckType(PS_DATA_LIST, list) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckList failed in memCheckType. \n");
+        psFree(list);
+        return 1;
+    }
+    psFree(list);
+
+    /*
+        psLookupTable *lookup;
+        char *filename = "";
+        char *format = "%d";
+        lookup = psLookupTableAlloc(filename, format, 0);
+        if ( !psMemCheckType(PS_DATA_LOOKUPTABLE, lookup) )
+        {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckLookupTable failed in memCheckType. \n");
+            psFree(lookup);
+            return 1;
+        }
+        psFree(lookup);
+    */
+    psMetadata *metadata;
+    metadata = psMetadataAlloc();
+    if ( !psMemCheckType(PS_DATA_METADATA, metadata) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadata failed in memCheckType. \n");
+        psFree(metadata);
+        return 1;
+    }
+    psFree(metadata);
+
+    psMetadataItem *metaItem;
+    metaItem = psMetadataItemAlloc("name", PS_DATA_S32, "COMMENT", 1);
+    if ( !psMemCheckType(PS_DATA_METADATAITEM, metaItem) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadataItem failed in memCheckType. \n");
+        psFree(metaItem);
+        return 1;
+    }
+    psFree(metaItem);
+
+    psMinimization *min;
+    min = psMinimizationAlloc(3, 0.1);
+    if ( !psMemCheckType(PS_DATA_MINIMIZATION, min) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMinimization failed in memCheckType. \n");
+        psFree(min);
+        return 1;
+    }
+    psFree(min);
+
+    psPixels *pixels;
+    pixels = psPixelsAlloc(100);
+    if ( !psMemCheckType(PS_DATA_PIXELS, pixels) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPixels failed in memCheckType. \n");
+        psFree(pixels);
+        return 1;
+    }
+    psFree(pixels);
+
+    psPlane *plane;
+    plane = psPlaneAlloc();
+    if ( !psMemCheckType(PS_DATA_PLANE, plane) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlane failed in memCheckType. \n");
+        psFree(plane);
+        return 1;
+    }
+    psFree(plane);
+
+    psPlaneDistort *planeDistort;
+    planeDistort = psPlaneDistortAlloc(1, 1, 1, 1);
+    if ( !psMemCheckType(PS_DATA_PLANEDISTORT, planeDistort) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneDistort failed in memCheckType. \n");
+        psFree(planeDistort);
+        return 1;
+    }
+    psFree(planeDistort);
+
+    psPlaneTransform *planeTransform;
+    planeTransform = psPlaneTransformAlloc(1, 1);
+    if ( !psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneTransform failed in memCheckType. \n");
+        psFree(planeTransform);
+        return 1;
+    }
+    psFree(planeTransform);
+
+    psPolynomial1D *poly1;
+    poly1 = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD);
+    if ( !psMemCheckType(PS_DATA_POLYNOMIAL1D, poly1) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial1D failed in memCheckType. \n");
+        psFree(poly1);
+        return 1;
+    }
+    psFree(poly1);
+
+    psPolynomial2D *poly2;
+    poly2 = psPolynomial2DAlloc(2, 1, PS_POLYNOMIAL_ORD);
+    if ( !psMemCheckType(PS_DATA_POLYNOMIAL2D, poly2) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial2D failed in memCheckType. \n");
+        psFree(poly2);
+        return 1;
+    }
+    psFree(poly2);
+
+    psPolynomial3D *poly3;
+    poly3 = psPolynomial3DAlloc(2, 1, 2, PS_POLYNOMIAL_ORD);
+    if ( !psMemCheckType(PS_DATA_POLYNOMIAL3D, poly3) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial3D failed in memCheckType. \n");
+        psFree(poly3);
+        return 1;
+    }
+    psFree(poly3);
+
+    psPolynomial4D *poly4;
+    poly4 = psPolynomial4DAlloc(2, 1, 2, 1, PS_POLYNOMIAL_ORD);
+    if ( !psMemCheckType(PS_DATA_POLYNOMIAL4D, poly4) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial4D failed in memCheckType. \n");
+        psFree(poly4);
+        return 1;
+    }
+    psFree(poly4);
+
+    psProjection *proj;
+    proj = psProjectionAlloc(1, 1, 2.1, 2.1, PS_PROJ_TAN);
+    if ( !psMemCheckType(PS_DATA_PROJECTION, proj) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckProjection failed in memCheckType. \n");
+        psFree(proj);
+        return 1;
+    }
+    psFree(proj);
+
+    psScalar *scalar;
+    psC64 c64 = 1.1 + 7I;
+    scalar = psScalarAlloc(c64, PS_TYPE_F64);
+    if ( !psMemCheckType(PS_DATA_SCALAR, scalar) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckScalar failed in memCheckType. \n");
+        psFree(scalar);
+        return 1;
+    }
+    psFree(scalar);
+
+    psSphere *sphere;
+    sphere = psSphereAlloc();
+    if ( !psMemCheckType(PS_DATA_SPHERE, sphere) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphere failed in memCheckType. \n");
+        psFree(sphere);
+        return 1;
+    }
+    psFree(sphere);
+
+    psSphereRot *sphereRot;
+    sphereRot = psSphereRotAlloc(0, 0, 20);
+    if ( !psMemCheckType(PS_DATA_SPHEREROT, sphereRot) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphereRot failed in memCheckType. \n");
+        psFree(sphereRot);
+        return 1;
+    }
+    psFree(sphereRot);
+
+    psSpline1D *spline;
+    spline = psSpline1DAlloc(2, 1, 0, 2);
+    if ( !psMemCheckType(PS_DATA_SPLINE1D, spline) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSpline1D failed in memCheckType. \n");
+        psFree(spline);
+        return 1;
+    }
+    psFree(spline);
+
+    psStats *stats;
+    stats = psStatsAlloc(PS_STAT_MAX);
+    if ( !psMemCheckType(PS_DATA_STATS, stats) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckStats failed in memCheckType. \n");
+        psFree(stats);
+        return 1;
+    }
+    psFree(stats);
+
+    /*    psTime *time;
+        time = psTimeAlloc(PS_TIME_UT1);
+        if ( !psMemCheckType(PS_DATA_TIME, time) )
+        {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckTime failed in memCheckType. \n");
+            psFree(time);
+            return 1;
+        }
+        psFree(time);
+    */
+    psVector *vector;
+    vector = psVectorAlloc(100, PS_TYPE_F32);
+    if ( !psMemCheckType(PS_DATA_VECTOR, vector) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckVector failed in memCheckType. \n");
+        psFree(vector);
+        return 1;
+    }
+    psFree(vector);
+
+
+    //    psFree(negative);
+    //    psFree(neg);
+
+    return 0;
+}
Index: trunk/psLib/test/sys/verified/tst_psMemory.stderr
===================================================================
--- trunk/psLib/test/sys/verified/tst_psMemory.stderr	(revision 4877)
+++ trunk/psLib/test/sys/verified/tst_psMemory.stderr	(revision 4898)
@@ -151,2 +151,11 @@
 ---> TESTPOINT PASSED (psMemory{multipleFree} | tst_psMemory.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMemory.c                                             *
+*            TestPoint: psMemory{psMemCheckType}                                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psMemory{psMemCheckType} | tst_psMemory.c)
+
