Index: trunk/psLib/test/image/tst_psImageStats00.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats00.c	(revision 1073)
+++ trunk/psLib/test/image/tst_psImageStats00.c	(revision 1365)
@@ -1,6 +1,6 @@
 /*****************************************************************************
-    This routine must ensure that the psHistogram structure is correctly
-    allocated and populated by the psImageHistogram() function.
- *****************************************************************************/
+   This routine must ensure that the psHistogram structure is correctly
+   allocated and populated by the psImageHistogram() function.
+*****************************************************************************/
 #include <stdio.h>
 #include "pslib.h"
@@ -16,168 +16,168 @@
 int main()
 {
-    psHistogram *myHist = NULL;
-    psHistogram *myHist2= NULL;
-    psImage *tmpImage   = NULL;
-    psImage *tmpMask    = NULL;
-    int testStatus      = true;
-    int memLeaks        = 0;
-    int nb              = 0;
-    int i               = 0;
-    int j               = 0;
-    int IMAGE_X_SIZE    = 0;
-    int IMAGE_Y_SIZE    = 0;
-    int currentId       = 0;
-
-    currentId       = psMemGetId();
-    for (nb=0;nb<6;nb++) {
-        if (nb == 0) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = 1;
+    psHistogram * myHist = NULL;
+    psHistogram *myHist2 = NULL;
+    psImage *tmpImage = NULL;
+    psImage *tmpMask = NULL;
+    int testStatus = true;
+    int memLeaks = 0;
+    int nb = 0;
+    int i = 0;
+    int j = 0;
+    int IMAGE_X_SIZE = 0;
+    int IMAGE_Y_SIZE = 0;
+    int currentId = 0;
+    
+    currentId = psMemGetId();
+    for ( nb = 0;nb < 6;nb++ ) {
+            if ( nb == 0 ) {
+                    IMAGE_X_SIZE = 1;
+                    IMAGE_Y_SIZE = 1;
+                }
+            if ( nb == 1 ) {
+                    IMAGE_X_SIZE = 1;
+                    IMAGE_Y_SIZE = N;
+                }
+            if ( nb == 2 ) {
+                    IMAGE_X_SIZE = N;
+                    IMAGE_Y_SIZE = 1;
+                }
+            if ( nb == 3 ) {
+                    IMAGE_X_SIZE = N;
+                    IMAGE_Y_SIZE = N;
+                }
+            if ( nb == 4 ) {
+                    IMAGE_X_SIZE = N;
+                    IMAGE_Y_SIZE = M;
+                }
+            if ( nb == 5 ) {
+                    IMAGE_X_SIZE = M;
+                    IMAGE_Y_SIZE = N;
+                }
+            printf( "*******************************\n" );
+            printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
+            printf( "*******************************\n" );
+            /*********************************************************************/
+            /*  Allocate and initialize data structures                      */
+            /*********************************************************************/
+            tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
+            
+            for ( i = 0;i < tmpImage->numRows;i++ ) {
+                    for ( j = 0;j < tmpImage->numCols;j++ ) {
+                            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 );
+                        }
+                }
+            tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
+            for ( i = 0;i < tmpMask->numRows;i++ ) {
+                    for ( j = 0;j < tmpMask->numCols;j++ ) {
+                            if ( ( i > ( tmpMask->numRows / 2 ) ) &&
+                                    ( j > ( tmpMask->numCols / 2 ) ) ) {
+                                    tmpMask->data.U8[ i ][ j ] = 1;
+                                } else {
+                                    tmpMask->data.U8[ i ][ j ] = 0;
+                                }
+                        }
+                }
+                
+            /*************************************************************************/
+            /*  Calculate Histogram with no mask                             */
+            /*************************************************************************/
+            printPositiveTestHeader( stdout,
+                                     "psImageStats functions",
+                                     "Calculate Histogram, no mask" );
+                                     
+            myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
+                                       NUM_BINS );
+            myHist = psImageHistogram( myHist, tmpImage, NULL, 0 );
+            for ( i = 0;i < NUM_BINS;i++ ) {
+                    printf( "Bin number %d bounds: (%.1f - %.1f) data (%d)\n", i,
+                            myHist->bounds->data.F32[ i ],
+                            myHist->bounds->data.F32[ i + 1 ],
+                            myHist->nums->data.S32[ i ] );
+                }
+            psFree( myHist );
+            
+            psMemCheckCorruption( 1 );
+            printFooter( stdout,
+                         "psImageStats functions",
+                         "Calculate Histogram, no mask",
+                         testStatus );
+                         
+            /*************************************************************************/
+            /*  Calculate Histogram with mask                                */
+            /*************************************************************************/
+            printPositiveTestHeader( stdout,
+                                     "psImageStats functions",
+                                     "Calculate Histogram with mask" );
+                                     
+            myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
+                                       NUM_BINS );
+            myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 );
+            for ( i = 0;i < NUM_BINS;i++ ) {
+                    printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i,
+                            myHist->bounds->data.F32[ i ],
+                            myHist->bounds->data.F32[ i + 1 ],
+                            myHist->nums->data.S32[ i ] );
+                }
+                
+            psMemCheckCorruption( 1 );
+            printFooter( stdout,
+                         "psImageStats functions",
+                         "Calculate Histogram with mask",
+                         testStatus );
+                         
+            /*************************************************************************/
+            /*  Deallocate data structures                                   */
+            /*************************************************************************/
+            printPositiveTestHeader( stdout,
+                                     "psImageStats functions",
+                                     "Deallocate the psHistogram/psImage structure." );
+            psFree( myHist );
+            psFree( tmpImage );
+            psFree( tmpMask );
+            
+            psMemCheckCorruption( 1 );
+            memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
+            if ( 0 != memLeaks ) {
+                    psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
+                }
+                
+            printFooter( stdout,
+                         "psImageStats functions",
+                         "Deallocate the psHistogram/psImage structure.",
+                         testStatus );
         }
-        if (nb == 1) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = N;
+    printPositiveTestHeader( stdout,
+                             "psImageStats functions",
+                             "Calling psImageHistogram() with NULL parameters" );
+                             
+    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
+    myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
+                               NUM_BINS );
+    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
+    if ( myHist2 != NULL ) {
+            printf( "ERROR: myHist2 not equal to NULL\n" );
         }
-        if (nb == 2) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = 1;
+        
+    myHist2 = psImageHistogram( myHist, NULL, NULL, 0 );
+    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
+    if ( myHist2 != NULL ) {
+            printf( "ERROR: myHist2 not equal to NULL\n" );
         }
-        if (nb == 3) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = N;
+        
+    psMemCheckCorruption( 1 );
+    psFree( myHist );
+    psFree( tmpImage );
+    psMemCheckCorruption( 1 );
+    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
+    if ( 0 != memLeaks ) {
+            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
         }
-        if (nb == 4) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = M;
-        }
-        if (nb == 5) {
-            IMAGE_X_SIZE = M;
-            IMAGE_Y_SIZE = N;
-        }
-        printf("*******************************\n");
-        printf("* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE);
-        printf("*******************************\n");
-        /*********************************************************************/
-        /*  Allocate and initialize data structures                      */
-        /*********************************************************************/
-        tmpImage = psImageAlloc(IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32);
-
-        for (i=0;i<tmpImage->numRows;i++) {
-            for (j=0;j<tmpImage->numCols;j++) {
-                tmpImage->data.F32[i][j] = (float) (i + j + 0.1);
-            }
-        }
-        tmpMask = psImageAlloc(IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8);
-        for (i=0;i<tmpMask->numRows;i++) {
-            for (j=0;j<tmpMask->numCols;j++) {
-                if ((i > (tmpMask->numRows/2)) &&
-                        (j > (tmpMask->numCols/2))) {
-                    tmpMask->data.U8[i][j] = 1;
-                } else {
-                    tmpMask->data.U8[i][j] = 0;
-                }
-            }
-        }
-
-        /*************************************************************************/
-        /*  Calculate Histogram with no mask                             */
-        /*************************************************************************/
-        printPositiveTestHeader(stdout,
-                                "psImageStats functions",
-                                "Calculate Histogram, no mask");
-
-        myHist = psHistogramAlloc(0.0, (float) (IMAGE_X_SIZE + IMAGE_Y_SIZE),
-                                  NUM_BINS);
-        myHist = psImageHistogram(myHist, tmpImage, NULL, 0);
-        for (i=0;i<NUM_BINS;i++) {
-            printf("Bin number %d bounds: (%f - %f) data (%d)\n", i,
-                   myHist->bounds->data.F32[i],
-                   myHist->bounds->data.F32[i+1],
-                   myHist->nums->data.S32[i]);
-        }
-        psFree(myHist);
-
-        psMemCheckCorruption(1);
-        printFooter(stdout,
-                    "psImageStats functions",
-                    "Calculate Histogram, no mask",
-                    testStatus);
-
-        /*************************************************************************/
-        /*  Calculate Histogram with mask                                */
-        /*************************************************************************/
-        printPositiveTestHeader(stdout,
-                                "psImageStats functions",
-                                "Calculate Histogram with mask");
-
-        myHist = psHistogramAlloc(0.0, (float) (IMAGE_X_SIZE + IMAGE_Y_SIZE),
-                                  NUM_BINS);
-        myHist = psImageHistogram(myHist, tmpImage, tmpMask, 1);
-        for (i=0;i<NUM_BINS;i++) {
-            printf("Bin number %d bounds: (%f - %f) data (%d)\n", i,
-                   myHist->bounds->data.F32[i],
-                   myHist->bounds->data.F32[i+1],
-                   myHist->nums->data.S32[i]);
-        }
-
-        psMemCheckCorruption(1);
-        printFooter(stdout,
-                    "psImageStats functions",
-                    "Calculate Histogram with mask",
-                    testStatus);
-
-        /*************************************************************************/
-        /*  Deallocate data structures                                   */
-        /*************************************************************************/
-        printPositiveTestHeader(stdout,
-                                "psImageStats functions",
-                                "Deallocate the psHistogram/psImage structure.");
-        psFree(myHist);
-        psFree(tmpImage);
-        psFree(tmpMask);
-
-        psMemCheckCorruption(1);
-        memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
-        if (0 != memLeaks) {
-            psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-        }
-
-        printFooter(stdout,
-                    "psImageStats functions",
-                    "Deallocate the psHistogram/psImage structure.",
-                    testStatus);
-    }
-    printPositiveTestHeader(stdout,
-                            "psImageStats functions",
-                            "Calling psImageHistogram() with NULL parameters");
-
-    tmpImage = psImageAlloc(IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32);
-    myHist  = psHistogramAlloc(0.0, (float) (IMAGE_X_SIZE + IMAGE_Y_SIZE),
-                               NUM_BINS);
-    myHist2 = psImageHistogram(NULL, tmpImage, NULL, 0);
-    if (myHist2 != NULL) {
-        printf("ERROR: myHist2 not equal to NULL\n");
-    }
-
-    myHist2 = psImageHistogram(myHist, NULL, NULL, 0);
-    myHist2 = psImageHistogram(NULL, tmpImage, NULL, 0);
-    if (myHist2 != NULL) {
-        printf("ERROR: myHist2 not equal to NULL\n");
-    }
-
-    psMemCheckCorruption(1);
-    psFree(myHist);
-    psFree(tmpImage);
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-    }
-
-    printFooter(stdout,
-                "psImageStats functions",
-                "Calling psImageHistogram() with NULL parameters",
-                testStatus);
-
-    return (!testStatus);
+        
+    printFooter( stdout,
+                 "psImageStats functions",
+                 "Calling psImageHistogram() with NULL parameters",
+                 testStatus );
+                 
+    return ( !testStatus );
 }
