Index: trunk/psLib/test/image/tst_psImageManip.c
===================================================================
--- trunk/psLib/test/image/tst_psImageManip.c	(revision 2204)
+++ trunk/psLib/test/image/tst_psImageManip.c	(revision 2273)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:33 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -119,5 +119,5 @@
             } \
             if (fabsf(imgRow[col]-value) > FLT_EPSILON) { \
-                psError(__func__,"Pixel value is not as expected (%g vs %g) at %u,%u", \
+                psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%g vs %g) at %u,%u", \
                         (psF64)imgRow[col],(psF64)value,col,row); \
                 return 1; \
@@ -126,5 +126,5 @@
     } \
     if (retVal != numClipped) { \
-        psError(__func__,"Expected %d clips, but got %d", \
+        psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \
                 numClipped,retVal); \
         return 2; \
@@ -159,5 +159,5 @@
             if (fabsf(creal(imgRow[col])-creal(value)) > FLT_EPSILON || \
                     fabsf(cimag(imgRow[col])-cimag(value)) > FLT_EPSILON) { \
-                psError(__func__,"Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \
+                psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \
                         creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
                 return 1; \
@@ -166,5 +166,5 @@
     } \
     if (retVal != numClipped) { \
-        psError(__func__,"Expected %d clips, but got %d", \
+        psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \
                 numClipped,retVal); \
         return 2; \
@@ -198,5 +198,5 @@
     retVal = psImageClip(NULL,min,-1.0f,max,-2.0f);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clips of a NULL image.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image.");
         return 3;
     }
@@ -207,5 +207,5 @@
     retVal = psImageClip(img,max,-1.0f,min,-2.0f);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clips when max < min.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips when max < min.");
         return 4;
     }
@@ -217,5 +217,5 @@
     retVal = psImageClip(img,min,-1.0f,max,-2.0f);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clip of invalid image type.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type.");
         return 5;
     }
@@ -276,5 +276,5 @@
             } \
             if (fabsf(imgRow[col]-value) > FLT_EPSILON) { \
-                psError(__func__,"Pixel value is not as expected (%f vs %f) at %d,%d", \
+                psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%f vs %f) at %d,%d", \
                         imgRow[col],value,col,row); \
                 return 1; \
@@ -283,5 +283,5 @@
     } \
     if (retVal != numClipped) { \
-        psError(__func__,"Expected %d clips, but got %d", \
+        psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \
                 numClipped,retVal); \
         return 2; \
@@ -299,5 +299,5 @@
     retVal = psImageClipNaN(NULL,-1.0f);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clips of a NULL image.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image.");
         return 3;
     }
@@ -309,5 +309,5 @@
     retVal = psImageClipNaN(img,2.0f);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clip of invalid image type.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type.");
         return 4;
     }
@@ -377,5 +377,5 @@
             } \
             if (cabs(imgRow[col]-value) > FLT_EPSILON) { \
-                psError(__func__,"Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \
+                psError(PS_ERR_UNKNOWN, true,"Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \
                         creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
                 return 1; \
@@ -384,5 +384,5 @@
     } \
     if (retVal != numClipped) { \
-        psError(__func__,"Expected %d clips, but got %d", \
+        psError(PS_ERR_UNKNOWN, true,"Expected %d clips, but got %d", \
                 numClipped,retVal); \
         return 2; \
@@ -408,5 +408,5 @@
     retVal = psImageClipComplexRegion(NULL,0,0,0,0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clips of a NULL image.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clips of a NULL image.");
         return 3;
     }
@@ -427,5 +427,5 @@
     retVal = psImageClipComplexRegion(img,10.0+I*1.0,-1.0,5.0+5.0*I,-2.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for creal(min)>creal(max).");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for creal(min)>creal(max).");
         return 3;
     }
@@ -433,5 +433,5 @@
     retVal = psImageClipComplexRegion(img,1.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for cimag(min)>cimag(max).");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for cimag(min)>cimag(max).");
         return 3;
     }
@@ -439,5 +439,5 @@
     retVal = psImageClipComplexRegion(img,10.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for min>max.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for min>max.");
         return 3;
     }
@@ -457,5 +457,5 @@
                                       0.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmin not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range.");
         return 80;
     }
@@ -468,5 +468,5 @@
                                       0.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmin not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range.");
         return 81;
     }
@@ -479,5 +479,5 @@
                                       0.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmin not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range.");
         return 82;
     }
@@ -490,5 +490,5 @@
                                       0.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmin not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmin not in datatype range.");
         return 83;
     }
@@ -501,5 +501,5 @@
                                       -2.0*(double)FLT_MAX);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmax not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range.");
         return 84;
     }
@@ -512,5 +512,5 @@
                                       2.0*(double)FLT_MAX);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmax not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range.");
         return 85;
     }
@@ -523,5 +523,5 @@
                                       -2.0*(double)FLT_MAX*I);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmax not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range.");
         return 87;
     }
@@ -534,5 +534,5 @@
                                       2.0*(double)FLT_MAX*I);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for vmax not in datatype range.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for vmax not in datatype range.");
         return 88;
     }
@@ -552,5 +552,5 @@
                                       0.0);
     if (retVal == 0) {
-        psError(__func__,"Didn't expect zero return for vmin > vmax.");
+        psError(PS_ERR_UNKNOWN, true,"Didn't expect zero return for vmin > vmax.");
         return 83;
     }
@@ -573,5 +573,5 @@
     retVal = psImageClipComplexRegion(img,2.0,10.0,5.0,0.0);
     if (retVal != 0) {
-        psError(__func__,"Expected zero return for clip of invalid image type.");
+        psError(PS_ERR_UNKNOWN, true,"Expected zero return for clip of invalid image type.");
         return 84;
     }
@@ -625,5 +625,5 @@
     retVal = psImageOverlaySection(img,img2,c/4,r/4,OPSTRING); \
     if (retVal != 0) { \
-        psError(__func__,"psImageOverlaySection returned non-zero %s op",OPSTRING); \
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero %s op",OPSTRING); \
         return 1; \
     } \
@@ -637,10 +637,10 @@
             } \
             if (fabsf(imgRow[col] - val) > FLT_EPSILON) { \
-                psError(__func__,"Value incorrect at %d,%d (%.2f vs %.2f for %s)", \
+                psError(PS_ERR_UNKNOWN, true,"Value incorrect at %d,%d (%.2f vs %.2f for %s)", \
                         col,row,imgRow[col],val,OPSTRING); \
                 return 2; \
             } \
             if (row < r/2 && col < c/2 && fabsf(img2Row[col] - 2.0) > FLT_EPSILON) { \
-                psError(__func__,"Overlay modified at %d,%d (%.2f for %s)", \
+                psError(PS_ERR_UNKNOWN, true,"Overlay modified at %d,%d (%.2f for %s)", \
                         col,row,img2Row[col],OPSTRING); \
                 return 2; \
@@ -706,5 +706,5 @@
     retVal = psImageOverlaySection(img,img2,c/4,r/4,"+");
     if (retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero even though "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "
                 "overlay too big");
         return 3;
@@ -714,5 +714,5 @@
         for (unsigned col=0;col<c;col++) {
             if (imgRow[col] != 6.0f) {
-                psError(__func__,"Input image modified when overlay size too big");
+                psError(PS_ERR_UNKNOWN, true,"Input image modified when overlay size too big");
                 return 4;
             }
@@ -729,5 +729,5 @@
     retVal = psImageOverlaySection(img,NULL,c/4,r/4,"+");
     if (retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero even though "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "
                 "overlay too big");
         return 5;
@@ -737,5 +737,5 @@
         for (unsigned col=0;col<c;col++) {
             if (imgRow[col] != 6.0f) {
-                psError(__func__,"Input image modified when overlay NULL");
+                psError(PS_ERR_UNKNOWN, true,"Input image modified when overlay NULL");
                 return 6;
             }
@@ -751,5 +751,5 @@
     retVal = psImageOverlaySection(NULL,img2,c/4,r/4,"+");
     if (retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero even though "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "
                 "overlay too big");
         return 7;
@@ -764,5 +764,5 @@
     retVal = psImageOverlaySection(img,img2,0,0,"$");
     if (retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero even though "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "
                 "overlay operator is invalid");
         return 8;
@@ -777,5 +777,5 @@
     retVal = psImageOverlaySection(img,img2,0,0,NULL);
     if(retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero even though "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero even though "
                 "overlay operator is NULL");
         return 9;
@@ -790,5 +790,5 @@
     retVal = psImageOverlaySection(img,img3,0,0,"+");
     if(retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero eventhough "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough "
                 " overlay image type is different than input image.");
         return 10;
@@ -803,5 +803,5 @@
     retVal = psImageOverlaySection(img3,img4,0,0,"+");
     if(retVal == 0) {
-        psError(__func__,"psImageOverlaySection returned zero eventhough "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned zero eventhough "
                 "overlay and image type are invalid type.");
         return 11;
@@ -820,5 +820,5 @@
     retVal = psImageOverlaySection(img,img2,0,0,"/");
     if (retVal != 0) {
-        psError(__func__,"psImageOverlaySection returned non-zero when "
+        psError(PS_ERR_UNKNOWN, true,"psImageOverlaySection returned non-zero when "
                 "checking divide-by-zero.");
         return 12;
@@ -906,9 +906,9 @@
     out = psImageRebin(NULL,in,NULL,0,4,&stats); \
     if (out == NULL) { \
-        psError(__func__,"psImageRebin returned a NULL pointer!?"); \
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned a NULL pointer!?"); \
         return 1; \
     } \
     if (out->numRows != 4 || out->numCols != 4) { \
-        psError(__func__,"psImageRebin didn't produce the proper size image " \
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper size image " \
                 "(%d x %d).", \
                 out->numCols, out->numRows); \
@@ -920,5 +920,5 @@
         for (psS32 col = 0; col<4; col++) { \
             if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \
-                psError(__func__,"psImageRebin didn't produce the proper mean " \
+                psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper mean " \
                         "result at (%d,%d) [%f vs %f].", \
                         col,row,outRow[col],truthRow[col]); \
@@ -934,5 +934,5 @@
         for ( psS32 col = 0; col<4; col++) { \
             if(abs((psS32)outRow[col]-(psS32)truthRow[col]) > FLT_EPSILON) { \
-                psError(__func__,"psImageRebin with mask didn't produce the proper mean " \
+                psError(PS_ERR_UNKNOWN, true,"psImageRebin with mask didn't produce the proper mean " \
                         "result at (%d,%d) [%f vs %f].", \
                         col,row,outRow[col],truthRow[col]); \
@@ -944,13 +944,13 @@
     out2 = psImageRebin(out,in,NULL,0,3,&stats); \
     if (out != out2) { \
-        psError(__func__,"psImageRebin didn't recycle a psImage properly!?"); \
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't recycle a psImage properly!?"); \
         return 7; \
     } \
     if (out == NULL) { \
-        psError(__func__,"psImageRebin returned a NULL pointer!?"); \
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned a NULL pointer!?"); \
         return 4; \
     } \
     if (out->numRows != 6 || out->numCols != 6) { \
-        psError(__func__,"psImageRebin didn't produce the proper size image " \
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper size image " \
                 "(%d x %d).", \
                 out->numCols, out->numRows); \
@@ -962,5 +962,5 @@
         for (psS32 col = 0; col<6; col++) { \
             if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \
-                psError(__func__,"psImageRebin didn't produce the proper " \
+                psError(PS_ERR_UNKNOWN, true,"psImageRebin didn't produce the proper " \
                         "max result at (%d,%d) [%f vs %f].", \
                         col,row,outRow[col],truthRow[col]); \
@@ -990,5 +990,5 @@
     out = psImageRebin(NULL,in,NULL,0,4,&stats);
     if(out != NULL) {
-        psError(__func__,"psImageRebin return an image eventhough the "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin return an image eventhough the "
                 "type is not handled.");
         return 14;
@@ -999,5 +999,5 @@
     out = psImageRebin(NULL,in,mask,1,4,&stats);
     if(out != NULL) {
-        psError(__func__,"psImageRebin return an image eventhough the "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin return an image eventhough the "
                 "mask is not the correct type.");
         return 17;
@@ -1012,5 +1012,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the input was "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the input was "
                 "NULL!?");
         return 8;
@@ -1024,5 +1024,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the scale was "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the scale was "
                 "zero!?");
         return 9;
@@ -1035,5 +1035,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the stats was "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats was "
                 "NULL!?");
         return 10;
@@ -1049,5 +1049,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the stats "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats "
                 "options was zero!?");
         return 11;
@@ -1059,5 +1059,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the stats "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats "
                 "options was PS_STAT_USE_RANGE!?");
         return 12;
@@ -1072,5 +1072,5 @@
 
     if (out2 != NULL) {
-        psError(__func__,"psImageRebin returned an image though the stats "
+        psError(PS_ERR_UNKNOWN, true,"psImageRebin returned an image though the stats "
                 "options was PS_STAT_SAMPLE_MEAN+PS_STAT_MAX!?");
         return 13;
@@ -1121,5 +1121,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=0, dy=0.",
                         col,row,inRow[col],outRow[col]);
@@ -1135,5 +1135,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols/4) % cols] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=cols/4, dy=0.",
                         col,row,inRow[(col+cols/4) % cols],outRow[col]);
@@ -1146,5 +1146,5 @@
     // parameter out if provided.
     if (out2 != out) {
-        psError(__func__,"psImageRoll didn't recycle my out psImage!?");
+        psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't recycle my out psImage!?");
         return 1;
     }
@@ -1156,5 +1156,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=0, dy=rows/4.",
                         col,row,inRow[col],outRow[col]);
@@ -1170,5 +1170,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols/4) % cols] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=cols/4, dy=rows/4.",
                         col,row,inRow[(col+cols/4) % cols],outRow[col]);
@@ -1184,5 +1184,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+(cols-cols/4)) % cols] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=-cols/4, dy=0.",
                         col,row,inRow[(col+(cols-cols/4)) % cols],outRow[col]);
@@ -1198,5 +1198,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=0, dy=-rows/4.",
                         col,row,inRow[col],outRow[col]);
@@ -1212,5 +1212,5 @@
         for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols-cols/4) % cols] != outRow[col]) {
-                psError(__func__,"psImageRoll didn't produce expected result "
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result "
                         "at %d,%d (%f vs %f) for dx=cols/4, dy=rows/4.",
                         col,row,inRow[(col+cols-cols/4) % cols],outRow[col]);
@@ -1226,5 +1226,5 @@
     out2 = psImageRoll(NULL,NULL,0,0);
     if (out2 != NULL) {
-        psError(__func__,"psImageRoll did not return NULL though input image was NULL!?");
+        psError(PS_ERR_UNKNOWN, true,"psImageRoll did not return NULL though input image was NULL!?");
         return 2;
     }
@@ -1249,5 +1249,5 @@
         for (psS32 col=0;col<cols1;col++) { \
             if (inRow[(col+cols1/4)%cols1] != outRow[col]) { \
-                psError(__func__,"psImageRoll didn't produce expected result " \
+                psError(PS_ERR_UNKNOWN, true,"psImageRoll didn't produce expected result " \
                         "at %d,%d (%f vs %f) for dx=0, dy=0.", \
                         col,row,(float)inRow[col],(float)outRow[col]); \
@@ -1346,9 +1346,9 @@
         // parameter out if provided.
         if (oldOut != NULL && oldOut != fOut) {
-            psError(__func__,"the output recycle functionality failed");
+            psError(PS_ERR_UNKNOWN, true,"the output recycle functionality failed");
             return 2;
         }
         if (oldBiOut != NULL && oldBiOut != fBiOut) {
-            psError(__func__,"the output recycle functionality failed");
+            psError(PS_ERR_UNKNOWN, true,"the output recycle functionality failed");
             return 4;
         }
@@ -1356,17 +1356,17 @@
         sBiOut = psImageRotate(sBiOut,sImg,rot,-1.0,PS_INTERPOLATE_BILINEAR);
         if (! psImageWriteSection(fOut,0,0,0,NULL,index,"temp/fOut.fits") ) {
-            psError(__func__,"Can not write to temp/fOut.fits, so why continue!?");
+            psError(PS_ERR_UNKNOWN, true,"Can not write to temp/fOut.fits, so why continue!?");
             return 20;
         }
         if (! psImageWriteSection(sOut,0,0,0,NULL,index,"temp/sOut.fits") ) {
-            psError(__func__,"Can not write to temp/sOut.fits, so why continue!?");
+            psError(PS_ERR_UNKNOWN, true,"Can not write to temp/sOut.fits, so why continue!?");
             return 21;
         }
         if (! psImageWriteSection(fBiOut,0,0,0,NULL,index,"temp/fBiOut.fits") ) {
-            psError(__func__,"Can not write to temp/fBiOut.fits, so why continue!?");
+            psError(PS_ERR_UNKNOWN, true,"Can not write to temp/fBiOut.fits, so why continue!?");
             return 40;
         }
         if (! psImageWriteSection(sBiOut,0,0,0,NULL,index,"temp/sBiOut.fits") ) {
-            psError(__func__,"Can not write to temp/sBiOut.fits, so why continue!?");
+            psError(PS_ERR_UNKNOWN, true,"Can not write to temp/sBiOut.fits, so why continue!?");
             return 41;
         }
@@ -1378,10 +1378,10 @@
         sBiTruth = psImageReadSection(sBiTruth,0,0,0,0,0,NULL,index,"verified/sBiOut.fits");
         if (fTruth == NULL) {
-            psError(__func__,"verified psF32 image failed to be read (%d deg. rotation)",
+            psError(PS_ERR_UNKNOWN, true,"verified psF32 image failed to be read (%d deg. rotation)",
                     rot);
             fail = true;
         } else {
             if (fTruth->numRows != fOut->numRows || fTruth->numCols != fOut->numCols) {
-                psError(__func__,"Rotated float image size did not match truth "
+                psError(PS_ERR_UNKNOWN, true,"Rotated float image size did not match truth "
                         "image for %d deg rotation (%dx%d vs %dx%d).",
                         rot,fOut->numCols,fOut->numRows,fTruth->numCols,fTruth->numRows);
@@ -1393,5 +1393,5 @@
                     for (psS32 col=0;col<fTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
-                            psError(__func__,"Float Image mismatch (%f vs %f) at %d,%d.",
+                            psError(PS_ERR_UNKNOWN, true,"Float Image mismatch (%f vs %f) at %d,%d.",
                                     outRow[col], truthRow[col],col,row);
                             fail = true;
@@ -1403,5 +1403,5 @@
 
         if (sTruth == NULL) {
-            psError(__func__,"verified psS16 image failed to be read "
+            psError(PS_ERR_UNKNOWN, true,"verified psS16 image failed to be read "
                     "(%d deg. rotation)",rot);
             fail = true;
@@ -1409,5 +1409,5 @@
             if (sTruth->numRows != sOut->numRows ||
                     sTruth->numCols != sOut->numCols) {
-                psError(__func__,"Rotated psS16 image size did not match truth "
+                psError(PS_ERR_UNKNOWN, true,"Rotated psS16 image size did not match truth "
                         "image for %d deg rotation.",rot);
                 fail = true;
@@ -1418,5 +1418,5 @@
                     for (psS32 col=0;col<sTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
-                            psError(__func__,"Short Image mismatch (%d vs %d) "
+                            psError(PS_ERR_UNKNOWN, true,"Short Image mismatch (%d vs %d) "
                                     "at %d,%d.",
                                     outRow[col], truthRow[col],col,row);
@@ -1430,10 +1430,10 @@
 
         if (fBiTruth == NULL) {
-            psError(__func__,"verified psF32 Bi image failed to be read (%d deg. rotation)",
+            psError(PS_ERR_UNKNOWN, true,"verified psF32 Bi image failed to be read (%d deg. rotation)",
                     rot);
             fail = true;
         } else {
             if (fBiTruth->numRows != fBiOut->numRows || fBiTruth->numCols != fBiOut->numCols) {
-                psError(__func__,"Rotated float image size did not match truth "
+                psError(PS_ERR_UNKNOWN, true,"Rotated float image size did not match truth "
                         "image for %d deg rotation (%dx%d vs %dx%d). BILINEAR",
                         rot,fBiOut->numCols,fBiOut->numRows,fBiTruth->numCols,fBiTruth->numRows);
@@ -1445,5 +1445,5 @@
                     for (psS32 col=0;col<fBiTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
-                            psError(__func__,"Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",
+                            psError(PS_ERR_UNKNOWN, true,"Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",
                                     outRow[col], truthRow[col],col,row);
                             fail = true;
@@ -1455,5 +1455,5 @@
 
         if (sBiTruth == NULL) {
-            psError(__func__,"verified psS16 image failed to be read "
+            psError(PS_ERR_UNKNOWN, true,"verified psS16 image failed to be read "
                     "(%d deg. rotation) BILINEAR",rot);
             fail = true;
@@ -1461,5 +1461,5 @@
             if (sBiTruth->numRows != sBiOut->numRows ||
                     sBiTruth->numCols != sBiOut->numCols) {
-                psError(__func__,"Rotated psS16 image size did not match truth "
+                psError(PS_ERR_UNKNOWN, true,"Rotated psS16 image size did not match truth "
                         "image for %d deg rotation. BILINEAR",rot);
                 fail = true;
@@ -1470,5 +1470,5 @@
                     for (psS32 col=0;col<sBiTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
-                            psError(__func__,"Short Image mismatch (%d vs %d) "
+                            psError(PS_ERR_UNKNOWN, true,"Short Image mismatch (%d vs %d) "
                                     "at %d,%d. BILINEAR",
                                     outRow[col], truthRow[col],col,row);
@@ -1487,5 +1487,5 @@
             s32Out = psImageRotate(s32Out,s32Img,rot,-1.0,PS_INTERPOLATE_FLAT);
             if( s32Out != NULL ) {
-                psError(__func__,"psImage returned is not NULL for invalid image type.");
+                psError(PS_ERR_UNKNOWN, true,"psImage returned is not NULL for invalid image type.");
                 return 5;
             }
@@ -1496,5 +1496,5 @@
 
     if (fail) {
-        psError(__func__,"One or more images didn't match truth or truth did "
+        psError(PS_ERR_UNKNOWN, true,"One or more images didn't match truth or truth did "
                 "not exist.");
         return 10;
@@ -1507,5 +1507,5 @@
     fOut = psImageRotate(fOut,NULL,0,0,PS_INTERPOLATE_FLAT);
     if (fOut != NULL) {
-        psError(__func__,"NULL wasn't returned though the input image was NULL.");
+        psError(PS_ERR_UNKNOWN, true,"NULL wasn't returned though the input image was NULL.");
         return 3;
     }
@@ -1517,5 +1517,5 @@
     fOut = psImageRotate(fOut, fImg, 33, 0, -1);
     if (fOut != NULL) {
-        psError(__func__,"NULL wasn't returned though the interpolation mode "
+        psError(PS_ERR_UNKNOWN, true,"NULL wasn't returned though the interpolation mode "
                 "is invalid.");
         return 4;
@@ -1598,5 +1598,5 @@
 
     if (fRecycle != fOut) {
-        psError(__func__,"psImageShift didn't recycle my image?");
+        psError(PS_ERR_UNKNOWN, true,"psImageShift didn't recycle my image?");
         return 10;
     }
@@ -1609,5 +1609,5 @@
     fOut = psImageShift(fOut,NULL,8,8,NAN,PS_INTERPOLATE_FLAT);
     if (fOut != NULL) {
-        psError(__func__,"psImageShift didn't return NULL given a NULL input image.");
+        psError(PS_ERR_UNKNOWN, true,"psImageShift didn't return NULL given a NULL input image.");
         return 11;
     }
@@ -1618,5 +1618,5 @@
     fOut = psImageShift(fOut,fImg,8,8,NAN,-1);
     if (fOut != NULL ) {
-        psError(__func__,"psImageShift didn't return NULL given an invalid interpolation mode.");
+        psError(PS_ERR_UNKNOWN, true,"psImageShift didn't return NULL given an invalid interpolation mode.");
         return 12;
     }
@@ -1675,20 +1675,20 @@
 
             if (fabsf(fRow[col] - fValue) > FLT_EPSILON) {
-                psError(__func__,"Float image not shifted correctly at %d,%d (%g vs %g)",
+                psError(PS_ERR_UNKNOWN, true,"Float image not shifted correctly at %d,%d (%g vs %g)",
                         col,row,fRow[col],fValue);
                 return 1;
             }
             if (sRow[col] != sValue) {
-                psError(__func__,"Short image not shifted correctly at %d,%d (%d vs %d)",
+                psError(PS_ERR_UNKNOWN, true,"Short image not shifted correctly at %d,%d (%d vs %d)",
                         col,row,sRow[col],sValue);
                 return 2;
             }
             if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) {
-                psError(__func__,"Float image not shifted correctly at %d,%d (%g vs %g)",
+                psError(PS_ERR_UNKNOWN, true,"Float image not shifted correctly at %d,%d (%g vs %g)",
                         col,row,fBiRow[col],fBiValue);
                 return 1;
             }
             if (sBiRow[col] != sBiValue) {
-                psError(__func__,"Short image not shifted correctly at %d,%d (%d vs %d)",
+                psError(PS_ERR_UNKNOWN, true,"Short image not shifted correctly at %d,%d (%d vs %d)",
                         col,row,sBiRow[col],sBiValue);
                 return 2;
