Index: trunk/psLib/test/image/tst_psImage.c
===================================================================
--- trunk/psLib/test/image/tst_psImage.c	(revision 3973)
+++ trunk/psLib/test/image/tst_psImage.c	(revision 3976)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-19 02:49:40 $
+ *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-19 05:03:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -22,5 +22,4 @@
 
 static psS32 testImageAlloc(void);
-static psS32 testImageCopy(void);
 static psS32 testRegion(void);
 
@@ -28,6 +27,5 @@
                               {testImageAlloc,546,"psImageAlloc",0,false},
                               {testImageAlloc,548,"psImageFree",0,true},
-                              {testImageCopy,551,"psImageCopy",0,false},
-                              {testRegion,790,"psRegionAlloc",0,false},
+                              {testRegion,790,"psRegionSet",0,false},
                               {testRegion,791,"psRegionFromString",0,true},
                               {NULL}
@@ -237,145 +235,4 @@
 }
 
-psS32 testImageCopy(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* img3 = NULL;
-    psImage* img4 = NULL;
-    psU32 c = 128;
-    psU32 r = 256;
-
-    img = psImageAlloc(c,r,PS_TYPE_F32);
-    for (unsigned row=0;row<r;row++) {
-        psF32* imgRow = img->data.F32[row];
-        for (unsigned col=0;col<c;col++) {
-            imgRow[col] = (psF32)(row+col);
-        }
-    }
-    img2 = psImageAlloc(c,r,PS_TYPE_F32);
-    for (unsigned row=0;row<r;row++) {
-        psF32* img2Row = img2->data.F32[row];
-        for (unsigned col=0;col<c;col++) {
-            img2Row[col] = 0.0f;
-        }
-    }
-
-    img3 = psImageCopy(img2,img,PS_TYPE_F32);
-
-    // Verify the returned psImage structure pointer is equal to the input parameter output.
-    if (img2 != img3) {
-        psError(PS_ERR_UNKNOWN, true,"the image given for recycled wasn't");
-        return 1;
-    }
-
-    // Verify the returned psImage structure is the same type as the input image structure
-    // if the specified output argument is NULL.
-    img4 = psImageCopy(NULL,img,PS_TYPE_F32);
-    if (img4 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"output image doesn't exist");
-        return 4;
-    }
-    if (img4->type.type != img->type.type) {
-        psError(PS_ERR_UNKNOWN, true,"output image is not the same type as input image");
-        return 4;
-    }
-    for (psU32 row=0;row<r;row++) {
-        psF32* imgInRow = img->data.F32[row];
-        psF32* imgOutRow = img4->data.F32[row];
-        for (unsigned col=0;col<c;col++) {
-            if( imgInRow[col] != imgOutRow[col] ) {
-                psError(PS_ERR_UNKNOWN, true,"Input image not equal to output image at %d,%d!",
-                        col, row);
-                return 4;
-            }
-        }
-    }
-
-    // Verify the returned psImage structure member are equal to the values in
-    // the input psImage structure input.
-
-    #define testImageCopyType(IN,OUT) \
-    img = psImageRecycle(img,c,r,PS_TYPE_##IN); \
-    for (unsigned row=0;row<r;row++) { \
-        ps##IN* imgRow = img->data.IN[row]; \
-        for (unsigned col=0;col<c;col++) { \
-            imgRow[col] = (ps##IN)(row+col); \
-        } \
-    } \
-    img2 = psImageCopy(img2,img,PS_TYPE_##OUT); \
-    if (img2 == NULL) { \
-        psError(PS_ERR_UNKNOWN, true,"psImageCopy failed to copy U8."); \
-        return 2; \
-    } \
-    for (psU32 row=0;row<r;row++) { \
-        ps##IN* imgRow = img->data.IN[row]; \
-        ps##OUT* img2Row = img2->data.OUT[row]; \
-        for (psU32 col=0;col<c;col++) { \
-            if (abs(imgRow[col] - (ps##IN)(row+col)) > 0.5) { \
-                psError(PS_ERR_UNKNOWN, true,"Input image was changed at %d,%d!", \
-                        col,row); \
-                return 2; \
-            } \
-            if (abs(img2Row[col] - (ps##OUT)(imgRow[col])) > 0.5) { \
-                psError(PS_ERR_UNKNOWN, true,"returned psImage values after copy don't match at %d,%d " \
-                        "(%d vs %d)",\
-                        col,row,img2Row[col], (ps##OUT)(imgRow[col])); \
-                return 2; \
-            } \
-        } \
-    }
-
-    #define testImageCopyTypes(IN) \
-    printf("to psF32\n"); \
-    testImageCopyType(IN,F32);\
-    printf("to psF64\n"); \
-    testImageCopyType(IN,F64); \
-    printf("to psU8\n"); \
-    testImageCopyType(IN,U8); \
-    printf("to psU16\n"); \
-    testImageCopyType(IN,U16); \
-    printf("to psU32\n"); \
-    testImageCopyType(IN,U32); \
-    printf("to psS8\n"); \
-    testImageCopyType(IN,S8);\
-    printf("to psS16\n"); \
-    testImageCopyType(IN,S16);\
-    printf("to psS32\n"); \
-    testImageCopyType(IN,S32);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psU8");
-    testImageCopyTypes(U8);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psU16");
-    testImageCopyTypes(U16);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psU32");
-    testImageCopyTypes(U32);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psS8");
-    testImageCopyTypes(S8);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psS16");
-    testImageCopyTypes(S16);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psS32");
-    testImageCopyTypes(S32);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psF32");
-    testImageCopyTypes(F32);
-    psLogMsg(__func__,PS_LOG_INFO,"Image Copy Test for psF64");
-    testImageCopyTypes(F64);
-
-    // Verify the returned psImage structure pointer is null and program
-    // execution doesn't stop, if the input parameter input is null.
-    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
-    img3 = psImageCopy(NULL,NULL,PS_TYPE_F32);
-    if (img3 != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageCopy didn't return NULL when input image was NULL.");
-        return 3;
-    }
-
-    psFree(img);
-    psFree(img2);
-    psFree(img3);
-    psFree(img4);
-
-    return 0;
-}
-
 static psS32 testRegion(void)
 {
@@ -385,15 +242,8 @@
     // Testpoint #790
 
-    psRegion* region = psRegionAlloc(1,2,3,4);
+    psRegion region = psRegionSet(1,2,3,4);
 
     testNum++;
-    if (region == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psRegionAlloc returned a NULL pointer.");
-        return testNum;
-    }
-
-    testNum++;
-    if (region->x0 != 1 || region->x1 != 2 || region->y0 != 3 || region->y1 != 4) {
+    if (region.x0 != 1 || region.x1 != 2 || region.y0 != 3 || region.y1 != 4) {
         psError(PS_ERR_UNKNOWN, false,
                 "The region attributes are not set properly (%s)",
@@ -402,6 +252,4 @@
     }
 
-    psFree(region);
-
     // Testpoint #791
 
@@ -409,12 +257,5 @@
 
     testNum++;
-    if (region == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psRegionFromString returned a NULL pointer.");
-        return testNum;
-    }
-
-    testNum++;
-    if (region->x0 != 1 || region->x1 != 2 || region->y0 != 3 || region->y1 != 4) {
+    if (region.x0 != 1 || region.x1 != 2 || region.y0 != 3 || region.y1 != 4) {
         psError(PS_ERR_UNKNOWN, false,
                 "The region attributes are not set properly (%s)",
@@ -423,9 +264,8 @@
     }
 
-    psFree(region);
     region = psRegionFromString("[1:2,3:]");
 
     testNum++;
-    if (region != NULL) {
+    if (! isnan(region.x0)) {
         psError(PS_ERR_UNKNOWN, false,
                 "psRegionFromString returned a non-NULL pointer given a malformed string.");
