Index: trunk/psLib/test/imageops/tap_psImageStructManip.c
===================================================================
--- trunk/psLib/test/imageops/tap_psImageStructManip.c	(revision 11688)
+++ trunk/psLib/test/imageops/tap_psImageStructManip.c	(revision 13123)
@@ -1,11 +1,10 @@
-/** @file  tst_psImageExtraction.c
+/** @file  tap_psImageStructManip.c
 *
 *  @brief Contains the tests for psImageExtraction.[ch]
 *
-*
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-02-08 01:21:50 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-05-02 04:14:33 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -26,5 +25,4 @@
     // psImageSubset shall create child image of a specified size from a
     // parent psImage structure
-
     // psImageSubset()
     {
@@ -33,10 +31,9 @@
         psS32 c = 128;
         psS32 r = 256;
-        psRegion region1 = psRegionSet(0,c/2,0,r/2);
-        psRegion region2 = psRegionSet(c/4,c/4+c/2,r/4,r/4+r/2);
+        psRegion region1 = psRegionSet(0, c/2, 0, r/2);
+        psRegion region2 = psRegionSet(c/4, c/4+c/2, r/4, r/4+r/2);
 
         psImage* original = psImageAlloc(c,r,PS_TYPE_U32);
-        for (psS32 row=0;row<r;row++)
-        {
+        for (psS32 row=0;row<r;row++) {
             for (psS32 col=0;col<c;col++) {
                 original->data.F32[row][col] = row*1000+col;
@@ -63,6 +60,5 @@
 
         bool errorFlag = false;
-        for (psS32 row=0;row<r/2;row++)
-        {
+        for (psS32 row=0;row<r/2;row++) {
             for (psS32 col=0;col<c/2;col++) {
                 if (subset2->data.U32[row][col] != original->data.U32[row+r/4][col+c/4]) {
@@ -99,5 +95,4 @@
         ok(subset2->children == NULL && subset3->children == NULL, "psImageSubset() set ->children correctly");
 
-
         // Verify the input psImage structure image only has the following members
         // changed: 1) Nchildren is increased by one. 2) parent contains pointer psImage structure
@@ -107,4 +102,5 @@
            "psImageSubset did properly store the children pointers.");
 
+
         // Verify the returned psImage structure pointer is null and program
         // execution doesn't stop, if the input parameter image is null.
@@ -114,4 +110,5 @@
         psImage* subset1 = psImageSubset(NULL,region1);
         ok(subset1 == NULL, "psImageSubset returned NULL when input image was NULL.");
+
 
         // Verify the returned psImage structure pointer is null and program
@@ -153,4 +150,5 @@
         ok(subset1 == NULL,
            "psImageSubset returned NULL when subset origin was outside of image (row0=-1)");
+
 
         // Verify the returned psImage structure pointer is null and program
@@ -205,33 +203,29 @@
         psU32 r = 256;
 
-        psImage* img = psImageAlloc(c,r,PS_TYPE_F32);
-        for (unsigned row=0;row<r;row++)
-        {
-            psF32* imgRow = img->data.F32[row];
+        psImage *img = psImageAlloc(c,r,PS_TYPE_F32);
+        for (unsigned row=0;row<r;row++) {
             for (unsigned col=0;col<c;col++) {
-                imgRow[col] = (psF32)(row+col);
-            }
-        }
-        psImage* img2 = psImageAlloc(c,r,PS_TYPE_F32);
-        for (unsigned row=0;row<r;row++)
-        {
-            psF32* img2Row = img2->data.F32[row];
+                img->data.F32[row][col] = (psF32)(row+col);
+            }
+        }
+        psImage *img2 = psImageAlloc(c,r,PS_TYPE_F32);
+        for (unsigned row=0;row<r;row++) {
             for (unsigned col=0;col<c;col++) {
-                img2Row[col] = 0.0f;
-            }
-        }
-
-        psImage* img3 = psImageCopy(img2,img,PS_TYPE_F32);
-        // Verify the returned psImage structure pointer is equal to the input parameter output.
+                img2->data.F32[row][col] = 0.0f;
+            }
+        }
+
+        psImage *img3 = psImageCopy(img2,img,PS_TYPE_F32);
+        // Verify the returned psImage structure pointer is equal to the input
+        // parameter output.
         ok(img2 == img3, "psImageCopy(): recycled input image");
 
-        // Verify the returned psImage structure is the same type as the input image structure
-        // if the specified output argument is NULL.
-        psImage* img4 = psImageCopy(NULL,img,PS_TYPE_F32);
+        // Verify the returned psImage structure is the same type as the input image
+        // structure if the specified output argument is NULL.
+        psImage *img4 = psImageCopy(NULL,img,PS_TYPE_F32);
         ok(img4 != NULL, "psImageCopy() returned non-NULL with NULL output argument");
         ok(img4->type.type == img->type.type, "psImageCopy() set the correct image type");
         bool errorFlag = false;
-        for (psU32 row=0;row<r;row++)
-        {
+        for (psU32 row=0;row<r;row++) {
             psF32* imgInRow = img->data.F32[row];
             psF32* imgOutRow = img4->data.F32[row];
@@ -326,14 +320,12 @@
         psS32 halfR = r/2;
         psS32 halfC = c/2;
-        psRegion centerHalf = {qtrC,qtrC+halfC,qtrR,qtrR+halfR};
+        psRegion centerHalf = {qtrC, qtrC+halfC, qtrR, qtrR+halfR};
 
         psImage* image = psImageAlloc(c,r,PS_TYPE_F32);
-        for (psS32 row = 0; row < image->numRows; row++)
-        {
+        for (psS32 row = 0; row < image->numRows; row++) {
             for (psS32 col = 0; col < image->numCols; col++) {
                 image->data.F32[row][col] = (psF32)col + (psF32)row/1000.0f;
             }
         }
-
         // invoke psImageTrim with non-NULL image, and a valid region
         // x0,y0->x1,y1 (using only positive values). Verify that:
@@ -350,6 +342,5 @@
 
         bool errorFlag = false;
-        for (psS32 row = 0; row < image2->numRows; row++)
-        {
+        for (psS32 row = 0; row < image2->numRows; row++) {
             for (psS32 col = 0; col < image2->numCols; col++) {
                 if (fabsf(image2->data.F32[row][col] - image->data.F32[row+qtrR][col+qtrC])
@@ -379,6 +370,5 @@
            image->numCols-qtrC, image->numRows-qtrR);
 
-        for (psS32 row = 0; row < image2->numRows; row++)
-        {
+        for (psS32 row = 0; row < image2->numRows; row++) {
             for (psS32 col = 0; col < image2->numCols; col++) {
                 if (fabsf(image2->data.F32[row][col] -
@@ -394,5 +384,6 @@
         ok(!errorFlag, "psImageTrim() set image data correctly");
 
-        //  4. invoke psImageTrim with x1<0, y1<0. Verify:
+
+        //  Invoke psImageTrim with x1<0, y1<0. Verify:
         //      a. the psImage size is (numCols+x1)-x0 by (numRows+y1)-y0.
         //      b. the pixel values coorespond to the region
@@ -405,7 +396,5 @@
            image2->numCols, image2->numRows,
            image->numCols-qtrC, image->numRows-qtrR);
-
-        for (psS32 row = 0; row < image2->numRows; row++)
-        {
+        for (psS32 row = 0; row < image2->numRows; row++) {
             for (psS32 col = 0; col < image2->numCols; col++) {
                 if (fabsf(image2->data.F32[row][col] -
@@ -422,5 +411,6 @@
         psFree(image1);
 
-        //  6. invoke psImageTrim with image=NULL Verify:
+
+        //  Invoke psImageTrim with image=NULL Verify:
         //      a. execution does not cease.
         //      b. return value is NULL
@@ -428,6 +418,4 @@
         // An error should follow...
         // XXX: Verify errors
-
-
         image2 = psImageTrim(NULL, psRegionSet(qtrC,0,qtrR,0));
         ok(image2 == NULL, "psImageTrim returned NULL given a NULL input image");
@@ -438,4 +426,5 @@
 
 
+        // Verify when psRegion has a coord at -1
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(-1,0,0,0));
@@ -447,4 +436,5 @@
 
 
+        // Verify when psRegion has a coord at -1
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(0,0,-1,0));
@@ -456,4 +446,5 @@
 
 
+        // Verify when psRegion has a coord at outside the image range
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(0,image->numCols+1,0,0));
@@ -465,4 +456,5 @@
 
 
+        // Verify when psRegion has a coord at outside the image range
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(0,0,0,image->numRows+1));
@@ -474,4 +466,5 @@
 
 
+        // Verify when psRegion has a coord at outside the image range
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(0,0,0,(((psF32)image->numRows)*-1.0)));
@@ -483,4 +476,5 @@
 
 
+        // Verify when psRegion has a coord at outside the image range
         image1 = psImageCopy(NULL,image,PS_TYPE_F32);
         image2 = psImageTrim(image1, psRegionSet(0,(((psF32)image->numCols)*-1.0),0,0));
