Index: /trunk/psLib/test/image/tst_psImageInterpolate.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageInterpolate.c	(revision 2747)
+++ /trunk/psLib/test/image/tst_psImageInterpolate.c	(revision 2747)
@@ -0,0 +1,108 @@
+/** @file tst_psImageInterpolate.c
+ *
+ * @brief Contains the tests for psImagePixelInterpolate
+ *
+ * @author Eric Van Alst, MHPCC
+ *
+ * @version $Revision: 1.1 $
+ *          $Name: not supported by cvs2svn $
+ * @date $Date: 2004-12-17 03:04:05 $
+ *
+ * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "psTest.h"
+#include "pslib.h"
+
+#define GENIMAGE(img,c,r,TYP,valueFcn) \
+img = psImageAlloc(c,r,PS_TYPE_##TYP); \
+for(psU32 row=0; row<r; row++) { \
+    ps##TYP* imgRow = img->data.TYP[row]; \
+    for(psU32 col=0; col<c; col++) { \
+        imgRow[col] = (ps##TYP)(valueFcn); \
+    } \
+}
+
+#define CHECK_INTERP_VALUE(img,x,y,exposed,TYPE,expected) \
+val = (psF32)psImagePixelInterpolate(img,x,y,NULL,0,exposed,PS_INTERPOLATE_##TYPE); \
+if(val != expected) { \
+    psError(PS_ERR_UNKNOWN,true,"Return value is not as expected."); \
+    return 1; \
+}
+
+#define CHECK_INTERP_BY_TYPE(TYPE) \
+GENIMAGE(img1,10,10,TYPE,row+col) \
+CHECK_INTERP_VALUE(img1,1.9,1.6,0,FLAT,2.0) \
+CHECK_INTERP_VALUE(img1,4.0,2.0,0,BILINEAR,5.0) \
+psFree(img1);
+
+static psS32 testInterpolateFlatBilinear(void);
+static psS32 testInterpolateError(void);
+
+testDescription tests[] = {
+                              {testInterpolateFlatBilinear,999,"psImagePixelInterpolate",0,false},
+                              {testInterpolateError,999,"psImagePixelInterpolate",0,false},
+                              {NULL}
+                          };
+
+psS32 main(psS32 argc, char* argv[])
+{
+    psLogSetLevel(PS_LOG_INFO);
+
+    if ( !runTestSuite(stderr,"psImagePixelInterpolate",tests,argc,argv) ) {
+        return 1;
+    } else {
+        return 0;
+    }
+}
+
+psS32 testInterpolateFlatBilinear(void)
+{
+    psImage* img1;
+    psF32 val = 0;
+
+    // Perform simple(four neighbor) FLAT interpolation for all types
+    // Perform bilinear interpolation for all types
+    CHECK_INTERP_BY_TYPE(S8)
+    CHECK_INTERP_BY_TYPE(S16)
+    CHECK_INTERP_BY_TYPE(S32)
+    CHECK_INTERP_BY_TYPE(S64)
+    CHECK_INTERP_BY_TYPE(U8)
+    CHECK_INTERP_BY_TYPE(U16)
+    CHECK_INTERP_BY_TYPE(U32)
+    CHECK_INTERP_BY_TYPE(U64)
+    CHECK_INTERP_BY_TYPE(F32)
+    CHECK_INTERP_BY_TYPE(F64)
+    CHECK_INTERP_BY_TYPE(C32)
+    CHECK_INTERP_BY_TYPE(C64)
+
+    return 0;
+}
+
+psS32 testInterpolateError(void)
+{
+    psF32 val = 0;
+    psImage* img1 = NULL;
+
+    // Perform interpolation with NULL input image and verify return and error message
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    val = psImagePixelInterpolate(img1,1.2,1.2,NULL,0,5.0,PS_INTERPOLATE_FLAT);
+    if(val != 5.0) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return the unexposed value");
+        return 10;
+    }
+
+    // Perform interpolation with invalid input image type
+    img1 = psImageAlloc(10,10,PS_TYPE_PTR);
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    val = psImagePixelInterpolate(img1,1.2,1.2,NULL,0,10.0,PS_INTERPOLATE_FLAT);
+    if(val != 10.0) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return the unexposed value");
+        return 11;
+    }
+    psFree(img1);
+
+    return 0;
+}
+
Index: /trunk/psLib/test/image/verified/tst_psImageInterpolate.stderr
===================================================================
--- /trunk/psLib/test/image/verified/tst_psImageInterpolate.stderr	(revision 2747)
+++ /trunk/psLib/test/image/verified/tst_psImageInterpolate.stderr	(revision 2747)
@@ -0,0 +1,26 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImageInterpolate.c                                   *
+*            TestPoint: psImagePixelInterpolate{psImagePixelInterpolate}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psImagePixelInterpolate{psImagePixelInterpolate} | tst_psImageInterpolate.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImageInterpolate.c                                   *
+*            TestPoint: psImagePixelInterpolate{psImagePixelInterpolate}           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|I|testInterpolateError
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psImagePixelInterpolate (psImage.c:<LINENO>)
+    Can not operate on a NULL psImage.
+<DATE><TIME>|<HOST>|I|testInterpolateError
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psImagePixelInterpolate (psImage.c:<LINENO>)
+    Specified psImage type, psPtr, is not supported.
+
+---> TESTPOINT PASSED (psImagePixelInterpolate{psImagePixelInterpolate} | tst_psImageInterpolate.c)
+
