Index: trunk/psLib/test/imageops/tap_psImageGeomManip.c
===================================================================
--- trunk/psLib/test/imageops/tap_psImageGeomManip.c	(revision 13084)
+++ trunk/psLib/test/imageops/tap_psImageGeomManip.c	(revision 13123)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-05-01 00:08:52 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-02 04:14:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -154,7 +154,7 @@
     plan_tests(237);
 
-    // testImageRebin()
-    // This function shall generate a rescaled version of a psImage structure
-    // derived from a specified statistics method.
+    // test psImageRebin()
+    // This function shall generate a rescaled version of a psImage
+    // structure derived from a specified statistics method.
     if (1) {
         psMemId id = psMemGetId();
@@ -295,5 +295,5 @@
         testRebinType(U16);
         testRebinType(S8);
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the input image type is not supported.
         // Following should be an error for unsupported type
@@ -305,5 +305,5 @@
         ok(out == NULL, "psImageRebin returned NULL for unsupported type");
 
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the mask type is not U8
         // Following should be an error for invallid mask type
@@ -314,10 +314,10 @@
         psFree(in);
 
-        // Verify the returned psImage structure is null and program execution
-        // doesn't stop, if the input parameter input is null.
+        // Verify the returned psImage structure is NULL and program execution
+        // doesn't stop, if the input parameter input is NULL.
         out2 = psImageRebin(NULL,NULL,NULL,0,1,&stats);
         ok(out2 == NULL, "psImageRebin returned NULL with NULL input");
 
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the input parameter scale is less than or equal to zero.
         in = psImageAlloc(16, 16, PS_TYPE_F32);
@@ -327,12 +327,12 @@
         ok(out2 == NULL, "psImageRebin returned NULL when the scale was zero");
 
-        // Verify the returned psImage structure is null and program execution
-        // doesn't stop, if the input parameter stats is null.
-        // Following should be an error for stats null
+        // Verify the returned psImage structure is NULL and program execution
+        // doesn't stop, if the input parameter stats is NULL.
+        // Following should be an error for stats NULL
         // XXX: Verify error
         out2 = psImageRebin(NULL,in,NULL,0,1,NULL);
         ok(out2 == NULL, "psImageRebin returned an NULL when the stats was NULL");
 
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the input parameter psStats structure member options
         // is zero or any value which doesn't correspond to a valid statistical
@@ -350,5 +350,5 @@
         ok(out2 == NULL, "psImageRebin returned an image though the stats options was PS_STAT_USE_RANGE");
 
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the input parameter psStats structure member options
         // specifies more than one valid statistical method.
@@ -363,5 +363,5 @@
     }
 
-    // testImageRoll()
+    // test psImageRoll()
     if (1) {
         psMemId id = psMemGetId();
@@ -387,9 +387,7 @@
 
         in = psImageAlloc(cols,rows,PS_TYPE_F32);
-        for (psS32 row=0;row<rows;row++)
-        {
-            psF32 *inRow = in->data.F32[row];
-            for (psS32 col=0;col<cols;col++) {
-                inRow[col] = (psF32)row+(psF32)col/1000.0f;
+        for (psS32 row=0;row<rows;row++) {
+            for (psS32 col=0;col<cols;col++) {
+                in->data.F32[row][col] = (psF32)row+(psF32)col/1000.0f;
             }
         }
@@ -397,6 +395,5 @@
         out = psImageRoll(NULL,in,0,0);
         bool errorFlag = false;
-        for (psS32 row=0;row<rows;row++)
-        {
+        for (psS32 row=0;row<rows;row++) {
             psF32 *inRow = in->data.F32[row];
             psF32 *outRow = out->data.F32[row];
@@ -519,9 +516,8 @@
 
 
-        // Verify the returned psImage structure pointer is null and program
-        // execution doesn't stop, if input parameter input is null.
+        // Verify the returned psImage structure pointer is NULL and program
+        // execution doesn't stop, if input parameter input is NULL.
         out2 = psImageRoll(NULL,NULL,0,0);
-        if (out2 != NULL)
-        {
+        if (out2 != NULL) {
             psError(PS_ERR_UNKNOWN, true,"psImageRoll did not return NULL though input image was NULL!?");
             return 2;
@@ -567,6 +563,5 @@
     }
 
-
-    // testImageRotate()
+    // test psImageRotate()
     if (1) {
         psMemId id = psMemGetId();
@@ -599,6 +594,5 @@
         psImage *sImg = psImageAlloc(cols,rows,PS_TYPE_S16);
 
-        for(psS32 row=0;row<rows;row++)
-        {
+        for(psS32 row=0;row<rows;row++) {
             psF32 *fRow = fImg->data.F32[row];
             psS16 *sRow = sImg->data.S16[row];
@@ -612,5 +606,4 @@
         // is to verify the results manually and bless it for automated comparison
         // thereafter
-
 
         // write results of various rotates to a file and verify with truth images
@@ -796,6 +789,6 @@
         }
 //HERE
-        // Verify the returned psImage structure pointer is null and program
-        // execution doesn't stop, if the input parameter input is null.
+        // Verify the returned psImage structure pointer is NULL and program
+        // execution doesn't stop, if the input parameter input is NULL.
         // Following should be an error
         // XXX: Verify error
@@ -803,5 +796,5 @@
         ok(fOut == NULL, "NULL was returned when the input image was NULL");
 
-        // Verify the returned psImage structure pointer is null and program
+        // Verify the returned psImage structure pointer is NULL and program
         // execution doesn't stop, if the specified interpolation mode is unallowed
         // Following should be an error for unallowed interpolation type
@@ -882,6 +875,6 @@
         ok(fRecycle == fOut, "psImageShift did recycle my image");
 
-        // Verify the returned psImage structure pointer is null and program
-        // execution doesn't stop, if the input psImage structure pointer is null.
+        // Verify the returned psImage structure pointer is NULL and program
+        // execution doesn't stop, if the input psImage structure pointer is NULL.
         // Following should be an error
         // XXX: Verify error
@@ -889,5 +882,5 @@
         ok(fOut == NULL, "psImageShift did return NULL given a NULL input image");
 
-        // Verify the returned psImage structure is null and program execution
+        // Verify the returned psImage structure is NULL and program execution
         // doesn't stop, if the specified interpolation mode is unallowed.
         // Following should be an error for unallowed interpolation mode
@@ -901,8 +894,7 @@
 
 
-    // testImageResample()
+    // test psImageResample()
     if (1) {
         psMemId id = psMemGetId();
-
         psS32 rows = 60;
         psS32 cols = 80;
@@ -911,10 +903,8 @@
         psErr *err;
 
-        psImage *image = psImageAlloc(cols,rows,PS_TYPE_F32);
-        for(psS32 row=0;row<rows;row++)
-        {
-            psF32 *imageRow = image->data.F32[row];
-            for (psS32 col=0;col<cols;col++) {
-                imageRow[col] = row+2*col;
+        psImage *image = psImageAlloc(cols, rows, PS_TYPE_F32);
+        for(psS32 row=0;row<rows;row++) {
+            for (psS32 col=0;col<cols;col++) {
+                image->data.F32[row][col] = row+2*col;
             }
         }
@@ -925,9 +915,6 @@
         ok(result == orig, "psImageResample() recycled image");
         ok(result->type.type == PS_TYPE_F32, "psImageResample() produced the correct type");
-
-
         ok(result->numCols == image->numCols*scale && result->numRows == image->numRows*scale,
            "psImageResample() produced the correct size");
-
 
         bool errorFlag = false;
@@ -939,6 +926,5 @@
             psMaskType maskVal;
             psF32 truthValue;
-            for(psS32 row=0;row<result->numRows;row++)
-            {
+            for(psS32 row=0;row<result->numRows;row++) {
                 for (psS32 col=0;col<result->numCols;col++) {
 //                    truthValue = psImagePixelInterpolate(image,
@@ -961,5 +947,5 @@
         ok(!errorFlag, "psImageResample() produced the correct data values");
 
-        // verify that image=null is handled properly.
+        // verify that image=NULL is handled properly.
         psErrorClear();
         result = psImageResample(result,NULL,scale,PS_INTERPOLATE_FLAT);
@@ -1002,5 +988,5 @@
 
 
-    // testImageTransform()
+    // test psImageTransform()
     if (1) {
         psMemId id = psMemGetId();
@@ -1013,22 +999,13 @@
 
         psImage *in = psImageAlloc(cols,rows,PS_TYPE_F32);
-        for (psS32 row=0;row<rows;row++)
-        {
-            psF32 *inRow = in->data.F32[row];
-            for (psS32 col=0;col<cols;col++) {
-                inRow[col] = (psF32)row+(psF32)col/1000.0f;
+        for (psS32 row=0;row<rows;row++) {
+            for (psS32 col=0;col<cols;col++) {
+                in->data.F32[row][col] = (psF32)row+(psF32)col/1000.0f;
             }
         }
         P_PSIMAGE_SET_COL0(in, 1);
-        psImage *out = psImageTransform(NULL,
-                                        NULL,
-                                        in,
-                                        NULL,
-                                        0,
-                                        trans,
-                                        psRegionSet(1,1+cols*2,0,rows*2),
-                                        NULL,
-                                        PS_INTERPOLATE_FLAT,
-                                        -1);
+        psImage *out = psImageTransform(NULL, NULL, in, NULL, 0, trans,
+                                        psRegionSet(1,1+cols*2,0,rows*2), NULL,
+                                        PS_INTERPOLATE_FLAT, -1);
 
         ok(out != NULL, "psImageTransform() returned non-NULL");
@@ -1036,5 +1013,5 @@
         ok(out->numRows == rows*2 && out->numCols == cols*2, "psImageTransform() produced the correct size");
 
-        if (0) {
+        if (1) {
             psMemId id = psMemGetId();
             psImageInterpolateOptions *tmpIntOpts = psImageInterpolateOptionsAlloc(
@@ -1045,7 +1022,5 @@
             psMaskType maskVal;
             bool errorFlag = false;
-            for (psS32 row=0;row<out->numRows;row++)
-            {
-                psF32 *outRow = out->data.F32[row];
+            for (psS32 row=0;row<out->numRows;row++) {
                 for (psS32 col=0;col<cols;col++) {
                     psImageInterpolate(&imgVal, &varVal, &maskVal, 
@@ -1054,6 +1029,7 @@
                                        tmpIntOpts);
                     float inValue = imgVal;
-                    if (fabsf(outRow[col] - inValue) > 0.01) {
-                        diag("out at %d,%d was %g, expected %g", col,row,outRow[col], inValue);
+                    if (fabsf(out->data.F32[row][col] - inValue) > 0.01) {
+                        diag("out at %d,%d was %g, expected %g", col,row,
+                              out->data.F32[row][col], inValue);
                         errorFlag = true;
                     }
