Index: trunk/psLib/test/image/tst_psImageExtraction.c
===================================================================
--- trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2204)
+++ trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2273)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 00:57:33 $
+*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-11-04 01:05:00 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -87,5 +87,5 @@
     \
     if (out->n != TRUTH_SIZE) { \
-        psError(__func__,"Number of results is wrong (%d, not %d)", \
+        psError(PS_ERR_UNKNOWN,true,"Number of results is wrong (%d, not %d)", \
                 out->n,n); \
         return TESTNUM*4+1; \
@@ -93,5 +93,5 @@
     \
     if (positions->n != TRUTH_SIZE) { \
-        psError(__func__,"Number of results for positions vector is wrong (%d, not %d)", \
+        psError(PS_ERR_UNKNOWN,true,"Number of results for positions vector is wrong (%d, not %d)", \
                 out->n,n); \
         return TESTNUM*4+2; \
@@ -100,5 +100,5 @@
     for (psS32 i=0;i<out->n;i++) { \
         if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \
-            psError(__func__,"Improper result at position %d.  Got %g, expected %g",i, \
+            psError(PS_ERR_UNKNOWN,true,"Improper result at position %d.  Got %g, expected %g",i, \
                     out->data.F64[i],image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \
             return TESTNUM*4+3; \
@@ -106,5 +106,5 @@
         if (DIRECTION == PS_CUT_X_POS || DIRECTION == PS_CUT_X_NEG) { \
             if (positions->data.U32[i] != c/10+TRUTHPIX_X) { \
-                psError(__func__,"Improper positions (%d vs %d) result @ %d.", \
+                psError(PS_ERR_UNKNOWN,true,"Improper positions (%d vs %d) result @ %d.", \
                         positions->data.U32[i],c/10+TRUTHPIX_X,i); \
                 return TESTNUM*4+4; \
@@ -112,5 +112,5 @@
         } else { \
             if (positions->data.U32[i] != r/10+TRUTHPIX_Y) { \
-                psError(__func__,"Improper positions (%d vs %d) result @ %d.", \
+                psError(PS_ERR_UNKNOWN,true,"Improper positions (%d vs %d) result @ %d.", \
                         positions->data.U32[i],r/10+TRUTHPIX_Y,i); \
                 return TESTNUM*4+4; \
@@ -165,5 +165,5 @@
                         stat );
     if ( out != NULL ) {
-        psError( __func__, "Giving a NULL image, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving a NULL image, psImageSlice didn't return NULL as expected" );
         return 101;
     }
@@ -184,5 +184,5 @@
                         NULL );
     if ( out != NULL ) {
-        psError( __func__, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );
         return 102;
     }
@@ -202,5 +202,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );
         return 103;
     }
@@ -220,5 +220,5 @@
                         stat );
     if ( out != NULL ) {
-        psError( __func__, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );
         return 104;
     }
@@ -238,5 +238,5 @@
                         stat );
     if ( out != NULL ) {
-        psError( __func__, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );
         return 105;
     }
@@ -251,5 +251,5 @@
                         stat );
     if ( out != NULL ) {
-        psError( __func__, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );
         return 106;
     }
@@ -264,5 +264,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );
         return 107;
     }
@@ -277,5 +277,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
         return 108;
     }
@@ -296,5 +296,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
         return 109;
     }
@@ -314,5 +314,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Mask size different than image size didn't return NULL as expected" );
+        psError( PS_ERR_UNKNOWN,true, "Mask size different than image size didn't return NULL as expected" );
         return 110;
     }
@@ -330,5 +330,5 @@
                          stat);
     if ( out != NULL ) {
-        psError( __func__, "Mask invalid type didn't return NULL as expected.");
+        psError( PS_ERR_UNKNOWN,true, "Mask invalid type didn't return NULL as expected.");
         return 111;
     }
@@ -345,5 +345,5 @@
                         stat);
     if ( out != NULL ) {
-        psError( __func__, "Input image with invalid type didn't return NULL as expected.");
+        psError( PS_ERR_UNKNOWN,true, "Input image with invalid type didn't return NULL as expected.");
         return 112;
     }
@@ -390,5 +390,5 @@
 
     if (subset2->numCols != c/2 || subset2->numRows != r/2) {
-        psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
                 subset2->numCols, subset2->numRows, c/2,r/2);
         return 1;
@@ -396,5 +396,5 @@
 
     if (subset3->numCols != c/2 || subset3->numRows != r/2) {
-        psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
                 subset3->numCols, subset3->numRows, c/2,r/2);
         return 2;
@@ -407,10 +407,10 @@
         for (psS32 col=0;col<c/2;col++) {
             if (subset2->data.U32[row][col] != original->data.U32[row+r/4][col+c/4]) {
-                psError(__func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
+                psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
                         row,col,subset2->data.U32[row][col], original->data.U32[row+r/4][col+c/4]);
                 return 3;
             }
             if (subset3->data.U32[row][col] != original->data.U32[row][col]) {
-                psError(__func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
+                psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
                         row,col,subset2->data.U32[row][col], original->data.U32[row][col]);
                 return 4;
@@ -423,10 +423,10 @@
 
     if (subset2->type.type != PS_TYPE_U32) {
-        psError(__func__,"psImageSubset output type was not proper(%d, should be %d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset output type was not proper(%d, should be %d).",
                 subset2->type.type, PS_TYPE_U32);
         return 6;
     }
     if (subset3->type.type != PS_TYPE_U32) {
-        psError(__func__,"psImageSubset output type was not proper(%d, should be %d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset output type was not proper(%d, should be %d).",
                 subset3->type.type, PS_TYPE_U32);
         return 7;
@@ -437,10 +437,10 @@
 
     if (subset2->col0 != c/4 || subset2->row0 != r/4) {
-        psError(__func__,"psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).",
                 subset2->col0,subset2->row0,c/4,r/4);
         return 8;
     }
     if (subset3->col0 != 0 || subset3->row0 != 0) {
-        psError(__func__,"psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).",
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).",
                 subset3->col0,subset3->row0,0,0);
         return 9;
@@ -451,5 +451,5 @@
 
     if (subset2->parent != original || subset3->parent != original) {
-        psError(__func__,"psImageSubset didn't set parent.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set parent.");
         return 10;
     }
@@ -458,5 +458,5 @@
 
     if (subset2->children != NULL || subset3->children != NULL) {
-        psError(__func__,"psImageSubset didn't set children to NULL.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set children to NULL.");
         return 11;
     }
@@ -467,9 +467,9 @@
 
     if (original->children == NULL || original->children->n != 2) {
-        psError(__func__,"psImageSubset didn't increment number of children by one per subset.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't increment number of children by one per subset.");
         return 12;
     }
     if (original->children->data[0] != subset2 || original->children->data[1] != subset3) {
-        psError(__func__,"psImageSubset didn't properly store the children pointers.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't properly store the children pointers.");
         return 13;
     }
@@ -482,5 +482,5 @@
     subset1 = psImageSubset(NULL,0,0,c/2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when input image was NULL.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when input image was NULL.");
         return 14;
     }
@@ -494,5 +494,5 @@
     subset1 = psImageSubset(original,0,r/2,c/2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when numRows=0.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when numRows=0.");
         return 15;
     }
@@ -500,9 +500,9 @@
     subset1 = psImageSubset(original,c/2,0,c/2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when numCols=0.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when numCols=0.");
         return 16;
     }
     if (memcmp(original,&preSubsetStruct,sizeof(psImage)) != 0) {
-        psError(__func__,"psImageSubset changed the original struct though it failed to subset.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset changed the original struct though it failed to subset.");
         return 17;
     }
@@ -516,5 +516,5 @@
     subset1 = psImageSubset(original,0,0,c/2,r*2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
                 "image (via cols).");
         return 18;
@@ -523,5 +523,5 @@
     subset1 = psImageSubset(original,0,0,c*2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
                 "image (via rows).");
         return 19;
@@ -530,5 +530,5 @@
     subset1 = psImageSubset(original,-1,0,c/2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
                 "image (col0=-1).");
         return 20;
@@ -537,5 +537,5 @@
     subset1 = psImageSubset(original,0,-1,c/2,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
                 "image (row0=-1).");
         return 21;
@@ -550,5 +550,5 @@
     subset1 = psImageSubset(original,0,0,c/2,r+1);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via rows).");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via rows).");
         return 22;
     }
@@ -556,5 +556,5 @@
     subset1 = psImageSubset(original,0,0,c+1,r/2);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via cols).");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via cols).");
         return 23;
     }
@@ -562,5 +562,5 @@
     subset1 = psImageSubset(original,0,0,c+1,r+1);
     if (subset1 != NULL) {
-        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via row+cols).");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via row+cols).");
         return 24;
     }
@@ -575,5 +575,5 @@
     // Verify the returned psImage structure member Nchildren is set to zero.
     if (original->children != NULL && original->children->n > 0) {
-        psError(__func__,"psImageFreeChildren didn't set number of children to zero.");
+        psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren didn't set number of children to zero.");
         return 25;
     }
@@ -586,5 +586,5 @@
             preSubsetStruct.col0 != original->col0) {
 
-        psError(__func__,"psImageFreeChildren modified parent's non-children elements.");
+        psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren modified parent's non-children elements.");
         return 27;
     }
@@ -626,5 +626,5 @@
 
         if (subset == NULL) {
-            psError(__func__,"psImageSubsection returned a NULL with a subset of %s.",
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection returned a NULL with a subset of %s.",
                     sectionStr);
             return 10*i+1;
@@ -632,5 +632,5 @@
 
         if (subset->type.type != PS_TYPE_U32) {
-            psError(__func__,"psImageSubsection output type was not proper(%d, should be %d).",
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection output type was not proper(%d, should be %d).",
                     subset->type.type, PS_TYPE_U32);
             return 10*i+2;
@@ -638,5 +638,5 @@
 
         if (subset->col0 != x1[i] || subset->row0 != y1[i]) {
-            psError(__func__,"psImageSubsection didn't set properly col0/row0 (%d/%d, should be %d/%d).",
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set properly col0/row0 (%d/%d, should be %d/%d).",
                     subset->col0,subset->row0,x1[i],y1[i]);
             return 10*i+3;
@@ -644,15 +644,15 @@
 
         if (subset->parent != original) {
-            psError(__func__,"psImageSubsection didn't set parent.");
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set parent.");
             return 10*i+4;
         }
 
         if (subset->children != NULL) {
-            psError(__func__,"psImageSubsection didn't set children to NULL.");
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't set children to NULL.");
             return 10*i+5;
         }
 
         if (original->children == NULL || original->children->n != i+1) {
-            psError(__func__,"psImageSubsection didn't increment number of children by one per subset.");
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't increment number of children by one per subset.");
             return 10*i+6;
         }
@@ -660,5 +660,5 @@
 
         if (original->children->data[i] != subset) {
-            psError(__func__,"psImageSubsection didn't properly store the children pointer.");
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't properly store the children pointer.");
             return 10*i+7;
         }
@@ -667,5 +667,5 @@
         psS32 numRows = y2[i]-y1[i]+1;
         if (subset->numCols != numCols || subset->numRows != numRows) {
-            psError(__func__,"psImageSubsection output size was not proper(%dx%d, should be %dx%d).",
+            psError(PS_ERR_UNKNOWN,true,"psImageSubsection output size was not proper(%dx%d, should be %dx%d).",
                     subset->numCols, subset->numRows, numCols, numRows);
             return 10*i+8;
@@ -675,5 +675,5 @@
             for (psS32 col=0;col<numCols;col++) {
                 if (subset->data.U32[row][col] != original->data.U32[row+y1[i]][col+x1[i]]) {
-                    psError(__func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
+                    psError(PS_ERR_UNKNOWN,true,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
                             row,col,subset->data.U32[row][col], original->data.U32[row+y1[i]][col+x1[i]]);
                     return 10*i+9;
@@ -686,5 +686,5 @@
     subset = psImageSubsection(original,"[64:32,32:64]");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when x1 > x2.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't return NULL when x1 > x2.");
         return 10*i+10;
     }
@@ -693,5 +693,5 @@
     subset = psImageSubsection(original,"[32:64,64:32]");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when y1 > y2.");
+        psError(PS_ERR_UNKNOWN,true,"psImageSubsection didn't return NULL when y1 > y2.");
         return 10*i+11;
     }
@@ -700,5 +700,5 @@
     subset = psImageSubsection(original,"[64:256,32:64]"); // assumes c<256
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when x2 > c.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when x2 > c.");
         return 10*i+12;
     }
@@ -707,5 +707,5 @@
     subset = psImageSubsection(original,"[32:64,64:256]"); // assumes r==256
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when y2 > r.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when y2 > r.");
         return 10*i+13;
     }
@@ -714,5 +714,5 @@
     subset = psImageSubsection(original,"32:64,32:64");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when subsection was '32:64,32:64'.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '32:64,32:64'.");
         return 10*i+14;
     }
@@ -721,5 +721,5 @@
     subset = psImageSubsection(original,"[32-64,32-64]");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when subsection was '[32-64,32-64]'.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '[32-64,32-64]'.");
         return 10*i+15;
     }
@@ -728,5 +728,5 @@
     subset = psImageSubsection(original,"[32:64,32]");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when subsection was '[32:64,32]'.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was '[32:64,32]'.");
         return 10*i+16;
     }
@@ -735,5 +735,5 @@
     subset = psImageSubsection(NULL,"[32:64,32:64]");
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when image was NULL.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when image was NULL.");
         return 10*i+17;
     }
@@ -742,5 +742,5 @@
     subset = psImageSubsection(original,NULL);
     if (subset != NULL) {
-        psError(__func__,"psImageSubsection didn't return NULL when subsection was NULL.");
+        psError(PS_ERR_UNKNOWN, true,"psImageSubsection didn't return NULL when subsection was NULL.");
         return 10*i+18;
     }
