Index: /trunk/psLib/test/image/tst_psImageManip.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageManip.c	(revision 1930)
+++ /trunk/psLib/test/image/tst_psImageManip.c	(revision 1931)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-29 21:23:30 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-30 18:47:23 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1291,17 +1291,25 @@
     psImage* fOut = NULL;
     psImage* sOut = NULL;
+    psImage* s32Out = NULL;
+    psImage* fBiOut = NULL;
+    psImage* sBiOut = NULL;
     psImage* fTruth = NULL;
     psImage* sTruth = NULL;
+    psImage* fBiTruth = NULL;
+    psImage* sBiTruth = NULL;
     int rows = 64;
     int cols = 64;
     psImage* fImg = psImageAlloc(cols,rows,PS_TYPE_F32);
     psImage* sImg = psImageAlloc(cols,rows,PS_TYPE_S16);
+    psImage* s32Img = psImageAlloc(cols,rows,PS_TYPE_S32);
 
     for(int row=0;row<rows;row++) {
         psF32* fRow = fImg->data.F32[row];
         psS16* sRow = sImg->data.S16[row];
+        psS32* s32Row = s32Img->data.S32[row];
         for (int col=0;col<cols;col++) {
             fRow[col] = (psF32)(row)+(psF32)(col)/100.0f;
             sRow[col] = row-2*col;
+            s32Row[col] = row-2*col;
         }
     }
@@ -1320,9 +1328,17 @@
         ("temp/sOut.fits")
         ;
+    remove
+        ("temp/fBiOut.fits")
+        ;
+    remove
+        ("temp/sBiOut.fits");
+    ;
     int index = 0;
     bool fail = false;
     for (int rot=-180;rot<=180;rot+=45) {
         psImage* oldOut = fOut;
+        psImage* oldBiOut = fBiOut;
         fOut = psImageRotate(fOut,fImg,rot,-1.0,PS_INTERPOLATE_FLAT);
+        fBiOut = psImageRotate(fBiOut,fImg,rot,-1.0,PS_INTERPOLATE_BILINEAR);
         // Verify the returned psImage structure is equal to the input
         // parameter out if provided.
@@ -1331,5 +1347,10 @@
             return 2;
         }
+        if (oldBiOut != NULL && oldBiOut != fBiOut) {
+            psError(__func__,"the output recycle functionality failed");
+            return 4;
+        }
         sOut = psImageRotate(sOut,sImg,rot,-1.0,PS_INTERPOLATE_FLAT);
+        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!?");
@@ -1340,9 +1361,18 @@
             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!?");
+            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!?");
+            return 41;
+        }
 
         // now, let's compare this with the verified file
         fTruth = psImageReadSection(fTruth,0,0,0,0,0,NULL,index,"verified/fOut.fits");
         sTruth = psImageReadSection(sTruth,0,0,0,0,0,NULL,index,"verified/sOut.fits");
-
+        fBiTruth = psImageReadSection(fBiTruth,0,0,0,0,0,NULL,index,"verified/fBiOut.fits");
+        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)",
@@ -1397,4 +1427,67 @@
 
 
+        if (fBiTruth == NULL) {
+            psError(__func__,"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 "
+                        "image for %d deg rotation (%dx%d vs %dx%d). BILINEAR",
+                        rot,fBiOut->numCols,fBiOut->numRows,fBiTruth->numCols,fBiTruth->numRows);
+                fail = true;
+            } else {
+                for (int row=0;row<fBiTruth->numRows;row++) {
+                    psF32* truthRow = fBiTruth->data.F32[row];
+                    psF32* outRow = fBiOut->data.F32[row];
+                    for (int 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",
+                                    outRow[col], truthRow[col],col,row);
+                            fail = true;
+                        }
+                    }
+                }
+            }
+        }
+
+        if (sBiTruth == NULL) {
+            psError(__func__,"verified psS16 image failed to be read "
+                    "(%d deg. rotation) BILINEAR",rot);
+            fail = true;
+        } else {
+            if (sBiTruth->numRows != sBiOut->numRows ||
+                    sBiTruth->numCols != sBiOut->numCols) {
+                psError(__func__,"Rotated short image size did not match truth "
+                        "image for %d deg rotation. BILINEAR",rot);
+                fail = true;
+            } else {
+                for (int row=0;row<sBiTruth->numRows;row++) {
+                    psS16* truthRow = sBiTruth->data.S16[row];
+                    psS16* outRow = sBiOut->data.S16[row];
+                    for (int col=0;col<sBiTruth->numCols;col++) {
+                        if (fabsf(truthRow[col]-outRow[col]) > 1) {
+                            psError(__func__,"Short Image mismatch (%d vs %d) "
+                                    "at %d,%d. BILINEAR",
+                                    outRow[col], truthRow[col],col,row);
+                            fail = true;
+                        }
+                    }
+                }
+            }
+        }
+
+        // Verify psImage structure returned is NULL and program execution doesn't stop
+        // if the input image type is not supported. Do not check for 0 degree rotation
+        // since an imgae copy will be used.
+        if (rot != 0 ) {
+            psLogMsg(__func__,PS_LOG_INFO,"Following should be an error invalid type for rotate.");
+            s32Out = psImageRotate(s32Out,s32Img,rot,-1.0,PS_INTERPOLATE_FLAT);
+            if( s32Out != NULL ) {
+                psError(__func__,"psImage returned is not NULL for invalid image type.");
+                return 5;
+            }
+        }
+
         index++;
     }
@@ -1416,4 +1509,15 @@
     }
 
+    // Verify the returned psImage structure pointer is null and program
+    // execution doesn't stop, if the specified interpolation mode is invalid
+    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid "
+             "interpolation type.");
+    fOut = psImageRotate(fOut, fImg, 33, 0, -1);
+    if (fOut != NULL) {
+        psError(__func__,"NULL wasn't returned though the interpolation mode "
+                "is invalid.");
+        return 4;
+    }
+
     psFree(sOut);
     psFree(fImg);
@@ -1421,4 +1525,10 @@
     psFree(fTruth);
     psFree(sTruth);
+    psFree(sBiOut);
+    psFree(fBiTruth);
+    psFree(sBiTruth);
+    psFree(fBiOut);
+    psFree(s32Img);
+    psFree(s32Out);
 
     return 0;
Index: /trunk/psLib/test/image/verified/tst_psImageManip.stderr
===================================================================
--- /trunk/psLib/test/image/verified/tst_psImageManip.stderr	(revision 1930)
+++ /trunk/psLib/test/image/verified/tst_psImageManip.stderr	(revision 1931)
@@ -212,7 +212,43 @@
 
 <DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error invalid type for rotate.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified psImage type, psS32, is not supported.
+<DATE><TIME>|<HOST>|I|testImageRotate
     Following should be an error
 <DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
     Can not operate on a NULL psImage.
+<DATE><TIME>|<HOST>|I|testImageRotate
+    Following should be an error for invalid interpolation type.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageRotate
+    Specified interpolation mode, -1, is unsupported.
 
 ---> TESTPOINT PASSED (psImage{psImageRotate} | tst_psImageManip.c)
