Index: trunk/psLib/test/psTest.c
===================================================================
--- trunk/psLib/test/psTest.c	(revision 1365)
+++ trunk/psLib/test/psTest.c	(revision 1406)
@@ -37,99 +37,99 @@
     int n;
     extern char *optarg;
-    
+
     if ( argc > 0 ) {
-            while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) {
-                    switch ( c ) {
-                            case 'h':
-                            printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n"
-                                    "    where:\n"
-                                    "           -l  : lists the testpoints contained in this test driver executable\n"
-                                    "           -d  : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n"
-                                    "           -h  : prints this help\n"
-                                    "           -n  : specifies a particular testpoint by number to run\n"
-                                    "           -t  : specifies a particular testpoint by name to run\n"
-                                    "    (if no -l, -n or -t options are given, all testpoints are run)\n",
-                                    argv[ 0 ] );
-                            runAll = false;
-                            break;
-                            case 'd':
-                            useFork = false;
-                            break;
-                            case 'l':
-                            printf( "Test Driver:  %s\n", testPointFile );
-                            printf( "Package Name: %s\n", packageName );
-                            printf( "Testpoints:\n" );
-                            runAll = false;
-                            for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
-                                    printf( "    %6d - %s \n", tests[ index ].testPointNumber,
-                                            tests[ index ].testPointName );
-                                }
-                            printf( "\n" );
-                            break;
-                            case 't':
-                            runAll = false;
-                            for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
-                                    if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) {
-                                            success = p_runTest( fp,
-                                                                 testPointFile,
-                                                                 packageName,
-                                                                 tests[ index ].testPointName,
-                                                                 tests[ index ].fcn,
-                                                                 tests[ index ].expectedReturn,
-                                                                 useFork ) && success;
-                                        }
-                                }
-                            break;
-                            case 'n':
-                            runAll = false;
-                            if ( sscanf( optarg, "%i", &n ) != 1 ) {
-                                    psError( __func__, "Failed to parse the testpoint number (%s).",
-                                             optarg );
-                                    break;
-                                }
-                            found = false;
-                            for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
-                                    if ( n == tests[ index ].testPointNumber ) {
-                                            found = true;
-                                            success = p_runTest( fp,
-                                                                 testPointFile,
-                                                                 packageName,
-                                                                 tests[ index ].testPointName,
-                                                                 tests[ index ].fcn,
-                                                                 tests[ index ].expectedReturn,
-                                                                 useFork ) && success;
-                                        }
-                                }
-                            if ( ! found ) {
-                                    psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.",
-                                             n );
-                                    break;
-                                }
-                            break;
-                            case '?':
-                            psError( __func__, "Option %s is not recognized and is ignored.", optarg );
-                            break;
-                        }
-                }
-        }
-        
+        while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) {
+            switch ( c ) {
+            case 'h':
+                printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n"
+                        "    where:\n"
+                        "           -l  : lists the testpoints contained in this test driver executable\n"
+                        "           -d  : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n"
+                        "           -h  : prints this help\n"
+                        "           -n  : specifies a particular testpoint by number to run\n"
+                        "           -t  : specifies a particular testpoint by name to run\n"
+                        "    (if no -l, -n or -t options are given, all testpoints are run)\n",
+                        argv[ 0 ] );
+                runAll = false;
+                break;
+            case 'd':
+                useFork = false;
+                break;
+            case 'l':
+                printf( "Test Driver:  %s\n", testPointFile );
+                printf( "Package Name: %s\n", packageName );
+                printf( "Testpoints:\n" );
+                runAll = false;
+                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
+                    printf( "    %6d - %s \n", tests[ index ].testPointNumber,
+                            tests[ index ].testPointName );
+                }
+                printf( "\n" );
+                break;
+            case 't':
+                runAll = false;
+                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
+                    if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) {
+                        success = p_runTest( fp,
+                                             testPointFile,
+                                             packageName,
+                                             tests[ index ].testPointName,
+                                             tests[ index ].fcn,
+                                             tests[ index ].expectedReturn,
+                                             useFork ) && success;
+                    }
+                }
+                break;
+            case 'n':
+                runAll = false;
+                if ( sscanf( optarg, "%i", &n ) != 1 ) {
+                    psError( __func__, "Failed to parse the testpoint number (%s).",
+                             optarg );
+                    break;
+                }
+                found = false;
+                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
+                    if ( n == tests[ index ].testPointNumber ) {
+                        found = true;
+                        success = p_runTest( fp,
+                                             testPointFile,
+                                             packageName,
+                                             tests[ index ].testPointName,
+                                             tests[ index ].fcn,
+                                             tests[ index ].expectedReturn,
+                                             useFork ) && success;
+                    }
+                }
+                if ( ! found ) {
+                    psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.",
+                             n );
+                    break;
+                }
+                break;
+            case '?':
+                psError( __func__, "Option %s is not recognized and is ignored.", optarg );
+                break;
+            }
+        }
+    }
+
     if ( runAll ) {
-            for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
-                    if ( ! tests[ index ].isDuplicateEntry ) {
-                            success = p_runTest( fp,
-                                                 testPointFile,
-                                                 packageName,
-                                                 tests[ index ].testPointName,
-                                                 tests[ index ].fcn,
-                                                 tests[ index ].expectedReturn,
-                                                 useFork ) && success;
-                        }
-                }
-        }
-        
+        for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
+            if ( ! tests[ index ].isDuplicateEntry ) {
+                success = p_runTest( fp,
+                                     testPointFile,
+                                     packageName,
+                                     tests[ index ].testPointName,
+                                     tests[ index ].fcn,
+                                     tests[ index ].expectedReturn,
+                                     useFork ) && success;
+            }
+        }
+    }
+
     if ( ! success ) {
-            psError( testPointFile, "One or more tests failed" );
-        }
-        
+        psError( testPointFile, "One or more tests failed" );
+    }
+
     return success;
 }
@@ -140,53 +140,54 @@
     int childReturn = 0;
     pid_t child;
-    
+
     p_printPositiveTestHeader( fp, testPointFile, packageName, testPointName );
-    
+
     if ( useFork ) {
-            child = fork();
-            if ( child == 0 ) {                   // I am the child process, run the test
-                    int currentId = psMemGetId();
-                    int retVal = fcn();
-                    if ( retVal == 0 ) { // only bother checking memory if test executed to end.
-                            if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
-                                    psError( __func__, "Memory Leaks Detected" );
-                                    retVal = 64;
-                                }
-                            psMemCheckCorruption( 1 );
-                        }
-                    exit( retVal );
-                } else if ( child < 0 ) {
-                    fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)",
-                             packageName, testPointName );
-                    abort();
-                }
-                
-            waitpid( child, &childReturn, 0 );
-            if ( WIFSIGNALED( childReturn ) ) {
-                    childReturn = -WTERMSIG( childReturn );
-                } else {
-                    childReturn = WEXITSTATUS( childReturn );
-                }
+        child = fork();
+        if ( child == 0 ) {                   // I am the child process, run the test
+            int currentId = psMemGetId();
+            int retVal = fcn();
+            if ( retVal == 0 ) { // only bother checking memory if test executed to end.
+                if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
+                    psError( __func__, "Memory Leaks Detected" );
+                    retVal = 64;
+                }
+                psMemCheckCorruption( 1 );
+            }
+            exit( retVal );
+        } else
+            if ( child < 0 ) {
+                fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)",
+                         packageName, testPointName );
+                abort();
+            }
+
+        waitpid( child, &childReturn, 0 );
+        if ( WIFSIGNALED( childReturn ) ) {
+            childReturn = -WTERMSIG( childReturn );
         } else {
-            int currentId = psMemGetId();
-            childReturn = fcn();
-            if ( childReturn == 0 ) { // only bother checking memory if test executed to end.
-                    if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
-                            psError( __func__, "Memory Leaks Detected" );
-                            childReturn = 64;
-                        }
-                    psMemCheckCorruption( 1 );
-                }
-        }
-        
-        
+            childReturn = WEXITSTATUS( childReturn );
+        }
+    } else {
+        int currentId = psMemGetId();
+        childReturn = fcn();
+        if ( childReturn == 0 ) { // only bother checking memory if test executed to end.
+            if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
+                psError( __func__, "Memory Leaks Detected" );
+                childReturn = 64;
+            }
+            psMemCheckCorruption( 1 );
+        }
+    }
+
+
     if ( childReturn != expectedReturn ) {
-            fprintf( fp, "Return value mismatch: expected %d, got %d",
-                     expectedReturn, childReturn );
-        }
-        
+        fprintf( fp, "Return value mismatch: expected %d, got %d",
+                 expectedReturn, childReturn );
+    }
+
     p_printFooter( fp, testPointFile, packageName, testPointName,
                    ( childReturn == expectedReturn ) );
-                   
+
     return ( childReturn == expectedReturn );
 }
@@ -198,7 +199,7 @@
 {
     char TP[ 80 ];
-    
+
     snprintf( TP, 80, "%s{%s}", packageName, testPointName );
-    
+
     fprintf( fp, HEADER_TOP );
     fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile );
@@ -216,7 +217,7 @@
 {
     char TP[ 80 ];
-    
+
     snprintf( TP, 80, "%s{%s}", packageName, testPointName );
-    
+
     fprintf( fp, HEADER_TOP );
     fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile );
@@ -236,7 +237,7 @@
 {
     if ( success ) {
-            fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
-        } else {
-            fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
-        }
-}
+        fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
+    } else {
+        fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
+    }
+}
