Index: /trunk/psLib/test/imageops/tap_psImageGeomManip.c
===================================================================
--- /trunk/psLib/test/imageops/tap_psImageGeomManip.c	(revision 12248)
+++ /trunk/psLib/test/imageops/tap_psImageGeomManip.c	(revision 12249)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-30 00:13:01 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-03-06 02:27:09 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -16,5 +16,5 @@
 #include "tap.h"
 #include "pstap.h"
-
+#define VERBOSE 1
 
 bool testImageShiftCase(psS32 cols,
@@ -47,40 +47,58 @@
     for(psS32 row=0;row<rows;row++) {
         psF32 *fRow = fOut->data.F32[row];
+        for (psS32 col=0;col<cols;col++) {
+            psF32 fValue = psImagePixelInterpolate(fImg,col+0.5-colShift,
+                                                   row+0.5-rowShift,NULL,0,NAN,PS_INTERPOLATE_FLAT);
+            if (fabsf(fRow[col] - fValue) > FLT_EPSILON) {
+                if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (flat interpolation)",
+                     row,col,fRow[col],fValue);
+                errorFlag = true;
+            }
+        }
+    }
+
+    for(psS32 row=0;row<rows;row++) {
         psS16 *sRow = sOut->data.S16[row];
+        for (psS32 col=0;col<cols;col++) {
+            psS16 sValue = (psS16)psImagePixelInterpolate(sImg,col+0.5-colShift,
+                           row+0.5-rowShift,NULL,0,-1,PS_INTERPOLATE_FLAT);
+            if (sRow[col] != sValue) {
+                if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (flat interpolation)",
+                     row,col,sRow[col],sValue);
+                errorFlag = true;
+            }
+        }
+    }
+
+
+    for(psS32 row=0;row<rows;row++) {
         psF32 *fBiRow = fBiOut->data.F32[row];
+        for (psS32 col=0;col<cols;col++) {
+            psF32 fBiValue = psImagePixelInterpolate(fImg,col+0.5-colShift,
+                             row+0.5-rowShift,NULL,0,NAN,PS_INTERPOLATE_BILINEAR);
+            if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) {
+                if (VERBOSE) diag("Float image not shifted correctly at %d,%d (%g vs %g) (bilinear interpolation)",
+                     row,col,fBiRow[col],fBiValue);
+                errorFlag = true;
+            }
+        }
+    }
+
+
+    for(psS32 row=0;row<rows;row++) {
         psS16 *sBiRow = sBiOut->data.S16[row];
-
         for (psS32 col=0;col<cols;col++) {
-            psF32 fValue = psImagePixelInterpolate(fImg,col+colShift,
-                                                   row+rowShift,NULL,0,NAN,PS_INTERPOLATE_FLAT);
-            psS16 sValue = (psS16)psImagePixelInterpolate(sImg,col+colShift,
-                           row+rowShift,NULL,0,-1,PS_INTERPOLATE_FLAT);
-
-            psF32 fBiValue = psImagePixelInterpolate(fImg,col+colShift,
-                             row+rowShift,NULL,0,NAN,PS_INTERPOLATE_BILINEAR);
-            psS16 sBiValue = (psS16)psImagePixelInterpolate(sImg,col+colShift,
-                             row+rowShift,NULL,0,-1,PS_INTERPOLATE_BILINEAR);
-
-            if (fabsf(fRow[col] - fValue) > FLT_EPSILON) {
-                diag("Float image not shifted correctly at %d,%d (%g vs %g)",
-                     col,row,fRow[col],fValue);
+            psS16 sBiValue = (psS16)psImagePixelInterpolate(sImg,col+0.5-colShift,
+                             row+0.5-rowShift,NULL,0,-1,PS_INTERPOLATE_BILINEAR);
+            if (sBiRow[col] != sBiValue) {
+                if (VERBOSE) diag("Short image not shifted correctly at %d,%d (%d vs %d) (bilinear interpolation)",
+                     row,col,sBiRow[col],sBiValue);
                 errorFlag = true;
             }
-            if (sRow[col] != sValue) {
-                diag("Short image not shifted correctly at %d,%d (%d vs %d)",
-                     col,row,sRow[col],sValue);
-                errorFlag = true;
-            }
-            if (fabsf(fBiRow[col] - fBiValue) > FLT_EPSILON) {
-                diag("Float image not shifted correctly at %d,%d (%g vs %g)",
-                     col,row,fBiRow[col],fBiValue);
-                errorFlag = true;
-            }
-            if (sBiRow[col] != sBiValue) {
-                diag("Short image not shifted correctly at %d,%d (%d vs %d)",
-                     col,row,sBiRow[col],sBiValue);
-                errorFlag = true;
-            }
-        }
+        }
+    }
+
+    if (errorFlag) {
+        diag("Short or Float image not shifted correctly");
     }
 
@@ -100,5 +118,5 @@
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(178);
+    plan_tests(226);
 
     // testImageRebin()
@@ -169,6 +187,5 @@
             } \
             stats.options = PS_STAT_SAMPLE_MEAN; \
-            ok(false, "XXXX: Skipping test because of a known seg fault"); \
-            if (0) { \
+            if (1) { \
                 out = psImageRebin(NULL,in,NULL,0,4,&stats); \
                 ok(out != NULL, "psImageRebin returned non-NULL"); \
@@ -190,6 +207,5 @@
                 ok(!errorFlag, "psImageRebin() produced the correct data"); \
             } \
-            ok(false, "XXXX: Skipping test because of a known seg fault"); \
-            if (0) { \
+            if (1) { \
                 stats.options = PS_STAT_SAMPLE_MEAN; \
                 out3 = psImageRebin(NULL,in,mask,1,4,&stats); \
@@ -210,6 +226,5 @@
             } \
             stats.options = PS_STAT_MAX; \
-            ok(false, "XXXX: Skipping test because of a known seg fault"); \
-            if (0) { \
+            if (1) { \
                 out2 = psImageRebin(out,in,NULL,0,3,&stats); \
                 ok(out == out2, "psImageRebin didt recycle a psImage properly"); \
@@ -540,7 +555,9 @@
         //    the rotation and input psImage to not correspond to the output image.
 
-        psImage *fOut = NULL;
+        psS32 rows = 64;
+        psS32 cols = 64;
+        psImage *fOut = psImageAlloc(cols,rows,PS_TYPE_F32);
         psImage *sOut = NULL;
-        psImage *fBiOut = NULL;
+        psImage *fBiOut = psImageAlloc(cols,rows,PS_TYPE_F32);
         psImage *sBiOut = NULL;
         psImage *fTruth = NULL;
@@ -548,6 +565,4 @@
         psImage *fBiTruth = NULL;
         psImage *sBiTruth = NULL;
-        psS32 rows = 64;
-        psS32 cols = 64;
         psImage *fImg = psImageAlloc(cols,rows,PS_TYPE_F32);
         psImage *sImg = psImageAlloc(cols,rows,PS_TYPE_S16);
@@ -804,26 +819,26 @@
         // integer shift
         // XXXX: These fail
-        ok(false, "XXXX: Skipping psImageShift() tests because of known failures");
-        if (0)
+//        ok(false, "XXXX: Skipping psImageShift() tests because of known failures");
+        if (1)
         {
             ok(testImageShiftCase(64,128,0.0f,0.0f), "psImageShift (0, 0)");
-            ok(testImageShiftCase(64,128,0.0f,16.0f), "psImageShift (0, 16)");
-            ok(testImageShiftCase(64,128,0.0f,-16.0f), "psImageShift (0, -16)");
-            ok(testImageShiftCase(64,128,32.0f,0.0f), "psImageShift (32, 0)");
-            ok(testImageShiftCase(64,128,-32.0f,0.0f), "psImageShift (-32, 0)");
-            ok(testImageShiftCase(64,128,32.0f,16.0f), "psImageShift (32, 16)");
-            ok(testImageShiftCase(64,128,32.0f,-16.0f), "psImageShift (32, -16)");
-            ok(testImageShiftCase(64,128,-32.0f,16.0f), "psImageShift (-32, 16)");
-            ok(testImageShiftCase(64,128,-32.0f,-16.0f), "psImageShift (-32, -16)");
+            ok(testImageShiftCase(4,8,0.0f,2.0f), "psImageShift (0, 16)");
+            ok(testImageShiftCase(4,8,0.0f,-16.0f), "psImageShift (0, -16)");
+            ok(testImageShiftCase(4,8,32.0f,0.0f), "psImageShift (32, 0)");
+            ok(testImageShiftCase(4,8,-32.0f,0.0f), "psImageShift (-32, 0)");
+            ok(testImageShiftCase(4,8,32.0f,16.0f), "psImageShift (32, 16)");
+            ok(testImageShiftCase(4,8,32.0f,-16.0f), "psImageShift (32, -16)");
+            ok(testImageShiftCase(4,8,-32.0f,16.0f), "psImageShift (-32, 16)");
+            ok(testImageShiftCase(4,8,-32.0f,-16.0f), "psImageShift (-32, -16)");
 
             // fractional shift
-            ok(testImageShiftCase(64,128,0.0f,16.4f), "psImageShift (0, 16.4)");
-            ok(testImageShiftCase(64,128,0.0f,-16.4f), "psImageShift (0, -16.4)");
-            ok(testImageShiftCase(64,128,32.7f,0.0f), "psImageShift (32.7, 0)");
-            ok(testImageShiftCase(64,128,-32.7f,0.0f), "psImageShift (-32.7, 0)");
-            ok(testImageShiftCase(64,128,32.6f,16.2f), "psImageShift (32.6, 16.2)");
-            ok(testImageShiftCase(64,128,32.6f,-16.2f), "psImageShift (32.6, -16.2)");
-            ok(testImageShiftCase(64,128,-32.6f,16.2f), "psImageShift (-32.6, 16.2)");
-            ok(testImageShiftCase(64,128,-32.6f,-16.2f), "psImageShift (-32.6, -16.2)");
+            ok(testImageShiftCase(4,8,0.0f,16.4f), "psImageShift (0, 16.4)");
+            ok(testImageShiftCase(4,8,0.0f,-16.4f), "psImageShift (0, -16.4)");
+            ok(testImageShiftCase(4,8,32.7f,0.0f), "psImageShift (32.7, 0)");
+            ok(testImageShiftCase(4,8,-32.7f,0.0f), "psImageShift (-32.7, 0)");
+            ok(testImageShiftCase(4,8,32.6f,16.2f), "psImageShift (32.6, 16.2)");
+            ok(testImageShiftCase(4,8,32.6f,-16.2f), "psImageShift (32.6, -16.2)");
+            ok(testImageShiftCase(4,8,-32.6f,16.2f), "psImageShift (-32.6, 16.2)");
+            ok(testImageShiftCase(4,8,-32.6f,-16.2f), "psImageShift (-32.6, -16.2)");
         }
 
