Index: trunk/psLib/test/dataManip/tst_psHist02.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psHist02.c	(revision 1327)
+++ trunk/psLib/test/dataManip/tst_psHist02.c	(revision 1365)
@@ -1,7 +1,7 @@
 /*****************************************************************************
-    This routine must ensure that the psHistogram structure is correctly
-    populated by the procedure psGetArrayHistogram().
- 
- *****************************************************************************/
+   This routine must ensure that the psHistogram structure is correctly
+   populated by the procedure psGetArrayHistogram().
+
+*****************************************************************************/
 #include <stdio.h>
 #include "pslib.h"
@@ -16,126 +16,126 @@
 int main()
 {
-    psHistogram *myHist = NULL;
-    psHistogram *myHist2= NULL;
-    psVector *myData    = NULL;
-    psVector *myMask    = NULL;
-    int testStatus      = true;
-    int memLeaks        = 0;
-    int nb              = 0;
-    int numBins         = 0;
-    int i               = 0;
-    int currentId       = 0;
-
-    currentId       = psMemGetId();
-
+    psHistogram * myHist = NULL;
+    psHistogram *myHist2 = NULL;
+    psVector *myData = NULL;
+    psVector *myMask = NULL;
+    int testStatus = true;
+    int memLeaks = 0;
+    int nb = 0;
+    int numBins = 0;
+    int i = 0;
+    int currentId = 0;
+    
+    currentId = psMemGetId();
+    
     /*********************************************************************/
     /*  Allocate and initialize data structures                          */
     /*********************************************************************/
-    myData = psVectorAlloc(NUM_DATA, PS_TYPE_F32);
+    myData = psVectorAlloc( NUM_DATA, PS_TYPE_F32 );
     myData->n = myData->nalloc;
-    for (i=0;i<NUM_DATA;i++) {
-        myData->data.F32[i] = LOWER + ((UPPER - LOWER) / (float) NUM_DATA) * (float) i;
-    }
-
-    myMask = psVectorAlloc(NUM_DATA, PS_TYPE_U8);
+    for ( i = 0;i < NUM_DATA;i++ ) {
+            myData->data.F32[ i ] = LOWER + ( ( UPPER - LOWER ) / ( float ) NUM_DATA ) * ( float ) i;
+        }
+        
+    myMask = psVectorAlloc( NUM_DATA, PS_TYPE_U8 );
     myMask->n = myMask->nalloc;
-    for (i=0;i<NUM_DATA;i++) {
-        if (i >= (NUM_DATA/2)) {
-            myMask->data.U8[i] = 1;
-        } else {
-            myMask->data.U8[i] = 0;
+    for ( i = 0;i < NUM_DATA;i++ ) {
+            if ( i >= ( NUM_DATA / 2 ) ) {
+                    myMask->data.U8[ i ] = 1;
+                } else {
+                    myMask->data.U8[ i ] = 0;
+                }
         }
-    }
-
-    for (nb=0;nb<4;nb++) {
-        if (nb == 0)
-            numBins = 1;
-        if (nb == 1)
-            numBins = 2;
-        if (nb == 2)
-            numBins = 10;
-        if (nb == 3)
-            numBins = 20;
-
-        /*********************************************************************/
-        /*  Allocate and Perform Histogram, no mask                          */
-        /*********************************************************************/
-        printPositiveTestHeader(stdout,
-                                "psStats functions",
-                                "Allocate and Perform Histogram, no mask");
-
-        myHist = psHistogramAlloc(LOWER, UPPER, numBins);
-        myHist = psVectorHistogram(myHist, myData, NULL, 0);
-
-        for (i=0;i<numBins;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.U32[i]);
+        
+    for ( nb = 0;nb < 4;nb++ ) {
+            if ( nb == 0 )
+                numBins = 1;
+            if ( nb == 1 )
+                numBins = 2;
+            if ( nb == 2 )
+                numBins = 10;
+            if ( nb == 3 )
+                numBins = 20;
+                
+            /*********************************************************************/
+            /*  Allocate and Perform Histogram, no mask                          */
+            /*********************************************************************/
+            printPositiveTestHeader( stdout,
+                                     "psStats functions",
+                                     "Allocate and Perform Histogram, no mask" );
+                                     
+            myHist = psHistogramAlloc( LOWER, UPPER, numBins );
+            myHist = psVectorHistogram( myHist, myData, NULL, 0 );
+            
+            for ( i = 0;i < numBins;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.U32[ i ] );
+                }
+            psMemCheckCorruption( 1 );
+            psFree( myHist );
+            psMemCheckCorruption( 1 );
+            
+            printFooter( stdout,
+                         "psStats functions",
+                         "Allocate and Perform Histogram, no mask",
+                         testStatus );
+                         
+            /*********************************************************************/
+            /*  Allocate and Perform Histogram with mask                         */
+            /*********************************************************************/
+            printPositiveTestHeader( stdout,
+                                     "psStats functions",
+                                     "Allocate and Perform Histogram with mask" );
+                                     
+            myHist = psHistogramAlloc( LOWER, UPPER, numBins );
+            myHist = psVectorHistogram( myHist, myData, myMask, 1 );
+            
+            for ( i = 0;i < numBins;i++ ) {
+                    printf( "Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i,
+                            myHist->bounds->data.F32[ i ],
+                            myHist->bounds->data.F32[ i + 1 ],
+                            myHist->nums->data.U32[ i ] );
+                }
+            psMemCheckCorruption( 1 );
+            psFree( myHist );
+            psMemCheckCorruption( 1 );
+            
+            printFooter( stdout,
+                         "psStats functions",
+                         "Allocate and Perform Histogram with mask",
+                         testStatus );
         }
-        psMemCheckCorruption(1);
-        psFree(myHist);
-        psMemCheckCorruption(1);
-
-        printFooter(stdout,
-                    "psStats functions",
-                    "Allocate and Perform Histogram, no mask",
-                    testStatus);
-
-        /*********************************************************************/
-        /*  Allocate and Perform Histogram with mask                         */
-        /*********************************************************************/
-        printPositiveTestHeader(stdout,
-                                "psStats functions",
-                                "Allocate and Perform Histogram with mask");
-
-        myHist = psHistogramAlloc(LOWER, UPPER, numBins);
-        myHist = psVectorHistogram(myHist, myData, myMask, 1);
-
-        for (i=0;i<numBins;i++) {
-            printf("Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i,
-                   myHist->bounds->data.F32[i],
-                   myHist->bounds->data.F32[i+1],
-                   myHist->nums->data.U32[i]);
-        }
-        psMemCheckCorruption(1);
-        psFree(myHist);
-        psMemCheckCorruption(1);
-
-        printFooter(stdout,
-                    "psStats functions",
-                    "Allocate and Perform Histogram with mask",
-                    testStatus);
-    }
-    psFree(myMask);
-
-    printPositiveTestHeader(stdout,
-                            "psStats functions",
-                            "Calling psVectorHistogram() with various NULL inputs.");
-
+    psFree( myMask );
+    
+    printPositiveTestHeader( stdout,
+                             "psStats functions",
+                             "Calling psVectorHistogram() with various NULL inputs." );
+                             
     // Verify the return value is null and program execution doesn't stop,
     // if input parameter myHist is null.
-
-    myHist2 = psVectorHistogram(NULL, myData, NULL, 0);
-    if (myHist2 != NULL) {
-        printf("ERROR: myHist2!=NULL\n");
-        testStatus = false;
-    }
-    psFree(myData);
-
-
+    
+    myHist2 = psVectorHistogram( NULL, myData, NULL, 0 );
+    if ( myHist2 != NULL ) {
+            printf( "ERROR: myHist2!=NULL\n" );
+            testStatus = false;
+        }
+    psFree( myData );
+    
+    
     // Verify the retrun value is the same as the input parameter myHist and
     // program execution doesn't stop, if the input parameter myArray is
     // null.
-
-    myHist = psHistogramAlloc(LOWER, UPPER, numBins);
-    myHist = psVectorHistogram(myHist, NULL, NULL, 0);
-    if (myHist == NULL) {
-        printf("ERROR: myHist==NULL\n");
-        testStatus = false;
-    }
-    psFree(myHist);
-
-
+    
+    myHist = psHistogramAlloc( LOWER, UPPER, numBins );
+    myHist = psVectorHistogram( myHist, NULL, NULL, 0 );
+    if ( myHist == NULL ) {
+            printf( "ERROR: myHist==NULL\n" );
+            testStatus = false;
+        }
+    psFree( myHist );
+    
+    
     // Verify the return value is the same as the input parameter myHist and
     // program execution doesn't stop, if the input parameter myArray has no
@@ -155,28 +155,28 @@
     psFree(myData);
     */
-    printFooter(stdout,
-                "psStats functions",
-                "Calling psVectorHistogram() with various NULL inputs.",
-                testStatus);
-
+    printFooter( stdout,
+                 "psStats functions",
+                 "Calling psVectorHistogram() with various NULL inputs.",
+                 testStatus );
+                 
     /*************************************************************************/
     /*  Deallocate data structures                                   */
     /*************************************************************************/
-    printPositiveTestHeader(stdout,
-                            "psStats functions",
-                            "Deallocate the psHistogram structure.");
-
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(1);
-
-    printFooter(stdout,
-                "psStats functions",
-                "Deallocate the psHistogram structure.",
-                testStatus);
-
-    return (!testStatus);
+    printPositiveTestHeader( stdout,
+                             "psStats functions",
+                             "Deallocate the psHistogram structure." );
+                             
+    psMemCheckCorruption( 1 );
+    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
+    if ( 0 != memLeaks ) {
+            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
+        }
+    psMemCheckCorruption( 1 );
+    
+    printFooter( stdout,
+                 "psStats functions",
+                 "Deallocate the psHistogram structure.",
+                 testStatus );
+                 
+    return ( !testStatus );
 }
