IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1406


Ignore:
Timestamp:
Aug 6, 2004, 12:34:06 PM (22 years ago)
Author:
desonia
Message:

astyle fixed?

Location:
trunk/psLib
Files:
130 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r1393 r1406  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-05 19:38:51 $
     12*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-06 22:34:05 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astro/psTime.c

    r1393 r1406  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-05 19:38:51 $
     14 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astro/psTime.h

    r1393 r1406  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-05 19:38:51 $
     14 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astronomy/psAstrometry.c

    r1393 r1406  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-05 19:38:51 $
     10*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astronomy/psAstrometry.h

    r1385 r1406  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-04 23:37:39 $
     10*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astronomy/psCoord.c

    r1393 r1406  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-05 19:38:51 $
     12*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-06 22:34:05 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astronomy/psMetadata.c

    r1398 r1406  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-05 23:39:23 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-06 22:34:05 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    280280            return false;
    281281        }
    282     } else if(value != NULL) {
    283 
    284         // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    285         // it will wipe out existing node.
    286         psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    287                  metadataItem->name );
    288         return false;
    289     } else {
    290 
    291         // Duplicate key not found. Add new metadata item to metadata collection's hash
    292         if(!psHashAdd( mdTable, key, metadataItem )) {
    293             psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     282    } else
     283        if(value != NULL) {
     284
     285            // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     286            // it will wipe out existing node.
     287            psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    294288                     metadataItem->name );
    295289            return false;
    296         }
    297     }
     290        } else {
     291
     292            // Duplicate key not found. Add new metadata item to metadata collection's hash
     293            if(!psHashAdd( mdTable, key, metadataItem )) {
     294                psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     295                         metadataItem->name );
     296                return false;
     297            }
     298        }
    298299
    299300    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    612613        psError( __func__, "Null extName and extNum = 0 not allowed" );
    613614        return NULL;
    614     } else if(extName && extNum) {
    615         psError( __func__, "Both extName and extNum arguments should not have non zero values." );
    616         return NULL;
    617     }
     615    } else
     616        if(extName && extNum) {
     617            psError( __func__, "Both extName and extNum arguments should not have non zero values." );
     618            return NULL;
     619        }
    618620
    619621    // Allocate metadata if user didn't
  • trunk/psLib/src/astronomy/psTime.c

    r1393 r1406  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-05 19:38:51 $
     14 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/astronomy/psTime.h

    r1393 r1406  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-05 19:38:51 $
     14 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psArray.c

    r1385 r1406  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psBitSet.c

    r1385 r1406  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psList.c

    r1385 r1406  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-08-04 23:37:39 $
     8 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:05 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psMetadata.c

    r1398 r1406  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-05 23:39:23 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-06 22:34:05 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    280280            return false;
    281281        }
    282     } else if(value != NULL) {
    283 
    284         // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    285         // it will wipe out existing node.
    286         psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    287                  metadataItem->name );
    288         return false;
    289     } else {
    290 
    291         // Duplicate key not found. Add new metadata item to metadata collection's hash
    292         if(!psHashAdd( mdTable, key, metadataItem )) {
    293             psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     282    } else
     283        if(value != NULL) {
     284
     285            // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     286            // it will wipe out existing node.
     287            psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    294288                     metadataItem->name );
    295289            return false;
    296         }
    297     }
     290        } else {
     291
     292            // Duplicate key not found. Add new metadata item to metadata collection's hash
     293            if(!psHashAdd( mdTable, key, metadataItem )) {
     294                psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     295                         metadataItem->name );
     296                return false;
     297            }
     298        }
    298299
    299300    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    612613        psError( __func__, "Null extName and extNum = 0 not allowed" );
    613614        return NULL;
    614     } else if(extName && extNum) {
    615         psError( __func__, "Both extName and extNum arguments should not have non zero values." );
    616         return NULL;
    617     }
     615    } else
     616        if(extName && extNum) {
     617            psError( __func__, "Both extName and extNum arguments should not have non zero values." );
     618            return NULL;
     619        }
    618620
    619621    // Allocate metadata if user didn't
  • trunk/psLib/src/collections/psScalar.c

    r1385 r1406  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psScalar.h

    r1385 r1406  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psVector.c

    r1404 r1406  
    88*  @author Ross Harman, MHPCC
    99*
    10 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-06 21:50:13 $
     10*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/collections/psVector.h

    r1385 r1406  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psFFT.c

    r1404 r1406  
    55*  @author Robert DeSonia, MHPCC
    66*
    7 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2004-08-06 21:50:13 $
     7*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2004-08-06 22:34:05 $
    99*
    1010*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psFFT.h

    r1385 r1406  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psFunctions.c

    r1385 r1406  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psFunctions.h

    r1385 r1406  
    1212*  @author George Gusciora, MHPCC
    1313*
    14 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-04 23:37:39 $
     14*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-06 22:34:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psMatrix.c

    r1385 r1406  
    2020 *  @author Ross Harman, MHPCC
    2121 *   
    22  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-08-04 23:37:39 $
     22 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2004-08-06 22:34:05 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c

    r1385 r1406  
    2929 *  @author Ross Harman, MHPCC
    3030 *
    31  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    32  *  @date $Date: 2004-08-04 23:37:39 $
     31 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     32 *  @date $Date: 2004-08-06 22:34:05 $
    3333 *
    3434 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psMinimize.c

    r1385 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psStats.c

    r1393 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-05 19:38:52 $
     11 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psStats.h

    r1385 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psVectorFFT.c

    r1404 r1406  
    55*  @author Robert DeSonia, MHPCC
    66*
    7 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2004-08-06 21:50:13 $
     7*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2004-08-06 22:34:05 $
    99*
    1010*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/dataManip/psVectorFFT.h

    r1385 r1406  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/fft/psVectorFFT.c

    r1404 r1406  
    55*  @author Robert DeSonia, MHPCC
    66*
    7 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2004-08-06 21:50:13 $
     7*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2004-08-06 22:34:05 $
    99*
    1010*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/fft/psVectorFFT.h

    r1385 r1406  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/image/psImage.c

    r1385 r1406  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/image/psImage.h

    r1385 r1406  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/image/psImageExtraction.c

    r1404 r1406  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-06 21:50:13 $
     11*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-06 22:34:05 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    334334        if ( delta < 0 ) {
    335335            outData += numCols - 1;
     336            if (outPosition != NULL) {
     337                outPosition += numCols - 1;
     338            }
    336339        }
    337340
     
    362365                *outData = statVal; \
    363366                if (outPosition != NULL) { \
    364                     *(outPosition++) = col+c; \
     367                    *outPosition = col+c; \
     368                    outPosition += delta; \
    365369                } \
    366370                outData += delta; \
     
    416420            if ( delta < 0 ) {
    417421                outData += numRows - 1;
     422                if (outPosition != NULL) {
     423                    outPosition += numRows - 1;
     424                }
    418425            }
    419426
     
    428435                *outData = statVal;
    429436                if (outPosition != NULL) {
    430                     *(outPosition++) = row+r;
     437                    *outPosition = row+r;
     438                    outPosition += delta;
     439                    \
    431440                }
    432441                outData += delta;
  • trunk/psLib/src/image/psImageIO.c

    r1385 r1406  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/image/psImageManip.c

    r1385 r1406  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/image/psImageStats.c

    r1393 r1406  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-05 19:38:52 $
     11*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-06 22:34:05 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/imageops/psImageStats.c

    r1393 r1406  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-05 19:38:52 $
     11*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-06 22:34:05 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psMatrix.c

    r1385 r1406  
    2020 *  @author Ross Harman, MHPCC
    2121 *   
    22  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-08-04 23:37:39 $
     22 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2004-08-06 22:34:05 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psMinimize.c

    r1385 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psPolynomial.c

    r1385 r1406  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psPolynomial.h

    r1385 r1406  
    1212*  @author George Gusciora, MHPCC
    1313*
    14 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-04 23:37:39 $
     14*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-06 22:34:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psSpline.c

    r1385 r1406  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-04 23:37:39 $
     9 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-06 22:34:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psSpline.h

    r1385 r1406  
    1212*  @author George Gusciora, MHPCC
    1313*
    14 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-04 23:37:39 $
     14*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-06 22:34:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psStats.c

    r1393 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-05 19:38:52 $
     11 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/math/psStats.h

    r1385 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psImage.c

    r1385 r1406  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psImage.h

    r1385 r1406  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psScalar.c

    r1385 r1406  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psScalar.h

    r1385 r1406  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psVector.c

    r1404 r1406  
    88*  @author Ross Harman, MHPCC
    99*
    10 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-06 21:50:13 $
     10*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/mathtypes/psVector.h

    r1385 r1406  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psAbort.c

    r1385 r1406  
    99 *  @author Eric Van Alst, MHPCC
    1010 *   
    11  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psError.c

    r1385 r1406  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *   
    12  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psLogMsg.c

    r1393 r1406  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-05 19:38:52 $
     13 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psLogMsg.h

    r1385 r1406  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psMemory.c

    r1385 r1406  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-04 23:37:39 $
     10*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psMemory.h

    r1385 r1406  
    1414 *  @ingroup MemoryManagement
    1515 *
    16  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2004-08-04 23:37:39 $
     16 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2004-08-06 22:34:05 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psString.c

    r1385 r1406  
    88 *  @author Eric Van Alst, MHPCC
    99 *   
    10  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sys/psTrace.c

    r1393 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-05 19:38:52 $
     11 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psAbort.c

    r1385 r1406  
    99 *  @author Eric Van Alst, MHPCC
    1010 *   
    11  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-04 23:37:39 $
     11 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psError.c

    r1385 r1406  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *   
    12  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psHash.c

    r1385 r1406  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-04 23:37:39 $
     12*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-06 22:34:05 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psHash.h

    r1385 r1406  
    1010 *  @author George Gusciora, MHPCC
    1111 *   
    12  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r1393 r1406  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-05 19:38:52 $
     13 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psLogMsg.h

    r1385 r1406  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-04 23:37:39 $
     13 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psMemory.c

    r1385 r1406  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-04 23:37:39 $
     10*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-06 22:34:05 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psMemory.h

    r1385 r1406  
    1414 *  @ingroup MemoryManagement
    1515 *
    16  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2004-08-04 23:37:39 $
     16 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2004-08-06 22:34:05 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psString.c

    r1385 r1406  
    88 *  @author Eric Van Alst, MHPCC
    99 *   
    10  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/sysUtils/psTrace.c

    r1393 r1406  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-05 19:38:52 $
     11 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/types/psArray.c

    r1385 r1406  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-04 23:37:39 $
     10 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-08-06 22:34:05 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/types/psBitSet.c

    r1385 r1406  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-04 23:37:39 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/types/psList.c

    r1385 r1406  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-08-04 23:37:39 $
     8 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:05 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/types/psMetadata.c

    r1398 r1406  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-05 23:39:23 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-06 22:34:05 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    280280            return false;
    281281        }
    282     } else if(value != NULL) {
    283 
    284         // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    285         // it will wipe out existing node.
    286         psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    287                  metadataItem->name );
    288         return false;
    289     } else {
    290 
    291         // Duplicate key not found. Add new metadata item to metadata collection's hash
    292         if(!psHashAdd( mdTable, key, metadataItem )) {
    293             psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     282    } else
     283        if(value != NULL) {
     284
     285            // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     286            // it will wipe out existing node.
     287            psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
    294288                     metadataItem->name );
    295289            return false;
    296         }
    297     }
     290        } else {
     291
     292            // Duplicate key not found. Add new metadata item to metadata collection's hash
     293            if(!psHashAdd( mdTable, key, metadataItem )) {
     294                psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
     295                         metadataItem->name );
     296                return false;
     297            }
     298        }
    298299
    299300    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    612613        psError( __func__, "Null extName and extNum = 0 not allowed" );
    613614        return NULL;
    614     } else if(extName && extNum) {
    615         psError( __func__, "Both extName and extNum arguments should not have non zero values." );
    616         return NULL;
    617     }
     615    } else
     616        if(extName && extNum) {
     617            psError( __func__, "Both extName and extNum arguments should not have non zero values." );
     618            return NULL;
     619        }
    618620
    619621    // Allocate metadata if user didn't
  • trunk/psLib/test/astronomy/tst_psMetadata_01.c

    r1402 r1406  
    1515*  @author  Ross Harman, MHPCC
    1616*
    17 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    18 *  @date  $Date: 2004-08-06 20:32:58 $
     17*  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     18*  @date  $Date: 2004-08-06 22:34:05 $
    1919*
    2020*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/astronomy/tst_psMetadata_02.c

    r1401 r1406  
    1515*  @author  Ross Harman, MHPCC
    1616*
    17 *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    18 *  @date  $Date: 2004-08-06 20:32:44 $
     17*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     18*  @date  $Date: 2004-08-06 22:34:05 $
    1919*
    2020*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/astronomy/tst_psTime_01.c

    r1258 r1406  
    2121 *  @author  Ross Harman, MHPCC
    2222 *
    23  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    24  *  @date  $Date: 2004-07-22 19:45:58 $
     23 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     24 *  @date  $Date: 2004-08-06 22:34:05 $
    2525 *
    2626 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/astronomy/tst_psTime_02.c

    r1273 r1406  
    1313 *  @author  Ross Harman, MHPCC
    1414 *
    15  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-07-22 21:26:59 $
     15 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-08-06 22:34:05 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psArray.c

    r1227 r1406  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-07-15 22:17:03 $
     14 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_01.c

    r1175 r1406  
    1717 *  @author  Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2004-07-01 21:56:15 $
     19 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2004-08-06 22:34:05 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_02.c

    r1179 r1406  
    1111 *  @author  Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
    14  *  @date  $Date: 2004-07-01 23:09:53 $
     13 *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
     14 *  @date  $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_03.c

    r1175 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-01 21:56:15 $
     12 *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_04.c

    r1175 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-01 21:56:15 $
     12 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_05.c

    r1175 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-01 21:56:15 $
     12 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_06.c

    r1175 r1406  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-07-01 21:56:15 $
     14 *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_07.c

    r1170 r1406  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-07-01 18:57:30 $
     14 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psBitSet_08.c

    r1173 r1406  
    1111 *  @author  Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    14  *  @date  $Date: 2004-07-01 21:46:14 $
     13 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     14 *  @date  $Date: 2004-08-06 22:34:05 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psList.c

    r1227 r1406  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-15 22:17:03 $
     8 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:05 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828
    2929testDescription tests[] = {
    30                               {testListAlloc,487,"psListAlloc",0,false},
    31                               {testListAdd,488,"psListAdd",0,false},
    32                               {testListGet,489,"psListGet",0,false},
    33                               {testListRemove,490,"psListRemove",0,false},
    34                               {testListConvert,491,"psListConvert",0,false},
    35                               {testListIterator,494,"psListIterator",0,false},
    36                               {testListFree,627,"psListFree",0,false},
    37                               {testListSort,624,"psListSort",0,false},
    38                               {NULL}
     30                              {
     31                                  testListAlloc,487,"psListAlloc",0,false
     32                              },
     33                              {
     34                                  testListAdd,488,"psListAdd",0,false
     35                              },
     36                              {
     37                                  testListGet,489,"psListGet",0,false
     38                              },
     39                              {
     40                                  testListRemove,490,"psListRemove",0,false
     41                              },
     42                              {
     43                                  testListConvert,491,"psListConvert",0,false
     44                              },
     45                              {
     46                                  testListIterator,494,"psListIterator",0,false
     47                              },
     48                              {
     49                                  testListFree,627,"psListFree",0,false
     50                              },
     51                              {
     52                                  testListSort,624,"psListSort",0,false
     53                              },
     54                              {
     55                                  NULL
     56                              }
    3957                          };
    4058
  • trunk/psLib/test/collections/tst_psMetadata_01.c

    r1402 r1406  
    1515*  @author  Ross Harman, MHPCC
    1616*
    17 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    18 *  @date  $Date: 2004-08-06 20:32:58 $
     17*  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     18*  @date  $Date: 2004-08-06 22:34:05 $
    1919*
    2020*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psMetadata_02.c

    r1401 r1406  
    1515*  @author  Ross Harman, MHPCC
    1616*
    17 *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    18 *  @date  $Date: 2004-08-06 20:32:44 $
     17*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     18*  @date  $Date: 2004-08-06 22:34:05 $
    1919*
    2020*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psVector.c

    r1291 r1406  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2004-07-23 20:20:33 $
     16 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2004-08-06 22:34:05 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psVectorSort_01.c

    r1233 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-15 23:52:34 $
     12 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psVectorSort_02.c

    r1304 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-28 00:05:19 $
     12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:05 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psVectorSort_03.c

    r1303 r1406  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-07-27 23:28:56 $
     14 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-08-06 22:34:05 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/collections/tst_psVectorSort_04.c

    r1300 r1406  
    99 *  @author  Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    12  *  @date  $Date: 2004-07-27 22:48:19 $
     11 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     12 *  @date  $Date: 2004-08-06 22:34:05 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/dataManip/tst_psHist02.c

    r1365 r1406  
    22   This routine must ensure that the psHistogram structure is correctly
    33   populated by the procedure psGetArrayHistogram().
    4 
     4 
    55*****************************************************************************/
    66#include <stdio.h>
     
    2626    int i = 0;
    2727    int currentId = 0;
    28    
     28
    2929    currentId = psMemGetId();
    30    
     30
    3131    /*********************************************************************/
    3232    /*  Allocate and initialize data structures                          */
     
    3535    myData->n = myData->nalloc;
    3636    for ( i = 0;i < NUM_DATA;i++ ) {
    37             myData->data.F32[ i ] = LOWER + ( ( UPPER - LOWER ) / ( float ) NUM_DATA ) * ( float ) i;
    38         }
    39        
     37        myData->data.F32[ i ] = LOWER + ( ( UPPER - LOWER ) / ( float ) NUM_DATA ) * ( float ) i;
     38    }
     39
    4040    myMask = psVectorAlloc( NUM_DATA, PS_TYPE_U8 );
    4141    myMask->n = myMask->nalloc;
    4242    for ( i = 0;i < NUM_DATA;i++ ) {
    43             if ( i >= ( NUM_DATA / 2 ) ) {
    44                     myMask->data.U8[ i ] = 1;
    45                 } else {
    46                     myMask->data.U8[ i ] = 0;
    47                 }
     43        if ( i >= ( NUM_DATA / 2 ) ) {
     44            myMask->data.U8[ i ] = 1;
     45        } else {
     46            myMask->data.U8[ i ] = 0;
    4847        }
    49        
     48    }
     49
    5050    for ( nb = 0;nb < 4;nb++ ) {
    51             if ( nb == 0 )
    52                 numBins = 1;
    53             if ( nb == 1 )
    54                 numBins = 2;
    55             if ( nb == 2 )
    56                 numBins = 10;
    57             if ( nb == 3 )
    58                 numBins = 20;
    59                
    60             /*********************************************************************/
    61             /*  Allocate and Perform Histogram, no mask                          */
    62             /*********************************************************************/
    63             printPositiveTestHeader( stdout,
    64                                      "psStats functions",
    65                                      "Allocate and Perform Histogram, no mask" );
    66                                      
    67             myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    68             myHist = psVectorHistogram( myHist, myData, NULL, 0 );
    69            
    70             for ( i = 0;i < numBins;i++ ) {
    71                     printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i,
    72                             myHist->bounds->data.F32[ i ],
    73                             myHist->bounds->data.F32[ i + 1 ],
    74                             myHist->nums->data.U32[ i ] );
    75                 }
    76             psMemCheckCorruption( 1 );
    77             psFree( myHist );
    78             psMemCheckCorruption( 1 );
    79            
    80             printFooter( stdout,
    81                          "psStats functions",
    82                          "Allocate and Perform Histogram, no mask",
    83                          testStatus );
    84                          
    85             /*********************************************************************/
    86             /*  Allocate and Perform Histogram with mask                         */
    87             /*********************************************************************/
    88             printPositiveTestHeader( stdout,
    89                                      "psStats functions",
    90                                      "Allocate and Perform Histogram with mask" );
    91                                      
    92             myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    93             myHist = psVectorHistogram( myHist, myData, myMask, 1 );
    94            
    95             for ( i = 0;i < numBins;i++ ) {
    96                     printf( "Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i,
    97                             myHist->bounds->data.F32[ i ],
    98                             myHist->bounds->data.F32[ i + 1 ],
    99                             myHist->nums->data.U32[ i ] );
    100                 }
    101             psMemCheckCorruption( 1 );
    102             psFree( myHist );
    103             psMemCheckCorruption( 1 );
    104            
    105             printFooter( stdout,
    106                          "psStats functions",
    107                          "Allocate and Perform Histogram with mask",
    108                          testStatus );
     51        if ( nb == 0 )
     52            numBins = 1;
     53        if ( nb == 1 )
     54            numBins = 2;
     55        if ( nb == 2 )
     56            numBins = 10;
     57        if ( nb == 3 )
     58            numBins = 20;
     59
     60        /*********************************************************************/
     61        /*  Allocate and Perform Histogram, no mask                          */
     62        /*********************************************************************/
     63        printPositiveTestHeader( stdout,
     64                                 "psStats functions",
     65                                 "Allocate and Perform Histogram, no mask" );
     66
     67        myHist = psHistogramAlloc( LOWER, UPPER, numBins );
     68        myHist = psVectorHistogram( myHist, myData, NULL, 0 );
     69
     70        for ( i = 0;i < numBins;i++ ) {
     71            printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i,
     72                    myHist->bounds->data.F32[ i ],
     73                    myHist->bounds->data.F32[ i + 1 ],
     74                    myHist->nums->data.U32[ i ] );
    10975        }
     76        psMemCheckCorruption( 1 );
     77        psFree( myHist );
     78        psMemCheckCorruption( 1 );
     79
     80        printFooter( stdout,
     81                     "psStats functions",
     82                     "Allocate and Perform Histogram, no mask",
     83                     testStatus );
     84
     85        /*********************************************************************/
     86        /*  Allocate and Perform Histogram with mask                         */
     87        /*********************************************************************/
     88        printPositiveTestHeader( stdout,
     89                                 "psStats functions",
     90                                 "Allocate and Perform Histogram with mask" );
     91
     92        myHist = psHistogramAlloc( LOWER, UPPER, numBins );
     93        myHist = psVectorHistogram( myHist, myData, myMask, 1 );
     94
     95        for ( i = 0;i < numBins;i++ ) {
     96            printf( "Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i,
     97                    myHist->bounds->data.F32[ i ],
     98                    myHist->bounds->data.F32[ i + 1 ],
     99                    myHist->nums->data.U32[ i ] );
     100        }
     101        psMemCheckCorruption( 1 );
     102        psFree( myHist );
     103        psMemCheckCorruption( 1 );
     104
     105        printFooter( stdout,
     106                     "psStats functions",
     107                     "Allocate and Perform Histogram with mask",
     108                     testStatus );
     109    }
    110110    psFree( myMask );
    111    
     111
    112112    printPositiveTestHeader( stdout,
    113113                             "psStats functions",
    114114                             "Calling psVectorHistogram() with various NULL inputs." );
    115                              
     115
    116116    // Verify the return value is null and program execution doesn't stop,
    117117    // if input parameter myHist is null.
    118    
     118
    119119    myHist2 = psVectorHistogram( NULL, myData, NULL, 0 );
    120120    if ( myHist2 != NULL ) {
    121             printf( "ERROR: myHist2!=NULL\n" );
    122             testStatus = false;
    123         }
     121        printf( "ERROR: myHist2!=NULL\n" );
     122        testStatus = false;
     123    }
    124124    psFree( myData );
    125    
    126    
     125
     126
    127127    // Verify the retrun value is the same as the input parameter myHist and
    128128    // program execution doesn't stop, if the input parameter myArray is
    129129    // null.
    130    
     130
    131131    myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    132132    myHist = psVectorHistogram( myHist, NULL, NULL, 0 );
    133133    if ( myHist == NULL ) {
    134             printf( "ERROR: myHist==NULL\n" );
    135             testStatus = false;
    136         }
     134        printf( "ERROR: myHist==NULL\n" );
     135        testStatus = false;
     136    }
    137137    psFree( myHist );
    138    
    139    
     138
     139
    140140    // Verify the return value is the same as the input parameter myHist and
    141141    // program execution doesn't stop, if the input parameter myArray has no
     
    159159                 "Calling psVectorHistogram() with various NULL inputs.",
    160160                 testStatus );
    161                  
     161
    162162    /*************************************************************************/
    163163    /*  Deallocate data structures                                   */
     
    166166                             "psStats functions",
    167167                             "Deallocate the psHistogram structure." );
    168                              
     168
    169169    psMemCheckCorruption( 1 );
    170170    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    171171    if ( 0 != memLeaks ) {
    172             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    173         }
     172        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     173    }
    174174    psMemCheckCorruption( 1 );
    175    
     175
    176176    printFooter( stdout,
    177177                 "psStats functions",
    178178                 "Deallocate the psHistogram structure.",
    179179                 testStatus );
    180                  
     180
    181181    return ( !testStatus );
    182182}
  • trunk/psLib/test/dataManip/tst_psMatrix01.c

    r1346 r1406  
    1111*  @author  Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    14 *  @date  $Date: 2004-07-30 02:55:47 $
     13*  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     14*  @date  $Date: 2004-08-06 22:34:06 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#define PRINT_MATRIX(IMAGE)                         \
    2424for(int i=IMAGE->numRows-1; i>-1; i--) {        \
    25         for(int j=0; j<IMAGE->numCols; j++) {       \
    26                 printf("%f ", IMAGE->data.F64[i][j]);   \
    27             }                                          \
    28         printf("\n");                              \
    29     }
    30    
     25    for(int j=0; j<IMAGE->numCols; j++) {       \
     26        printf("%f ", IMAGE->data.F64[i][j]);   \
     27    }                                          \
     28    printf("\n");                              \
     29}
     30
    3131int main( int argc,
    3232          char* argv[] )
    3333{
    3434    psImage * tempImage = NULL;
    35    
    36    
     35
     36
    3737    // Test A - Create input and output images
    3838    printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" );
     
    5050    PRINT_MATRIX( inImage );
    5151    printFooter( stdout, "psMatrix", "Create input and output images", true );
    52    
    53    
     52
     53
    5454    // Test B - Transpose input image into output image
    5555    printPositiveTestHeader( stdout, "psMatrix", "Transpose input image into output image" );
     
    5858    PRINT_MATRIX( outImage );
    5959    if ( outImage->type.dimen != PS_DIMEN_IMAGE ) {
    60             printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" );
    61         } else if ( outImage != tempImage ) {
     60        printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" );
     61    } else
     62        if ( outImage != tempImage ) {
    6263            printf( "Error: Return pointer not equal to output argument pointer\n" );
    6364        }
    6465    printFooter( stdout, "psMatrix", "Transpose input image into output image", true );
    65    
    66    
     66
     67
    6768    // Test C -  Transpose input image into auto allocated NULL output image
    6869    printPositiveTestHeader( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image" );
     
    7172    PRINT_MATRIX( outImageNull );
    7273    printFooter( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image", true );
    73    
    74    
     74
     75
    7576    // Test D - Free images and check for leaks
    7677    printPositiveTestHeader( stdout, "psMatrix", "Free images and check for leaks" );
     
    8081    int nLeaks = psMemCheckLeaks( 0, NULL, stdout );
    8182    if ( nLeaks != 0 ) {
    82             printf( "ERROR: Found %d memory leaks\n", nLeaks );
    83         }
     83        printf( "ERROR: Found %d memory leaks\n", nLeaks );
     84    }
    8485    int nBad = psMemCheckCorruption( 0 );
    8586    if ( nBad ) {
    86             printf( "ERROR: Found %d bad memory blocks\n", nBad );
    87         }
     87        printf( "ERROR: Found %d bad memory blocks\n", nBad );
     88    }
    8889    printFooter( stdout, "psMatrix" , "Free images and check for leaks", true );
    89    
     90
    9091    return 0;
    9192}
  • trunk/psLib/test/dataManip/tst_psMatrix02.c

    r798 r1406  
    1313 *  @author  Ross Harman, MHPCC
    1414 *
    15  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-05-28 02:52:23 $
     15 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-08-06 22:34:06 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/dataManip/tst_psMatrix03.c

    r1181 r1406  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2004-07-01 23:29:34 $
     16 *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2004-08-06 22:34:06 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8383    if(luImage->type.dimen != PS_DIMEN_IMAGE) {
    8484        printf("Error: Resulting image is not PS_DIMEN_IMAGE\n");
    85     } else if(luImage != tempImage) {
    86         printf("Error: Return pointer not equal to output argument pointer\n");
    87     }
     85    } else
     86        if(luImage != tempImage) {
     87            printf("Error: Return pointer not equal to output argument pointer\n");
     88        }
    8889    printFooter(stdout, "psMatrix", "Calculate LU matrix", true);
    8990
     
    9697    if(outVector->type.dimen != PS_DIMEN_VECTOR) {
    9798        printf("Error: Resulting image is not PS_DIMEN_VECTOR\n");
    98     } else if(outVector != tempVector) {
    99         printf("Error: Return pointer not equal to output argument pointer\n");
    100     }
     99    } else
     100        if(outVector != tempVector) {
     101            printf("Error: Return pointer not equal to output argument pointer\n");
     102        }
    101103    printFooter(stdout, "psMatrix", "Determine solution to matrix equation", true);
    102104
  • trunk/psLib/test/dataManip/tst_psMatrix04.c

    r1073 r1406  
    1313 *  @author  Ross Harman, MHPCC
    1414 *
    15  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-06-23 23:00:17 $
     15 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-08-06 22:34:06 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6767    if(outImage->type.dimen != PS_DIMEN_IMAGE) {
    6868        printf("Error: Resulting image is not PS_DIMEN_IMAGE\n");
    69     } else if(outImage != tempImage) {
    70         printf("Error: Return pointer not equal to output argument pointer\n");
    71     }
     69    } else
     70        if(outImage != tempImage) {
     71            printf("Error: Return pointer not equal to output argument pointer\n");
     72        }
    7273    printFooter(stdout, "psMatrix", "Invert matrix and calculate determinant", true);
    7374
  • trunk/psLib/test/dataManip/tst_psMatrix05.c

    r1347 r1406  
    1010*  @author  Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    13 *  @date  $Date: 2004-07-30 03:13:08 $
     12*  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     13*  @date  $Date: 2004-08-06 22:34:06 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222#define PRINT_MATRIX(IMAGE)                         \
    2323for(int i=0; i<IMAGE->numRows; i++) {           \
    24         for(int j=0; j<IMAGE->numCols; j++) {       \
    25                 printf("%f ", IMAGE->data.F64[i][j]);   \
    26             }                                          \
    27         printf("\n");                              \
    28     }
    29    
    30    
     24    for(int j=0; j<IMAGE->numCols; j++) {       \
     25        printf("%f ", IMAGE->data.F64[i][j]);   \
     26    }                                          \
     27    printf("\n");                              \
     28}
     29
     30
    3131int main( int argc,
    3232          char* argv[] )
     
    3535    psImage *inImage1 = NULL;
    3636    psImage *inImage2 = NULL;
    37    
    38    
     37
     38
    3939    // Test A - Create input and output images
    4040    printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" );
     
    5454    PRINT_MATRIX( inImage2 );
    5555    printFooter( stdout, "psMatrix", "Create input and output images", true );
    56    
    57    
     56
     57
    5858    // Test B - Multiply images
    5959    printPositiveTestHeader( stdout, "psMatrix", "Multiply images" );
     
    6161    PRINT_MATRIX( outImage );
    6262    printFooter( stdout, "psMatrix", "Multiply images", true );
    63    
    64    
     63
     64
    6565    // Test C - Free input and output images
    6666    printPositiveTestHeader( stdout, "psMatrix", "Free input and output images" );
     
    7070    int nLeaks = psMemCheckLeaks( 0, NULL, stdout );
    7171    if ( nLeaks != 0 ) {
    72             printf( "ERROR: Found %d memory leaks\n", nLeaks );
    73         }
     72        printf( "ERROR: Found %d memory leaks\n", nLeaks );
     73    }
    7474    int nBad = psMemCheckCorruption( 0 );
    7575    if ( nBad ) {
    76             printf( "ERROR: Found %d bad memory blocks\n", nBad );
    77         }
     76        printf( "ERROR: Found %d bad memory blocks\n", nBad );
     77    }
    7878    printFooter( stdout, "psMatrix" , "Free input and output images", true );
    79    
     79
    8080    return 0;
    8181}
  • trunk/psLib/test/dataManip/tst_psMatrix06.c

    r1348 r1406  
    1010*  @author  Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    13 *  @date  $Date: 2004-07-30 03:48:15 $
     12*  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     13*  @date  $Date: 2004-08-06 22:34:06 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222#define PRINT_MATRIX(IMAGE)                         \
    2323for(int i=0; i<IMAGE->numRows; i++) {           \
    24         for(int j=0; j<IMAGE->numCols; j++) {       \
    25                 printf("%f ", IMAGE->data.F64[i][j]);   \
    26             }                                          \
    27         printf("\n");                              \
    28     }
    29    
    30    
     24    for(int j=0; j<IMAGE->numCols; j++) {       \
     25        printf("%f ", IMAGE->data.F64[i][j]);   \
     26    }                                          \
     27    printf("\n");                              \
     28}
     29
     30
    3131int main( int argc,
    3232          char* argv[] )
     
    3434    psImage * outImage = NULL;
    3535    psImage *inImage = NULL;
    36    
    37    
     36
     37
    3838    // Test A - Create input and output images
    3939    printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" );
    4040    outImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 );
    4141    inImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 );
    42    
     42
    4343    inImage->data.F64[ 0 ][ 0 ] = 1. / 1.;
    4444    inImage->data.F64[ 0 ][ 1 ] = 1. / 2.;
    4545    inImage->data.F64[ 0 ][ 2 ] = 1. / 3.;
    4646    inImage->data.F64[ 0 ][ 3 ] = 1. / 4.;
    47    
     47
    4848    inImage->data.F64[ 1 ][ 0 ] = 1. / 2.;
    4949    inImage->data.F64[ 1 ][ 1 ] = 1. / 3.;
    5050    inImage->data.F64[ 1 ][ 2 ] = 1. / 4.;
    5151    inImage->data.F64[ 1 ][ 3 ] = 1. / 5.;
    52    
     52
    5353    inImage->data.F64[ 2 ][ 0 ] = 1. / 3.;
    5454    inImage->data.F64[ 2 ][ 1 ] = 1. / 4.;
    5555    inImage->data.F64[ 2 ][ 2 ] = 1. / 5.;
    5656    inImage->data.F64[ 2 ][ 3 ] = 1. / 6.;
    57    
     57
    5858    inImage->data.F64[ 3 ][ 0 ] = 1. / 4.;
    5959    inImage->data.F64[ 3 ][ 1 ] = 1. / 5.;
    6060    inImage->data.F64[ 3 ][ 2 ] = 1. / 6.;
    6161    inImage->data.F64[ 3 ][ 3 ] = 1. / 7.;
    62    
     62
    6363    PRINT_MATRIX( inImage );
    6464    printFooter( stdout, "psMatrix", "Create input and output images", true );
    65    
    66    
     65
     66
    6767    // Test B - Calculate Eigenvectors
    6868    printPositiveTestHeader( stdout, "psMatrix", "Calculate Eigenvectors" );
     
    7070    PRINT_MATRIX( outImage );
    7171    printFooter( stdout, "psMatrix", "Calculate Eigenvectors", true );
    72    
    73    
     72
     73
    7474    // Test C - Free input and output images
    7575    printPositiveTestHeader( stdout, "psMatrix", "Free input and output images" );
     
    7878    int nLeaks = psMemCheckLeaks( 0, NULL, stdout );
    7979    if ( nLeaks != 0 ) {
    80             printf( "ERROR: Found %d memory leaks\n", nLeaks );
    81         }
     80        printf( "ERROR: Found %d memory leaks\n", nLeaks );
     81    }
    8282    int nBad = psMemCheckCorruption( 0 );
    8383    if ( nBad ) {
    84             printf( "ERROR: Found %d bad memory blocks\n", nBad );
    85         }
     84        printf( "ERROR: Found %d bad memory blocks\n", nBad );
     85    }
    8686    printFooter( stdout, "psMatrix" , "Free input and output images", true );
    87    
     87
    8888    return 0;
    8989}
  • trunk/psLib/test/dataManip/tst_psMatrix07.c

    r1073 r1406  
    1616 *  @author  Ross Harman, MHPCC
    1717 *
    18  *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    19  *  @date  $Date: 2004-06-23 23:00:17 $
     18 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     19 *  @date  $Date: 2004-08-06 22:34:06 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8888    if(v1->type.dimen != PS_DIMEN_VECTOR) {
    8989        printf("Error: Resulting image is not PS_DIMEN_VECTOR\n");
    90     } else if(v1 != tempVector) {
    91         printf("Error: Return pointer not equal to output argument pointer\n");
    92     }
     90    } else
     91        if(v1 != tempVector) {
     92            printf("Error: Return pointer not equal to output argument pointer\n");
     93        }
    9394    printFooter(stdout, "psMatrix", "Convert matrix to PS_DIMEN_VECTOR vector", true);
    9495
     
    108109    if(v1->type.dimen != PS_DIMEN_TRANSV) {
    109110        printf("Error: Resulting image is not PS_DIMEN_TRANSV\n");
    110     } else if(v1 != tempVector) {
    111         printf("Error: Return pointer not equal to output argument pointer\n");
    112     }
     111    } else
     112        if(v1 != tempVector) {
     113            printf("Error: Return pointer not equal to output argument pointer\n");
     114        }
    113115    printFooter(stdout, "psMatrix", "Convert matrix to PS_DIMEN_TRANSV vector", true);
    114116
     
    128130    if(m2->type.dimen != PS_DIMEN_IMAGE) {
    129131        printf("Error: Resulting image is not PS_DIMEN_IMAGE\n");
    130     } else if(m2 != tempImage) {
    131         printf("Error: Return pointer not equal to output argument pointer\n");
    132     }
     132    } else
     133        if(m2 != tempImage) {
     134            printf("Error: Return pointer not equal to output argument pointer\n");
     135        }
    133136    printFooter(stdout, "psMatrix", "Convert PS_DIMEN_VECTOR vector to matrix", true);
    134137
     
    149152    if(m3->type.dimen != PS_DIMEN_IMAGE) {
    150153        printf("Error: Resulting image is not PS_DIMEN_IMAGE\n");
    151     } else if(m3 != tempImage) {
    152         printf("Error: Return pointer not equal to output argument pointer\n");
    153     }
     154    } else
     155        if(m3 != tempImage) {
     156            printf("Error: Return pointer not equal to output argument pointer\n");
     157        }
    154158    printFooter(stdout, "psMatrix", "Convert PS_DIMEN_TRANSV vector to matrix", true);
    155159
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic01.c

    r1114 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-06-29 01:52:19 $
     12 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:06 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c

    r1365 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-08-02 19:43:23 $
     12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:06 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#define PRINT_SCALAR(SCALAR,TYPE)                                                                            \
    2626if(PS_IS_PSELEMTYPE_COMPLEX(SCALAR->type.type)) {                                                            \
    27         printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE));                                   \
    28     } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) {                                                         \
    29         printf("%d", (int)SCALAR->data.TYPE);                                                                    \
    30     } else {                                                                                                     \
    31         printf("%.2f", (double)SCALAR->data.TYPE);                                                                 \
    32     }                                                                                                            \
     27    printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE));                                   \
     28} else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) {                                                         \
     29    printf("%d", (int)SCALAR->data.TYPE);                                                                    \
     30} else {                                                                                                     \
     31    printf("%.2f", (double)SCALAR->data.TYPE);                                                                 \
     32}                                                                                                            \
    3333printf("\n\n");
    3434
     
    3636#define PRINT_VECTOR(VECTOR,TYPE)                                                                            \
    3737for(int i=0; i<VECTOR->n; i++) {                                                                             \
    38         if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                        \
    39                 printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                        \
    40             } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) {                                                     \
    41                 printf("%d\n", (int)VECTOR->data.TYPE[i]);                                                           \
    42             } else {                                                                                                 \
    43                 printf("%.2f\n", (double)VECTOR->data.TYPE[i]);                                                        \
    44             }                                                                                                        \
    45     }                                                                                                            \
     38    if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                        \
     39        printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                        \
     40    } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) {                                                     \
     41        printf("%d\n", (int)VECTOR->data.TYPE[i]);                                                           \
     42    } else {                                                                                                 \
     43        printf("%.2f\n", (double)VECTOR->data.TYPE[i]);                                                        \
     44    }                                                                                                        \
     45}                                                                                                            \
    4646printf("\n");
    4747
     
    4949#define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
    5050for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
    51         for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
    52                 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
    53                         printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
    54                     } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
    55                         printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                      \
    56                     } else {                                                                                             \
    57                         printf("%.2f ", (double)IMAGE->data.TYPE[i][j]);                                                   \
    58                     }                                                                                                    \
    59             }                                                                                                        \
    60         printf("\n");                                                                                            \
    61     }                                                                                                            \
     51    for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
     52        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
     53            printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
     54        } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
     55            printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                      \
     56        } else {                                                                                             \
     57            printf("%.2f ", (double)IMAGE->data.TYPE[i][j]);                                                   \
     58        }                                                                                                    \
     59    }                                                                                                        \
     60    printf("\n");                                                                                            \
     61}                                                                                                            \
    6262printf("\n");
    6363
     
    6666psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                             \
    6767for(int i=0; i<SIZE; i++) {                                                                                  \
    68         NAME->data.TYPE[i] = VALUE;                                                                              \
    69     }                                                                                                            \
     68    NAME->data.TYPE[i] = VALUE;                                                                              \
     69}                                                                                                            \
    7070NAME->n = SIZE;
    7171
     
    7474psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
    7575for(int i=0; i<NAME->numRows; i++) {                                                                         \
    76         for(int j=0; j<NAME->numCols; j++) {                                                                     \
    77                 NAME->data.TYPE[i][j] = VALUE;                                                                       \
    78             }                                                                                                        \
    79     }
    80    
    81    
     76    for(int j=0; j<NAME->numCols; j++) {                                                                     \
     77        NAME->data.TYPE[i][j] = VALUE;                                                                       \
     78    }                                                                                                        \
     79}
     80
     81
    8282#define CHECK_MEMORY                                                                                         \
    8383psMemCheckLeaks(0, NULL, stdout);                                                                            \
    8484int nBad = psMemCheckCorruption(0);                                                                          \
    8585if(nBad) {                                                                                                   \
    86         printf("ERROR: Found %d bad memory blocks\n", nBad);                                                     \
    87     }
    88    
    89    
     86    printf("ERROR: Found %d bad memory blocks\n", nBad);                                                     \
     87}
     88
     89
    9090int main( int argc, char* argv[] )
    9191{
     
    109109        printFooter(stdout, "psMatrixVectorArithmetic", "Test matrix psUnaryOp", true);                      \
    110110    }
    111    
     111
    112112    testBinaryOpM( abs, S32, -10, 0, 3, 2 );
    113113    testBinaryOpM( abs, F32, -10.0, 0.0, 3, 2 );
     
    178178    testBinaryOpM( datan, F64, 1.0, 0.0, 3, 2 );
    179179    testBinaryOpM( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 );
    180    
    181    
     180
     181
    182182    // Test vector unary operations
    183183    #define testBinaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE)                                                        \
     
    198198        printFooter(stdout, "psMatrixVectorArithmetic", "Test vector psUnaryOp", true);                      \
    199199    }
    200    
     200
    201201    testBinaryOpV( abs, S32, -10, 0, 3 );
    202202    testBinaryOpV( abs, F32, -10.0, 0.0, 3 );
     
    267267    testBinaryOpV( datan, F64, 1.0, 0.0, 3 );
    268268    testBinaryOpV( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 );
    269    
     269
    270270    return 0;
    271271}
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c

    r1150 r1406  
    1515 *  @author  Ross Harman, MHPCC
    1616 *
    17  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2004-06-30 20:07:07 $
     17 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2004-08-06 22:34:06 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/dataManip/tst_psMinimize00.c

    r1177 r1406  
    4545        tmp = 1.0;
    4646        tmp = x;
    47     } else if (whichParamDeriv == 1) {
    48         tmp = x;
    49         tmp = x*x;
    50     } else if (whichParamDeriv == 2) {
    51         tmp = y;
    52         tmp = y*y;
    53     } else if (whichParamDeriv == 3) {
    54         tmp = x * x * y;
    55     }
     47    } else
     48        if (whichParamDeriv == 1) {
     49            tmp = x;
     50            tmp = x*x;
     51        } else
     52            if (whichParamDeriv == 2) {
     53                tmp = y;
     54                tmp = y*y;
     55            } else
     56                if (whichParamDeriv == 3) {
     57                    tmp = x * x * y;
     58                }
    5659
    5760    //    printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n",
  • trunk/psLib/test/dataManip/tst_psMinimize01.c

    r1177 r1406  
    4444    if (whichParamDeriv == 0) {
    4545        tmp = exp(-lambda * x);
    46     } else if (whichParamDeriv == 1) {
    47         tmp = -x * A * exp(-lambda * x);
    48     } else if (whichParamDeriv == 2) {
    49         tmp = 1.0;
    50     }
     46    } else
     47        if (whichParamDeriv == 1) {
     48            tmp = -x * A * exp(-lambda * x);
     49        } else
     50            if (whichParamDeriv == 2) {
     51                tmp = 1.0;
     52            }
    5153
    5254    //    printf("--------- myFuncDeriv((%.1f) %.1f %.1f %.1f, %d) is %.1f ---------\n",
  • trunk/psLib/test/dataManip/tst_psMinimize02.c

    r1185 r1406  
    4444    if (whichParamDeriv == 0) {
    4545        tmp = 20.0 * (x - P0);
    46     } else if (whichParamDeriv == 1) {
    47         tmp = 40.0 * (y - P1);
    48     }
     46    } else
     47        if (whichParamDeriv == 1) {
     48            tmp = 40.0 * (y - P1);
     49        }
    4950
    5051    //    printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f (%d)) is %.1f ---------\n",
     
    8384        tmp = 1.0;
    8485        tmp = x;
    85     } else if (whichParamDeriv == 1) {
    86         tmp = x;
    87         tmp = x*x;
    88     } else if (whichParamDeriv == 2) {
    89         tmp = y;
    90         tmp = y*y;
    91     } else if (whichParamDeriv == 3) {
    92         tmp = x * x * y;
    93     }
     86    } else
     87        if (whichParamDeriv == 1) {
     88            tmp = x;
     89            tmp = x*x;
     90        } else
     91            if (whichParamDeriv == 2) {
     92                tmp = y;
     93                tmp = y*y;
     94            } else
     95                if (whichParamDeriv == 3) {
     96                    tmp = x * x * y;
     97                }
    9498
    9599    printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n",
  • trunk/psLib/test/dataManip/tst_psMinimize03.c

    r1185 r1406  
    4444    if (whichParamDeriv == 0) {
    4545        tmp = 20.0 * (x - P0);
    46     } else if (whichParamDeriv == 1) {
    47         tmp = 40.0 * (y - P1);
    48     }
     46    } else
     47        if (whichParamDeriv == 1) {
     48            tmp = 40.0 * (y - P1);
     49        }
    4950
    5051    //    printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f (%d)) is %.1f ---------\n",
     
    8384        tmp = 1.0;
    8485        tmp = x;
    85     } else if (whichParamDeriv == 1) {
    86         tmp = x;
    87         tmp = x*x;
    88     } else if (whichParamDeriv == 2) {
    89         tmp = y;
    90         tmp = y*y;
    91     } else if (whichParamDeriv == 3) {
    92         tmp = x * x * y;
    93     }
     86    } else
     87        if (whichParamDeriv == 1) {
     88            tmp = x;
     89            tmp = x*x;
     90        } else
     91            if (whichParamDeriv == 2) {
     92                tmp = y;
     93                tmp = y*y;
     94            } else
     95                if (whichParamDeriv == 3) {
     96                    tmp = x * x * y;
     97                }
    9498
    9599    printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n",
  • trunk/psLib/test/dataManip/tst_psStats07.c

    r1365 r1406  
    4545    float realN50WithMask = ( float ) N / 4;
    4646    float realNfitWithMask = ( float ) N / 4;
    47    
    48    
     47
     48
    4949    /*************************************************************************/
    5050    /*  Allocate and initialize data structures                              */
     
    5555                            PS_STAT_ROBUST_STDEV |
    5656                            PS_STAT_ROBUST_QUARTILE );
    57                            
     57
    5858    maskVector = psVectorAlloc( N, PS_TYPE_U8 );
    5959    maskVector->n = N;
     
    6161    // Set the mask vector and calculate the expected maximum.
    6262    for ( i = 0;i < N;i++ ) {
    63             if ( i < ( N / 2 ) ) {
    64                     maskVector->data.U8[ i ] = 0;
    65                     count++;
    66                 } else {
    67                     maskVector->data.U8[ i ] = 1;
    68                 }
     63        if ( i < ( N / 2 ) ) {
     64            maskVector->data.U8[ i ] = 0;
     65            count++;
     66        } else {
     67            maskVector->data.U8[ i ] = 1;
    6968        }
     69    }
    7070    /*************************************************************************/
    7171    /*  Call psVectorStats() with no vector mask.                            */
     
    7474                             "psStats functions",
    7575                             "PS_STAT_ROBUST_STATS: robust mean: no vector mask" );
    76                              
     76
    7777    myStats = psVectorStats( myStats, myVector, NULL, 0 );
    78    
     78
    7979    printf( "The expected Mean was %.2f; the calculated Mean was %.2f\n",
    8080            realMeanNoMask, myStats->robustMean );
    81            
     81
    8282    if ( fabs( myStats->robustMean - realMeanNoMask ) < ( ERROR_TOLERANCE * realMeanNoMask ) ) {
    83             testStatus = true;
    84         } else {
    85             testStatus = false;
    86             globalTestStatus = false;
    87         }
     83        testStatus = true;
     84    } else {
     85        testStatus = false;
     86        globalTestStatus = false;
     87    }
    8888    printFooter( stdout,
    8989                 "psVector functions",
    9090                 "PS_STAT_ROBUST_STATS: robust mean: no vector mask",
    9191                 testStatus );
    92                  
    93                  
     92
     93
    9494    printPositiveTestHeader( stdout,
    9595                             "psStats functions",
    9696                             "PS_STAT_ROBUST_STATS: robust Median: no vector mask" );
    97                              
     97
    9898    printf( "The expected Median was %.2f; the calculated Median was %.2f\n",
    9999            realMedianNoMask, myStats->robustMedian );
    100100    if ( fabs( myStats->robustMedian - realMedianNoMask ) < ( ERROR_TOLERANCE * realMedianNoMask ) ) {
    101             testStatus = true;
    102         } else {
    103             testStatus = false;
    104             globalTestStatus = false;
    105         }
     101        testStatus = true;
     102    } else {
     103        testStatus = false;
     104        globalTestStatus = false;
     105    }
    106106    printFooter( stdout,
    107107                 "psVector functions",
    108108                 "PS_STAT_ROBUST_STATS: robust Median: no vector mask",
    109109                 testStatus );
    110                  
     110
    111111    printPositiveTestHeader( stdout,
    112112                             "psStats functions",
    113113                             "PS_STAT_ROBUST_STATS: robust Mode: no vector mask" );
    114                              
    115                              
     114
     115
    116116    printf( "The expected Mode was %.2f; the calculated Mode was %.2f\n",
    117117            realModeNoMask, myStats->robustMode );
    118118    if ( fabs( myStats->robustMode - realModeNoMask ) < ( ERROR_TOLERANCE * realModeNoMask ) ) {
    119             testStatus = true;
    120         } else {
    121             testStatus = false;
    122             globalTestStatus = false;
    123         }
     119        testStatus = true;
     120    } else {
     121        testStatus = false;
     122        globalTestStatus = false;
     123    }
    124124    printFooter( stdout,
    125125                 "psVector functions",
    126126                 "PS_STAT_ROBUST_STATS: robust Mode: no vector mask",
    127127                 testStatus );
    128                  
    129                  
    130                  
     128
     129
     130
    131131    printPositiveTestHeader( stdout,
    132132                             "psStats functions",
    133133                             "PS_STAT_ROBUST_STATS: robust Stdev: no vector mask" );
    134                              
     134
    135135    printf( "The expected Stdev was %.2f; the calculated Stdev was %.2f\n",
    136136            realStdevNoMask, myStats->robustStdev );
    137137    if ( fabs( myStats->robustStdev - realStdevNoMask ) < ( ERROR_TOLERANCE * realStdevNoMask ) ) {
    138             testStatus = true;
    139         } else {
    140             testStatus = false;
    141             globalTestStatus = false;
    142         }
     138        testStatus = true;
     139    } else {
     140        testStatus = false;
     141        globalTestStatus = false;
     142    }
    143143    printFooter( stdout,
    144144                 "psVector functions",
    145145                 "PS_STAT_ROBUST_STATS: robust Stdev: no vector mask",
    146146                 testStatus );
    147                  
    148                  
    149                  
     147
     148
     149
    150150    printPositiveTestHeader( stdout,
    151151                             "psStats functions",
    152152                             "PS_STAT_ROBUST_STATS: lower quartile: no vector mask" );
    153                              
     153
    154154    printf( "The expected LQ was %.2f; the calculated LQ was %.2f\n",
    155155            realLQNoMask, myStats->robustLQ );
    156            
     156
    157157    if ( fabs( myStats->robustLQ - realLQNoMask ) < ( ERROR_TOLERANCE * realLQNoMask ) ) {
    158             testStatus = true;
    159         } else {
    160             testStatus = false;
    161             globalTestStatus = false;
    162         }
     158        testStatus = true;
     159    } else {
     160        testStatus = false;
     161        globalTestStatus = false;
     162    }
    163163    printFooter( stdout,
    164164                 "psVector functions",
    165165                 "PS_STAT_ROBUST_STATS: lower quartile: no vector mask",
    166166                 testStatus );
    167                  
    168                  
    169                  
     167
     168
     169
    170170    printPositiveTestHeader( stdout,
    171171                             "psStats functions",
    172172                             "PS_STAT_ROBUST_STATS: upper quartile: no vector mask" );
    173                              
     173
    174174    printf( "The expected UQ was %.2f; the calculated UQ was %.2f\n",
    175175            realUQNoMask, myStats->robustUQ );
    176176    if ( fabs( myStats->robustUQ - realUQNoMask ) < ( ERROR_TOLERANCE * realUQNoMask ) ) {
    177             testStatus = true;
    178         } else {
    179             testStatus = false;
    180             globalTestStatus = false;
    181         }
     177        testStatus = true;
     178    } else {
     179        testStatus = false;
     180        globalTestStatus = false;
     181    }
    182182    printFooter( stdout,
    183183                 "psVector functions",
    184184                 "PS_STAT_ROBUST_STATS: lower quartile: no vector mask",
    185185                 testStatus );
    186                  
    187                  
    188                  
     186
     187
     188
    189189    printPositiveTestHeader( stdout,
    190190                             "psStats functions",
    191191                             "PS_STAT_ROBUST_STATS: robust N50: no vector mask" );
    192                              
     192
    193193    // XXX:
    194194    realN50NoMask = myStats->robustN50;
    195    
     195
    196196    printf( "The expected N50 was %.2f; the calculated N50 was %.2f\n",
    197197            realN50NoMask, myStats->robustN50 );
    198198    if ( fabs( myStats->robustN50 - realN50NoMask ) < ( ERROR_TOLERANCE * realN50NoMask ) ) {
    199             testStatus = true;
    200         } else {
    201             testStatus = false;
    202             globalTestStatus = false;
    203         }
     199        testStatus = true;
     200    } else {
     201        testStatus = false;
     202        globalTestStatus = false;
     203    }
    204204    printFooter( stdout,
    205205                 "psVector functions",
    206206                 "PS_STAT_ROBUST_STATS: robust N50: no vector mask",
    207207                 testStatus );
    208                  
    209                  
    210                  
     208
     209
     210
    211211    printPositiveTestHeader( stdout,
    212212                             "psStats functions",
    213213                             "PS_STAT_ROBUST_STATS: robust Nfit: no vector mask" );
    214                              
     214
    215215    // XXX:
    216216    realNfitNoMask = myStats->robustNfit;
    217    
     217
    218218    printf( "The expected Nfit was %.2f; the calculated Nfit was %.2f\n",
    219219            realNfitNoMask, myStats->robustNfit );
    220220    if ( fabs( myStats->robustNfit - realNfitNoMask ) < ( ERROR_TOLERANCE * realNfitNoMask ) ) {
    221             testStatus = true;
    222         } else {
    223             testStatus = false;
    224             globalTestStatus = false;
    225         }
     221        testStatus = true;
     222    } else {
     223        testStatus = false;
     224        globalTestStatus = false;
     225    }
    226226    printFooter( stdout,
    227227                 "psVector functions",
    228228                 "PS_STAT_ROBUST_STATS: robust Nfit: no vector mask",
    229229                 testStatus );
    230                  
    231                  
     230
     231
    232232    return ( 0 );
    233    
     233
    234234    /*************************************************************************/
    235235    /*  Call psVectorStats() with vector mask.                               */
     
    238238                             "psStats functions",
    239239                             "PS_STAT_ROBUST_STATS: robust mean: with vector mask" );
    240                              
     240
    241241    printf( "Calling psVectorStats() on a vector with elements masked.\n" );
    242242    myStats = psVectorStats( myStats, myVector, maskVector, 1 );
     
    245245            realMeanWithMask, myStats->robustMean );
    246246    if ( fabs( myStats->robustMean - realMeanWithMask ) < ( ERROR_TOLERANCE * realMeanWithMask ) ) {
    247             testStatus = true;
    248         } else {
    249             testStatus = false;
    250             globalTestStatus = false;
    251         }
     247        testStatus = true;
     248    } else {
     249        testStatus = false;
     250        globalTestStatus = false;
     251    }
    252252    printFooter( stdout,
    253253                 "psVector functions",
    254254                 "PS_STAT_ROBUST_STATS: robust mean: with vector mask",
    255255                 testStatus );
    256                  
    257                  
    258                  
     256
     257
     258
    259259    printPositiveTestHeader( stdout,
    260260                             "psStats functions",
    261261                             "PS_STAT_ROBUST_STATS: robust Median: with vector mask" );
    262                              
     262
    263263    printf( "The expected Median was %.2f; the calculated Median was %.2f\n",
    264264            realMedianWithMask, myStats->robustMedian );
    265265    if ( fabs( myStats->robustMedian - realMedianWithMask ) < ( ERROR_TOLERANCE * realMedianWithMask ) ) {
    266             testStatus = true;
    267         } else {
    268             testStatus = false;
    269             globalTestStatus = false;
    270         }
     266        testStatus = true;
     267    } else {
     268        testStatus = false;
     269        globalTestStatus = false;
     270    }
    271271    printFooter( stdout,
    272272                 "psVector functions",
    273273                 "PS_STAT_ROBUST_STATS: robust Median: with vector mask",
    274274                 testStatus );
    275                  
    276                  
    277                  
     275
     276
     277
    278278    printPositiveTestHeader( stdout,
    279279                             "psStats functions",
    280280                             "PS_STAT_ROBUST_STATS: robust Mode: with vector mask" );
    281                              
     281
    282282    printf( "The expected Mode was %.2f; the calculated Mode was %.2f\n",
    283283            realModeWithMask, myStats->robustMode );
    284284    if ( fabs( myStats->robustMode - realModeWithMask ) < ( ERROR_TOLERANCE * realModeWithMask ) ) {
    285             testStatus = true;
    286         } else {
    287             testStatus = false;
    288             globalTestStatus = false;
    289         }
     285        testStatus = true;
     286    } else {
     287        testStatus = false;
     288        globalTestStatus = false;
     289    }
    290290    printFooter( stdout,
    291291                 "psVector functions",
    292292                 "PS_STAT_ROBUST_STATS: robust Mode: with vector mask",
    293293                 testStatus );
    294                  
    295                  
    296                  
     294
     295
     296
    297297    printPositiveTestHeader( stdout,
    298298                             "psStats functions",
    299299                             "PS_STAT_ROBUST_STATS: robust Stdev: with vector mask" );
    300                              
     300
    301301    printf( "The expected Stdev was %.2f; the calculated Stdev was %.2f\n",
    302302            realStdevWithMask, myStats->robustStdev );
    303303    if ( fabs( myStats->robustStdev - realStdevWithMask ) < ( ERROR_TOLERANCE * realStdevWithMask ) ) {
    304             testStatus = true;
    305         } else {
    306             testStatus = false;
    307             globalTestStatus = false;
    308         }
     304        testStatus = true;
     305    } else {
     306        testStatus = false;
     307        globalTestStatus = false;
     308    }
    309309    printFooter( stdout,
    310310                 "psVector functions",
    311311                 "PS_STAT_ROBUST_STATS: robust Stdev: with vector mask",
    312312                 testStatus );
    313                  
    314                  
    315                  
     313
     314
     315
    316316    printPositiveTestHeader( stdout,
    317317                             "psStats functions",
    318318                             "PS_STAT_ROBUST_STATS: lower quartile: with vector mask" );
    319                              
     319
    320320    printf( "The expected LQ was %.2f; the calculated LQ was %.2f\n",
    321321            realLQWithMask, myStats->robustLQ );
    322322    if ( fabs( myStats->robustLQ - realLQWithMask ) < ( ERROR_TOLERANCE * realLQWithMask ) ) {
    323             testStatus = true;
    324         } else {
    325             testStatus = false;
    326             globalTestStatus = false;
    327         }
     323        testStatus = true;
     324    } else {
     325        testStatus = false;
     326        globalTestStatus = false;
     327    }
    328328    printFooter( stdout,
    329329                 "psVector functions",
    330330                 "PS_STAT_ROBUST_STATS: lower quartile: with vector mask",
    331331                 testStatus );
    332                  
    333                  
    334                  
     332
     333
     334
    335335    printPositiveTestHeader( stdout,
    336336                             "psStats functions",
    337337                             "PS_STAT_ROBUST_STATS: upper quartile: with vector mask" );
    338                              
     338
    339339    printf( "The expected UQ was %.2f; the calculated UQ was %.2f\n",
    340340            realUQWithMask, myStats->robustUQ );
    341341    if ( fabs( myStats->robustUQ - realUQWithMask ) < ( ERROR_TOLERANCE * realUQWithMask ) ) {
    342             testStatus = true;
    343         } else {
    344             testStatus = false;
    345             globalTestStatus = false;
    346         }
     342        testStatus = true;
     343    } else {
     344        testStatus = false;
     345        globalTestStatus = false;
     346    }
    347347    printFooter( stdout,
    348348                 "psVector functions",
    349349                 "PS_STAT_ROBUST_STATS: lower quartile: with vector mask",
    350350                 testStatus );
    351                  
    352                  
    353                  
     351
     352
     353
    354354    printPositiveTestHeader( stdout,
    355355                             "psStats functions",
    356356                             "PS_STAT_ROBUST_STATS: robust N50: with vector mask" );
    357                              
     357
    358358    printf( "The expected N50 was %.2f; the calculated N50 was %.2f\n",
    359359            realN50WithMask, myStats->robustN50 );
    360360    if ( fabs( myStats->robustN50 - realN50WithMask ) < ( ERROR_TOLERANCE * realN50WithMask ) ) {
    361             testStatus = true;
    362         } else {
    363             testStatus = false;
    364             globalTestStatus = false;
    365         }
     361        testStatus = true;
     362    } else {
     363        testStatus = false;
     364        globalTestStatus = false;
     365    }
    366366    printFooter( stdout,
    367367                 "psVector functions",
    368368                 "PS_STAT_ROBUST_STATS: robust N50: with vector mask",
    369369                 testStatus );
    370                  
    371                  
    372                  
     370
     371
     372
    373373    printPositiveTestHeader( stdout,
    374374                             "psStats functions",
    375375                             "PS_STAT_ROBUST_STATS: robust Nfit: with vector mask" );
    376                              
     376
    377377    printf( "The expected Nfit was %.2f; the calculated Nfit was %.2f\n",
    378378            realNfitWithMask, myStats->robustNfit );
    379379    if ( fabs( myStats->robustNfit - realNfitWithMask ) < ( ERROR_TOLERANCE * realNfitWithMask ) ) {
    380             testStatus = true;
    381         } else {
    382             testStatus = false;
    383             globalTestStatus = false;
    384         }
     380        testStatus = true;
     381    } else {
     382        testStatus = false;
     383        globalTestStatus = false;
     384    }
    385385    printFooter( stdout,
    386386                 "psVector functions",
    387387                 "PS_STAT_ROBUST_STATS: robust Nfit: with vector mask",
    388388                 testStatus );
    389                  
    390                  
    391                  
     389
     390
     391
    392392    /*************************************************************************/
    393393    /*  Deallocate data structures                                           */
     
    396396                             "psStats functions",
    397397                             "psStats(): deallocating memory" );
    398                              
     398
    399399    psFree( myStats );
    400400    psFree( myVector );
    401401    psFree( maskVector );
    402    
     402
    403403    psMemCheckCorruption( 1 );
    404404    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    405405    if ( 0 != memLeaks ) {
    406             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    407         }
    408        
     406        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     407    }
     408
    409409    printFooter( stdout,
    410410                 "psVector functions",
    411411                 "psStats(): deallocating memory",
    412412                 testStatus );
    413                  
     413
    414414    return ( !globalTestStatus );
    415415}
  • trunk/psLib/test/dataManip/tst_psVectorFFT.c

    r1404 r1406  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-08-06 21:50:13 $
     8*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-08-06 22:34:06 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/image/tst_psImage.c

    r1212 r1406  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-13 01:37:58 $
     8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:06 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626
    2727testDescription tests[] = {
    28                               {testImageAlloc,546,"psImageAlloc",0,false},
    29                               {testImageAlloc,548,"psImageFree",0,true},
    30                               {testImageSubset,547,"psImageSubset",0,false},
    31                               {testImageSubset,550,"psImageSubset",0,true},
    32                               {testImageCopy,551,"psImageCopy",0,false},
    33                               {NULL}
     28                              {
     29                                  testImageAlloc,546,"psImageAlloc",0,false
     30                              },
     31                              {
     32                                  testImageAlloc,548,"psImageFree",0,true
     33                              },
     34                              {
     35                                  testImageSubset,547,"psImageSubset",0,false
     36                              },
     37                              {
     38                                  testImageSubset,550,"psImageSubset",0,true
     39                              },
     40                              {
     41                                  testImageCopy,551,"psImageCopy",0,false
     42                              },
     43                              {
     44                                  NULL
     45                              }
    3446                          };
    3547
     
    4961    psImage* image = NULL;
    5062    unsigned int sizes = 6;
    51     unsigned int numCols[] = {0,1,1,100,100,150};
    52     unsigned int numRows[] = {0,1,100,1,150,100};
     63    unsigned int numCols[] = {
     64                                 0,1,1,100,100,150
     65                             };
     66    unsigned int numRows[] = {
     67                                 0,1,100,1,150,100
     68                             };
    5369    unsigned int types = 12;
    5470    psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
  • trunk/psLib/test/image/tst_psImageExtraction.c

    r1405 r1406  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-08-06 22:29:11 $
     8*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-08-06 22:34:06 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/image/tst_psImageFFT.c

    r1193 r1406  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-08 01:05:01 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:06 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434
    3535testDescription tests[] = {
    36                               {testImageFFT,600,"psImageFFT",0,false},
    37                               {testImageRealImaginary,601,"psImageRealImaginary",0,false},
    38                               {testImageComplex,602,"psImageComplex",0,false},
    39                               {testImageConjugate,603,"psImageConjugate",0,false},
    40                               {testImagePowerSpectrum,604,"psImagePowerSpectrum",0,false},
    41                               {NULL}
     36                              {
     37                                  testImageFFT,600,"psImageFFT",0,false
     38                              },
     39                              {
     40                                  testImageRealImaginary,601,"psImageRealImaginary",0,false
     41                              },
     42                              {
     43                                  testImageComplex,602,"psImageComplex",0,false
     44                              },
     45                              {
     46                                  testImageConjugate,603,"psImageConjugate",0,false
     47                              },
     48                              {
     49                                  testImagePowerSpectrum,604,"psImagePowerSpectrum",0,false
     50                              },
     51                              {
     52                                  NULL
     53                              }
    4254                          };
    4355
     
    89101                    psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag);
    90102                }
    91             } else if ( (col == 0 && (row == 1 || row == n-1))
     103            } else
     104                if ( (col == 0 && (row == 1 || row == n-1))
    92105                        || (row == 0 && (col==1 || col == n-1)) ) {
    93                 psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag);
    94             }
     106                    psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag);
     107                }
    95108        }
    96109    }
  • trunk/psLib/test/image/tst_psImageIO.c

    r1253 r1406  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-21 23:49:52 $
     8 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:06 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3535
    3636testDescription tests[] = {
    37                               {testImageRead,567,"psImageReadSection",0,false},
    38                               {testImageWrite,569,"psImageWriteSection",0,false},
    39                               {NULL}
     37                              {
     38                                  testImageRead,567,"psImageReadSection",0,false
     39                              },
     40                              {
     41                                  testImageWrite,569,"psImageWriteSection",0,false
     42                              },
     43                              {
     44                                  NULL
     45                              }
    4046                          };
    4147
     
    291297    mkdir("tmpImages",0777);
    292298    remove
    293         ("writeTest.fits");
     299        ("writeTest.fits")
     300        ;
    294301    if (! psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) {
    295302        psError(__func__,"Couldn't write writeTest.fits.");
  • trunk/psLib/test/image/tst_psImageManip.c

    r1319 r1406  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-29 01:20:10 $
     8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-06 22:34:06 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333
    3434testDescription tests[] = {
    35                               {testImageClip,571,"psImageClip",0,false},
    36                               {testImageClipNAN,572,"psImageClipNAN",0,false},
    37                               {testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false},
    38                               {testImageOverlay,573,"psImageOverlay",0,false},
    39                               {testImageRebin,559,"psImageRebin",0,false},
    40                               {testImageRoll,562,"psImageRoll",0,false},
    41                               {testImageRotate,560,"psImageRotate",0,false},
    42                               {NULL}
     35                              {
     36                                  testImageClip,571,"psImageClip",0,false
     37                              },
     38                              {
     39                                  testImageClipNAN,572,"psImageClipNAN",0,false
     40                              },
     41                              {
     42                                  testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false
     43                              },
     44                              {
     45                                  testImageOverlay,573,"psImageOverlay",0,false
     46                              },
     47                              {
     48                                  testImageRebin,559,"psImageRebin",0,false
     49                              },
     50                              {
     51                                  testImageRoll,562,"psImageRoll",0,false
     52                              },
     53                              {
     54                                  testImageRotate,560,"psImageRotate",0,false
     55                              },
     56                              {
     57                                  NULL
     58                              }
    4359                          };
    4460
     
    11171133    mkdir("temp",0777);
    11181134    remove
    1119         ("temp/fOut.fits");
     1135        ("temp/fOut.fits")
     1136        ;
    11201137    remove
    1121         ("temp/sOut.fits");
     1138        ("temp/sOut.fits")
     1139        ;
    11221140    int index = 0;
    11231141    bool fail = false;
  • trunk/psLib/test/image/tst_psImageStats00.c

    r1365 r1406  
    2828    int IMAGE_Y_SIZE = 0;
    2929    int currentId = 0;
    30    
     30
    3131    currentId = psMemGetId();
    3232    for ( nb = 0;nb < 6;nb++ ) {
    33             if ( nb == 0 ) {
    34                     IMAGE_X_SIZE = 1;
    35                     IMAGE_Y_SIZE = 1;
     33        if ( nb == 0 ) {
     34            IMAGE_X_SIZE = 1;
     35            IMAGE_Y_SIZE = 1;
     36        }
     37        if ( nb == 1 ) {
     38            IMAGE_X_SIZE = 1;
     39            IMAGE_Y_SIZE = N;
     40        }
     41        if ( nb == 2 ) {
     42            IMAGE_X_SIZE = N;
     43            IMAGE_Y_SIZE = 1;
     44        }
     45        if ( nb == 3 ) {
     46            IMAGE_X_SIZE = N;
     47            IMAGE_Y_SIZE = N;
     48        }
     49        if ( nb == 4 ) {
     50            IMAGE_X_SIZE = N;
     51            IMAGE_Y_SIZE = M;
     52        }
     53        if ( nb == 5 ) {
     54            IMAGE_X_SIZE = M;
     55            IMAGE_Y_SIZE = N;
     56        }
     57        printf( "*******************************\n" );
     58        printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
     59        printf( "*******************************\n" );
     60        /*********************************************************************/
     61        /*  Allocate and initialize data structures                      */
     62        /*********************************************************************/
     63        tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
     64
     65        for ( i = 0;i < tmpImage->numRows;i++ ) {
     66            for ( j = 0;j < tmpImage->numCols;j++ ) {
     67                tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 );
     68            }
     69        }
     70        tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
     71        for ( i = 0;i < tmpMask->numRows;i++ ) {
     72            for ( j = 0;j < tmpMask->numCols;j++ ) {
     73                if ( ( i > ( tmpMask->numRows / 2 ) ) &&
     74                        ( j > ( tmpMask->numCols / 2 ) ) ) {
     75                    tmpMask->data.U8[ i ][ j ] = 1;
     76                } else {
     77                    tmpMask->data.U8[ i ][ j ] = 0;
    3678                }
    37             if ( nb == 1 ) {
    38                     IMAGE_X_SIZE = 1;
    39                     IMAGE_Y_SIZE = N;
    40                 }
    41             if ( nb == 2 ) {
    42                     IMAGE_X_SIZE = N;
    43                     IMAGE_Y_SIZE = 1;
    44                 }
    45             if ( nb == 3 ) {
    46                     IMAGE_X_SIZE = N;
    47                     IMAGE_Y_SIZE = N;
    48                 }
    49             if ( nb == 4 ) {
    50                     IMAGE_X_SIZE = N;
    51                     IMAGE_Y_SIZE = M;
    52                 }
    53             if ( nb == 5 ) {
    54                     IMAGE_X_SIZE = M;
    55                     IMAGE_Y_SIZE = N;
    56                 }
    57             printf( "*******************************\n" );
    58             printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
    59             printf( "*******************************\n" );
    60             /*********************************************************************/
    61             /*  Allocate and initialize data structures                      */
    62             /*********************************************************************/
    63             tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
    64            
    65             for ( i = 0;i < tmpImage->numRows;i++ ) {
    66                     for ( j = 0;j < tmpImage->numCols;j++ ) {
    67                             tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 );
    68                         }
    69                 }
    70             tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
    71             for ( i = 0;i < tmpMask->numRows;i++ ) {
    72                     for ( j = 0;j < tmpMask->numCols;j++ ) {
    73                             if ( ( i > ( tmpMask->numRows / 2 ) ) &&
    74                                     ( j > ( tmpMask->numCols / 2 ) ) ) {
    75                                     tmpMask->data.U8[ i ][ j ] = 1;
    76                                 } else {
    77                                     tmpMask->data.U8[ i ][ j ] = 0;
    78                                 }
    79                         }
    80                 }
    81                
    82             /*************************************************************************/
    83             /*  Calculate Histogram with no mask                             */
    84             /*************************************************************************/
    85             printPositiveTestHeader( stdout,
    86                                      "psImageStats functions",
    87                                      "Calculate Histogram, no mask" );
    88                                      
    89             myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
    90                                        NUM_BINS );
    91             myHist = psImageHistogram( myHist, tmpImage, NULL, 0 );
    92             for ( i = 0;i < NUM_BINS;i++ ) {
    93                     printf( "Bin number %d bounds: (%.1f - %.1f) data (%d)\n", i,
    94                             myHist->bounds->data.F32[ i ],
    95                             myHist->bounds->data.F32[ i + 1 ],
    96                             myHist->nums->data.S32[ i ] );
    97                 }
    98             psFree( myHist );
    99            
    100             psMemCheckCorruption( 1 );
    101             printFooter( stdout,
    102                          "psImageStats functions",
    103                          "Calculate Histogram, no mask",
    104                          testStatus );
    105                          
    106             /*************************************************************************/
    107             /*  Calculate Histogram with mask                                */
    108             /*************************************************************************/
    109             printPositiveTestHeader( stdout,
    110                                      "psImageStats functions",
    111                                      "Calculate Histogram with mask" );
    112                                      
    113             myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
    114                                        NUM_BINS );
    115             myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 );
    116             for ( i = 0;i < NUM_BINS;i++ ) {
    117                     printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i,
    118                             myHist->bounds->data.F32[ i ],
    119                             myHist->bounds->data.F32[ i + 1 ],
    120                             myHist->nums->data.S32[ i ] );
    121                 }
    122                
    123             psMemCheckCorruption( 1 );
    124             printFooter( stdout,
    125                          "psImageStats functions",
    126                          "Calculate Histogram with mask",
    127                          testStatus );
    128                          
    129             /*************************************************************************/
    130             /*  Deallocate data structures                                   */
    131             /*************************************************************************/
    132             printPositiveTestHeader( stdout,
    133                                      "psImageStats functions",
    134                                      "Deallocate the psHistogram/psImage structure." );
    135             psFree( myHist );
    136             psFree( tmpImage );
    137             psFree( tmpMask );
    138            
    139             psMemCheckCorruption( 1 );
    140             memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    141             if ( 0 != memLeaks ) {
    142                     psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    143                 }
    144                
    145             printFooter( stdout,
    146                          "psImageStats functions",
    147                          "Deallocate the psHistogram/psImage structure.",
    148                          testStatus );
     79            }
    14980        }
     81
     82        /*************************************************************************/
     83        /*  Calculate Histogram with no mask                             */
     84        /*************************************************************************/
     85        printPositiveTestHeader( stdout,
     86                                 "psImageStats functions",
     87                                 "Calculate Histogram, no mask" );
     88
     89        myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
     90                                   NUM_BINS );
     91        myHist = psImageHistogram( myHist, tmpImage, NULL, 0 );
     92        for ( i = 0;i < NUM_BINS;i++ ) {
     93            printf( "Bin number %d bounds: (%.1f - %.1f) data (%d)\n", i,
     94                    myHist->bounds->data.F32[ i ],
     95                    myHist->bounds->data.F32[ i + 1 ],
     96                    myHist->nums->data.S32[ i ] );
     97        }
     98        psFree( myHist );
     99
     100        psMemCheckCorruption( 1 );
     101        printFooter( stdout,
     102                     "psImageStats functions",
     103                     "Calculate Histogram, no mask",
     104                     testStatus );
     105
     106        /*************************************************************************/
     107        /*  Calculate Histogram with mask                                */
     108        /*************************************************************************/
     109        printPositiveTestHeader( stdout,
     110                                 "psImageStats functions",
     111                                 "Calculate Histogram with mask" );
     112
     113        myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
     114                                   NUM_BINS );
     115        myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 );
     116        for ( i = 0;i < NUM_BINS;i++ ) {
     117            printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i,
     118                    myHist->bounds->data.F32[ i ],
     119                    myHist->bounds->data.F32[ i + 1 ],
     120                    myHist->nums->data.S32[ i ] );
     121        }
     122
     123        psMemCheckCorruption( 1 );
     124        printFooter( stdout,
     125                     "psImageStats functions",
     126                     "Calculate Histogram with mask",
     127                     testStatus );
     128
     129        /*************************************************************************/
     130        /*  Deallocate data structures                                   */
     131        /*************************************************************************/
     132        printPositiveTestHeader( stdout,
     133                                 "psImageStats functions",
     134                                 "Deallocate the psHistogram/psImage structure." );
     135        psFree( myHist );
     136        psFree( tmpImage );
     137        psFree( tmpMask );
     138
     139        psMemCheckCorruption( 1 );
     140        memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
     141        if ( 0 != memLeaks ) {
     142            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     143        }
     144
     145        printFooter( stdout,
     146                     "psImageStats functions",
     147                     "Deallocate the psHistogram/psImage structure.",
     148                     testStatus );
     149    }
    150150    printPositiveTestHeader( stdout,
    151151                             "psImageStats functions",
    152152                             "Calling psImageHistogram() with NULL parameters" );
    153                              
     153
    154154    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
    155155    myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
     
    157157    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
    158158    if ( myHist2 != NULL ) {
    159             printf( "ERROR: myHist2 not equal to NULL\n" );
    160         }
    161        
     159        printf( "ERROR: myHist2 not equal to NULL\n" );
     160    }
     161
    162162    myHist2 = psImageHistogram( myHist, NULL, NULL, 0 );
    163163    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
    164164    if ( myHist2 != NULL ) {
    165             printf( "ERROR: myHist2 not equal to NULL\n" );
    166         }
    167        
     165        printf( "ERROR: myHist2 not equal to NULL\n" );
     166    }
     167
    168168    psMemCheckCorruption( 1 );
    169169    psFree( myHist );
     
    172172    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    173173    if ( 0 != memLeaks ) {
    174             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    175         }
    176        
     174        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     175    }
     176
    177177    printFooter( stdout,
    178178                 "psImageStats functions",
    179179                 "Calling psImageHistogram() with NULL parameters",
    180180                 testStatus );
    181                  
     181
    182182    return ( !testStatus );
    183183}
  • trunk/psLib/test/image/tst_psImageStats01.c

    r1365 r1406  
    2929    int IMAGE_Y_SIZE = 0;
    3030    int currentId = 0;
    31    
     31
    3232    currentId = psMemGetId();
    3333    for ( nb = 0;nb < 6;nb++ ) {
    34             if ( nb == 0 ) {
    35                     IMAGE_X_SIZE = 1;
    36                     IMAGE_Y_SIZE = 1;
     34        if ( nb == 0 ) {
     35            IMAGE_X_SIZE = 1;
     36            IMAGE_Y_SIZE = 1;
     37        }
     38        if ( nb == 1 ) {
     39            IMAGE_X_SIZE = 1;
     40            IMAGE_Y_SIZE = N;
     41        }
     42        if ( nb == 2 ) {
     43            IMAGE_X_SIZE = N;
     44            IMAGE_Y_SIZE = 1;
     45        }
     46        if ( nb == 3 ) {
     47            IMAGE_X_SIZE = N;
     48            IMAGE_Y_SIZE = N;
     49        }
     50        if ( nb == 4 ) {
     51            IMAGE_X_SIZE = N;
     52            IMAGE_Y_SIZE = M;
     53        }
     54        if ( nb == 5 ) {
     55            IMAGE_X_SIZE = M;
     56            IMAGE_Y_SIZE = N;
     57        }
     58        printf( "*******************************\n" );
     59        printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
     60        printf( "*******************************\n" );
     61
     62        /*************************************************************************/
     63        /*  Allocate and initialize data structures                      */
     64        /*************************************************************************/
     65        tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
     66
     67        for ( i = 0;i < tmpImage->numRows;i++ ) {
     68            for ( j = 0;j < tmpImage->numCols;j++ ) {
     69                tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
     70            }
     71        }
     72        tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
     73        for ( i = 0;i < tmpMask->numRows;i++ ) {
     74            for ( j = 0;j < tmpMask->numCols;j++ ) {
     75                if ( ( i > ( tmpMask->numRows / 2 ) ) &&
     76                        ( j > ( tmpMask->numCols / 2 ) ) ) {
     77                    tmpMask->data.U8[ i ][ j ] = 1;
     78                } else {
     79                    tmpMask->data.U8[ i ][ j ] = 0;
    3780                }
    38             if ( nb == 1 ) {
    39                     IMAGE_X_SIZE = 1;
    40                     IMAGE_Y_SIZE = N;
    41                 }
    42             if ( nb == 2 ) {
    43                     IMAGE_X_SIZE = N;
    44                     IMAGE_Y_SIZE = 1;
    45                 }
    46             if ( nb == 3 ) {
    47                     IMAGE_X_SIZE = N;
    48                     IMAGE_Y_SIZE = N;
    49                 }
    50             if ( nb == 4 ) {
    51                     IMAGE_X_SIZE = N;
    52                     IMAGE_Y_SIZE = M;
    53                 }
    54             if ( nb == 5 ) {
    55                     IMAGE_X_SIZE = M;
    56                     IMAGE_Y_SIZE = N;
    57                 }
    58             printf( "*******************************\n" );
    59             printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
    60             printf( "*******************************\n" );
    61            
    62             /*************************************************************************/
    63             /*  Allocate and initialize data structures                      */
    64             /*************************************************************************/
    65             tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
    66            
    67             for ( i = 0;i < tmpImage->numRows;i++ ) {
    68                     for ( j = 0;j < tmpImage->numCols;j++ ) {
    69                             tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
    70                         }
    71                 }
    72             tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
    73             for ( i = 0;i < tmpMask->numRows;i++ ) {
    74                     for ( j = 0;j < tmpMask->numCols;j++ ) {
    75                             if ( ( i > ( tmpMask->numRows / 2 ) ) &&
    76                                     ( j > ( tmpMask->numCols / 2 ) ) ) {
    77                                     tmpMask->data.U8[ i ][ j ] = 1;
    78                                 } else {
    79                                     tmpMask->data.U8[ i ][ j ] = 0;
    80                                 }
    81                         }
    82                 }
    83                
    84             myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN );
    85             /*************************************************************************/
    86             /*  Calculate Sample Mean with no mask                           */
    87             /*************************************************************************/
    88             printPositiveTestHeader( stdout,
    89                                      "psImageStats functions",
    90                                      "Calculate Sample Mean, no mask %d" );
    91                                      
    92             myStats = psImageStats( myStats, tmpImage, NULL, 0 );
    93             printf( "The sample mean was %.2f\n", myStats->sampleMean );
    94            
    95             psMemCheckCorruption( 1 );
    96            
    97             printFooter( stdout,
    98                          "psImageStats functions",
    99                          "Calculate Sample Mean, no mask",
    100                          testStatus );
    101                          
    102             /*************************************************************************/
    103             /*  Calculate Sample Mean with mask                              */
    104             /*************************************************************************/
    105             printPositiveTestHeader( stdout,
    106                                      "psImageStats functions",
    107                                      "Calculate Sample Mean with mask" );
    108                                      
    109             myStats = psImageStats( myStats, tmpImage, tmpMask, 1 );
    110             printf( "The sample mean was %.2f\n", myStats->sampleMean );
    111            
    112             psMemCheckCorruption( 1 );
    113            
    114             printFooter( stdout,
    115                          "psImageStats functions",
    116                          "Calculate Sample Mean with mask",
    117                          testStatus );
    118                          
    119             /*************************************************************************/
    120             /*  Deallocate data structures                                   */
    121             /*************************************************************************/
    122             printPositiveTestHeader( stdout,
    123                                      "psImageStats functions",
    124                                      "Deallocate the psStats/psImage structure." );
    125             psFree( myStats );
    126             psFree( tmpImage );
    127             psFree( tmpMask );
    128            
    129             psMemCheckCorruption( 1 );
    130             memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    131             if ( 0 != memLeaks ) {
    132                     psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    133                 }
    134                
    135             printFooter( stdout,
    136                          "psImageStats functions",
    137                          "Deallocate the psStats/psImage structure.",
    138                          testStatus );
     81            }
    13982        }
    140        
     83
     84        myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN );
     85        /*************************************************************************/
     86        /*  Calculate Sample Mean with no mask                           */
     87        /*************************************************************************/
     88        printPositiveTestHeader( stdout,
     89                                 "psImageStats functions",
     90                                 "Calculate Sample Mean, no mask %d" );
     91
     92        myStats = psImageStats( myStats, tmpImage, NULL, 0 );
     93        printf( "The sample mean was %.2f\n", myStats->sampleMean );
     94
     95        psMemCheckCorruption( 1 );
     96
     97        printFooter( stdout,
     98                     "psImageStats functions",
     99                     "Calculate Sample Mean, no mask",
     100                     testStatus );
     101
     102        /*************************************************************************/
     103        /*  Calculate Sample Mean with mask                              */
     104        /*************************************************************************/
     105        printPositiveTestHeader( stdout,
     106                                 "psImageStats functions",
     107                                 "Calculate Sample Mean with mask" );
     108
     109        myStats = psImageStats( myStats, tmpImage, tmpMask, 1 );
     110        printf( "The sample mean was %.2f\n", myStats->sampleMean );
     111
     112        psMemCheckCorruption( 1 );
     113
     114        printFooter( stdout,
     115                     "psImageStats functions",
     116                     "Calculate Sample Mean with mask",
     117                     testStatus );
     118
     119        /*************************************************************************/
     120        /*  Deallocate data structures                                   */
     121        /*************************************************************************/
     122        printPositiveTestHeader( stdout,
     123                                 "psImageStats functions",
     124                                 "Deallocate the psStats/psImage structure." );
     125        psFree( myStats );
     126        psFree( tmpImage );
     127        psFree( tmpMask );
     128
     129        psMemCheckCorruption( 1 );
     130        memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
     131        if ( 0 != memLeaks ) {
     132            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     133        }
     134
     135        printFooter( stdout,
     136                     "psImageStats functions",
     137                     "Deallocate the psStats/psImage structure.",
     138                     testStatus );
     139    }
     140
    141141    /*************************************************************************/
    142142    /*  Test With Various Null Inputs                                        */
     
    145145                             "psImageStats functions",
    146146                             "Test With Various Null Inputs" );
    147                              
     147
    148148    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
    149149    tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
    150150    myStats = psStatsAlloc( 0 );
    151    
     151
    152152    myStats2 = psImageStats( myStats, NULL, NULL, 0 );
    153153    if ( myStats2 != NULL ) {
    154             printf( "ERROR: myStats2 = psImageStats(myStats, NULL, NULL, 0) != NULL\n" );
    155         }
    156        
     154        printf( "ERROR: myStats2 = psImageStats(myStats, NULL, NULL, 0) != NULL\n" );
     155    }
     156
    157157    myStats2 = psImageStats( NULL, tmpImage, NULL, 0 );
    158158    if ( myStats2 != NULL ) {
    159             printf( "ERROR: myStats2 = psImageStats(NULL, tmpImage, NULL, 0) != NULL\n" );
    160         }
    161        
     159        printf( "ERROR: myStats2 = psImageStats(NULL, tmpImage, NULL, 0) != NULL\n" );
     160    }
     161
    162162    myStats2 = psImageStats( myStats, tmpImage, NULL, 0 );
    163    
     163
    164164    psFree( myStats );
    165165    psFree( tmpImage );
    166166    psFree( tmpMask );
    167    
     167
    168168    psMemCheckCorruption( 1 );
    169169    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    170170    if ( 0 != memLeaks ) {
    171             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    172         }
    173        
     171        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     172    }
     173
    174174    printFooter( stdout,
    175175                 "psImageStats functions",
  • trunk/psLib/test/image/tst_psImageStats02.c

    r1365 r1406  
    44   thouroughly tested elsewhere, we will only test psImageStats() with
    55   the PS_STAT_SAMPLE_MEAN here.
    6 
     6 
    77   NOTE: After you debug, set CHEBY_X_DIM != CHEBY_Y_DIM.
    88   Also, uses non-square images.
     
    3232    int rc = 0;
    3333    int currentId = 0;
    34    
     34
    3535    currentId = psMemGetId();
    3636    /*************************************************************************/
     
    4040    outImage = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32 );
    4141    for ( i = 0;i < IMAGE_SIZE;i++ ) {
    42             for ( j = 0;j < IMAGE_SIZE;j++ ) {
    43                     tmpImage->data.F32[ i ][ j ] = 4.0;
    44                     tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
    45                     tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i );
    46                     outImage->data.F32[ i ][ j ] = 0.0;
    47                 }
     42        for ( j = 0;j < IMAGE_SIZE;j++ ) {
     43            tmpImage->data.F32[ i ][ j ] = 4.0;
     44            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
     45            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i );
     46            outImage->data.F32[ i ][ j ] = 0.0;
    4847        }
     48    }
    4949    my2DPoly = psPolynomial2DAlloc( CHEBY_X_DIM, CHEBY_Y_DIM );
    5050    /*************************************************************************/
     
    5454                             "psImageStats functions",
    5555                             "Calculate Chebyshev Polynomials, no mask" );
    56                              
     56
    5757    my2DPoly = psImageFitPolynomial( tmpImage, my2DPoly );
    5858    for ( i = 0;i < CHEBY_X_DIM;i++ ) {
    59             for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
    60                     printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] );
    61                 }
     59        for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
     60            printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] );
    6261        }
    63        
     62    }
     63
    6464    psMemCheckCorruption( 1 );
    6565    printFooter( stdout,
     
    7373                             "psImageStats functions",
    7474                             "Calculate Chebyshev Polynomials, no mask" );
    75                              
     75
    7676    rc = psImageEvalPolynomial( outImage, my2DPoly );
    7777    for ( i = 0;i < IMAGE_SIZE;i++ ) {
    78             for ( j = 0;j < IMAGE_SIZE;j++ ) {
    79            
    80                     //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
    81                     //                     tmpImage->data.F32[i][j],
    82                     //                     outImage->data.F32[i][j]);
    83                     if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) {
    84                             printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j,
    85                                     outImage->data.F32[ i ][ j ],
    86                                     tmpImage->data.F32[ i ][ j ] );
    87                         }
    88                        
    89                 }
     78        for ( j = 0;j < IMAGE_SIZE;j++ ) {
     79
     80            //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
     81            //                     tmpImage->data.F32[i][j],
     82            //                     outImage->data.F32[i][j]);
     83            if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) {
     84                printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j,
     85                        outImage->data.F32[ i ][ j ],
     86                        tmpImage->data.F32[ i ][ j ] );
     87            }
     88
    9089        }
    91        
     90    }
     91
    9292    psMemCheckCorruption( 1 );
    9393    printFooter( stdout,
     
    9595                 "Calculate Chebyshev Polynomials, no mask",
    9696                 testStatus );
    97                  
     97
    9898    /*************************************************************************/
    9999    /*  Deallocate data structures                                   */
     
    106106    psFree( outImage );
    107107    psFree( my2DPoly );
    108    
     108
    109109    psMemCheckCorruption( 1 );
    110110    memLeaks = psMemCheckLeaks( currentId, NULL, NULL );
    111111    if ( 0 != memLeaks ) {
    112             psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
    113         }
    114        
     112        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
     113    }
     114
    115115    printFooter( stdout,
    116116                 "psImageStats functions",
    117117                 "Deallocate the psStats/psImage structure.",
    118118                 testStatus );
    119                  
     119
    120120    return ( !testStatus );
    121121}
  • trunk/psLib/test/psTest.c

    r1365 r1406  
    3737    int n;
    3838    extern char *optarg;
    39    
     39
    4040    if ( argc > 0 ) {
    41             while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) {
    42                     switch ( c ) {
    43                             case 'h':
    44                             printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n"
    45                                     "    where:\n"
    46                                     "           -l  : lists the testpoints contained in this test driver executable\n"
    47                                     "           -d  : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n"
    48                                     "           -h  : prints this help\n"
    49                                     "           -n  : specifies a particular testpoint by number to run\n"
    50                                     "           -t  : specifies a particular testpoint by name to run\n"
    51                                     "    (if no -l, -n or -t options are given, all testpoints are run)\n",
    52                                     argv[ 0 ] );
    53                             runAll = false;
    54                             break;
    55                             case 'd':
    56                             useFork = false;
    57                             break;
    58                             case 'l':
    59                             printf( "Test Driver:  %s\n", testPointFile );
    60                             printf( "Package Name: %s\n", packageName );
    61                             printf( "Testpoints:\n" );
    62                             runAll = false;
    63                             for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
    64                                     printf( "    %6d - %s \n", tests[ index ].testPointNumber,
    65                                             tests[ index ].testPointName );
    66                                 }
    67                             printf( "\n" );
    68                             break;
    69                             case 't':
    70                             runAll = false;
    71                             for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
    72                                     if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) {
    73                                             success = p_runTest( fp,
    74                                                                  testPointFile,
    75                                                                  packageName,
    76                                                                  tests[ index ].testPointName,
    77                                                                  tests[ index ].fcn,
    78                                                                  tests[ index ].expectedReturn,
    79                                                                  useFork ) && success;
    80                                         }
    81                                 }
    82                             break;
    83                             case 'n':
    84                             runAll = false;
    85                             if ( sscanf( optarg, "%i", &n ) != 1 ) {
    86                                     psError( __func__, "Failed to parse the testpoint number (%s).",
    87                                              optarg );
    88                                     break;
    89                                 }
    90                             found = false;
    91                             for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
    92                                     if ( n == tests[ index ].testPointNumber ) {
    93                                             found = true;
    94                                             success = p_runTest( fp,
    95                                                                  testPointFile,
    96                                                                  packageName,
    97                                                                  tests[ index ].testPointName,
    98                                                                  tests[ index ].fcn,
    99                                                                  tests[ index ].expectedReturn,
    100                                                                  useFork ) && success;
    101                                         }
    102                                 }
    103                             if ( ! found ) {
    104                                     psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.",
    105                                              n );
    106                                     break;
    107                                 }
    108                             break;
    109                             case '?':
    110                             psError( __func__, "Option %s is not recognized and is ignored.", optarg );
    111                             break;
    112                         }
    113                 }
    114         }
    115        
     41        while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) {
     42            switch ( c ) {
     43            case 'h':
     44                printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n"
     45                        "    where:\n"
     46                        "           -l  : lists the testpoints contained in this test driver executable\n"
     47                        "           -d  : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n"
     48                        "           -h  : prints this help\n"
     49                        "           -n  : specifies a particular testpoint by number to run\n"
     50                        "           -t  : specifies a particular testpoint by name to run\n"
     51                        "    (if no -l, -n or -t options are given, all testpoints are run)\n",
     52                        argv[ 0 ] );
     53                runAll = false;
     54                break;
     55            case 'd':
     56                useFork = false;
     57                break;
     58            case 'l':
     59                printf( "Test Driver:  %s\n", testPointFile );
     60                printf( "Package Name: %s\n", packageName );
     61                printf( "Testpoints:\n" );
     62                runAll = false;
     63                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
     64                    printf( "    %6d - %s \n", tests[ index ].testPointNumber,
     65                            tests[ index ].testPointName );
     66                }
     67                printf( "\n" );
     68                break;
     69            case 't':
     70                runAll = false;
     71                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
     72                    if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) {
     73                        success = p_runTest( fp,
     74                                             testPointFile,
     75                                             packageName,
     76                                             tests[ index ].testPointName,
     77                                             tests[ index ].fcn,
     78                                             tests[ index ].expectedReturn,
     79                                             useFork ) && success;
     80                    }
     81                }
     82                break;
     83            case 'n':
     84                runAll = false;
     85                if ( sscanf( optarg, "%i", &n ) != 1 ) {
     86                    psError( __func__, "Failed to parse the testpoint number (%s).",
     87                             optarg );
     88                    break;
     89                }
     90                found = false;
     91                for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
     92                    if ( n == tests[ index ].testPointNumber ) {
     93                        found = true;
     94                        success = p_runTest( fp,
     95                                             testPointFile,
     96                                             packageName,
     97                                             tests[ index ].testPointName,
     98                                             tests[ index ].fcn,
     99                                             tests[ index ].expectedReturn,
     100                                             useFork ) && success;
     101                    }
     102                }
     103                if ( ! found ) {
     104                    psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.",
     105                             n );
     106                    break;
     107                }
     108                break;
     109            case '?':
     110                psError( __func__, "Option %s is not recognized and is ignored.", optarg );
     111                break;
     112            }
     113        }
     114    }
     115
    116116    if ( runAll ) {
    117             for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
    118                     if ( ! tests[ index ].isDuplicateEntry ) {
    119                             success = p_runTest( fp,
    120                                                  testPointFile,
    121                                                  packageName,
    122                                                  tests[ index ].testPointName,
    123                                                  tests[ index ].fcn,
    124                                                  tests[ index ].expectedReturn,
    125                                                  useFork ) && success;
    126                         }
    127                 }
    128         }
    129        
     117        for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {
     118            if ( ! tests[ index ].isDuplicateEntry ) {
     119                success = p_runTest( fp,
     120                                     testPointFile,
     121                                     packageName,
     122                                     tests[ index ].testPointName,
     123                                     tests[ index ].fcn,
     124                                     tests[ index ].expectedReturn,
     125                                     useFork ) && success;
     126            }
     127        }
     128    }
     129
    130130    if ( ! success ) {
    131             psError( testPointFile, "One or more tests failed" );
    132         }
    133        
     131        psError( testPointFile, "One or more tests failed" );
     132    }
     133
    134134    return success;
    135135}
     
    140140    int childReturn = 0;
    141141    pid_t child;
    142    
     142
    143143    p_printPositiveTestHeader( fp, testPointFile, packageName, testPointName );
    144    
     144
    145145    if ( useFork ) {
    146             child = fork();
    147             if ( child == 0 ) {                   // I am the child process, run the test
    148                     int currentId = psMemGetId();
    149                     int retVal = fcn();
    150                     if ( retVal == 0 ) { // only bother checking memory if test executed to end.
    151                             if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
    152                                     psError( __func__, "Memory Leaks Detected" );
    153                                     retVal = 64;
    154                                 }
    155                             psMemCheckCorruption( 1 );
    156                         }
    157                     exit( retVal );
    158                 } else if ( child < 0 ) {
    159                     fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)",
    160                              packageName, testPointName );
    161                     abort();
    162                 }
    163                
    164             waitpid( child, &childReturn, 0 );
    165             if ( WIFSIGNALED( childReturn ) ) {
    166                     childReturn = -WTERMSIG( childReturn );
    167                 } else {
    168                     childReturn = WEXITSTATUS( childReturn );
    169                 }
     146        child = fork();
     147        if ( child == 0 ) {                   // I am the child process, run the test
     148            int currentId = psMemGetId();
     149            int retVal = fcn();
     150            if ( retVal == 0 ) { // only bother checking memory if test executed to end.
     151                if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
     152                    psError( __func__, "Memory Leaks Detected" );
     153                    retVal = 64;
     154                }
     155                psMemCheckCorruption( 1 );
     156            }
     157            exit( retVal );
     158        } else
     159            if ( child < 0 ) {
     160                fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)",
     161                         packageName, testPointName );
     162                abort();
     163            }
     164
     165        waitpid( child, &childReturn, 0 );
     166        if ( WIFSIGNALED( childReturn ) ) {
     167            childReturn = -WTERMSIG( childReturn );
    170168        } else {
    171             int currentId = psMemGetId();
    172             childReturn = fcn();
    173             if ( childReturn == 0 ) { // only bother checking memory if test executed to end.
    174                     if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
    175                             psError( __func__, "Memory Leaks Detected" );
    176                             childReturn = 64;
    177                         }
    178                     psMemCheckCorruption( 1 );
    179                 }
    180         }
    181        
    182        
     169            childReturn = WEXITSTATUS( childReturn );
     170        }
     171    } else {
     172        int currentId = psMemGetId();
     173        childReturn = fcn();
     174        if ( childReturn == 0 ) { // only bother checking memory if test executed to end.
     175            if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
     176                psError( __func__, "Memory Leaks Detected" );
     177                childReturn = 64;
     178            }
     179            psMemCheckCorruption( 1 );
     180        }
     181    }
     182
     183
    183184    if ( childReturn != expectedReturn ) {
    184             fprintf( fp, "Return value mismatch: expected %d, got %d",
    185                      expectedReturn, childReturn );
    186         }
    187        
     185        fprintf( fp, "Return value mismatch: expected %d, got %d",
     186                 expectedReturn, childReturn );
     187    }
     188
    188189    p_printFooter( fp, testPointFile, packageName, testPointName,
    189190                   ( childReturn == expectedReturn ) );
    190                    
     191
    191192    return ( childReturn == expectedReturn );
    192193}
     
    198199{
    199200    char TP[ 80 ];
    200    
     201
    201202    snprintf( TP, 80, "%s{%s}", packageName, testPointName );
    202    
     203
    203204    fprintf( fp, HEADER_TOP );
    204205    fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile );
     
    216217{
    217218    char TP[ 80 ];
    218    
     219
    219220    snprintf( TP, 80, "%s{%s}", packageName, testPointName );
    220    
     221
    221222    fprintf( fp, HEADER_TOP );
    222223    fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile );
     
    236237{
    237238    if ( success ) {
    238             fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
    239         } else {
    240             fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
    241         }
    242 }
     239        fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
     240    } else {
     241        fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );
     242    }
     243}
  • trunk/psLib/test/sysUtils/atst_psAbort_01.c

    r717 r1406  
    88 *  @author  Eric Van Alst, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    11  *  @date  $Date: 2004-05-18 19:22:35 $
     10 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     11 *  @date  $Date: 2004-08-06 22:34:06 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/sysUtils/atst_psAbort_02.c

    r717 r1406  
    88 *  @author  Eric Van Alst, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    11  *  @date  $Date: 2004-05-18 19:22:35 $
     10 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     11 *  @date  $Date: 2004-08-06 22:34:06 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/sysUtils/atst_psAbort_03.c

    r717 r1406  
    88 *  @author  Eric Van Alst, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    11  *  @date  $Date: 2004-05-18 19:22:35 $
     10 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     11 *  @date  $Date: 2004-08-06 22:34:06 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/sysUtils/tst_psError.c

    r717 r1406  
    1010 *  @author  Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-05-18 19:22:35 $
     12 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:06 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/sysUtils/tst_psHash02.c

    r1201 r1406  
    4242    int i               = 0;
    4343    ID *id = NULL;
    44     char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    45     char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     44    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
     45                     };
     46    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
     47                     };
    4648    int currentId = psMemGetId();
    4749    int memLeaks        = 0;
  • trunk/psLib/test/sysUtils/tst_psHash03.c

    r1295 r1406  
    7070    bool retVal         = false;
    7171    ID *id = NULL;
    72     char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    73     char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     72    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
     73                     };
     74    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
     75                     };
    7476    int memLeaks        = 0;
    7577
  • trunk/psLib/test/sysUtils/tst_psHash04.c

    r1201 r1406  
    3737    int testStatus      = true;
    3838    int i               = 0;
    39     char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    40     char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     39    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
     40                     };
     41    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
     42                     };
    4143    int currentId = psMemGetId();
    4244    int memLeaks        = 0;
  • trunk/psLib/test/sysUtils/tst_psMemory.c

    r1365 r1406  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-08-02 19:43:23 $
     8*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-08-06 22:34:06 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8080                              }
    8181                          };
    82                          
     82
    8383int main( int argc, char* argv[] )
    8484{
    8585    psLogSetLevel( PS_LOG_INFO );
    86    
     86
    8787    return ( ! runTestSuite( stderr, "psMemory", tests, argc, argv ) );
    8888}
     
    9494    const int size = 100;
    9595    int failed = 0;
    96    
     96
    9797    psLogMsg( __func__, PS_LOG_INFO, "psAlloc shall allocate memory blocks writeable by caller.\n" );
    98    
     98
    9999    mem = ( int* ) psAlloc( size * sizeof( int ) );
    100100    if ( mem == NULL ) {
    101             psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ );
    102             return 1;
     101        psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ );
     102        return 1;
     103    }
     104
     105    for ( int index = 0;index < size;index++ ) {
     106        mem[ index ] = index;
     107    }
     108
     109    for ( int index = 0;index < size;index++ ) {
     110        if ( mem[ index ] != index ) {
     111            failed++;
    103112        }
    104        
    105     for ( int index = 0;index < size;index++ ) {
    106             mem[ index ] = index;
    107         }
    108        
    109     for ( int index = 0;index < size;index++ ) {
    110             if ( mem[ index ] != index ) {
    111                     failed++;
    112                 }
    113         }
    114        
     113    }
     114
    115115    psFree( mem );
    116    
     116
    117117    return failed;
    118118}
     
    123123    int * mem;
    124124    int ref = 0;
    125    
     125
    126126    psLogMsg( __func__, PS_LOG_INFO, "memory reference count shall be incrementable/decrementable" );
    127    
     127
    128128    mem = ( int* ) psAlloc( 100 * sizeof( int ) );
    129    
     129
    130130    ref = psMemGetRefCounter( mem );
    131131    if ( ref != 1 ) {
    132             psError( __func__, "Expected to buffer reference count to be initially 1, but it was %d.", ref );
    133             return 1;
    134         }
    135        
     132        psError( __func__, "Expected to buffer reference count to be initially 1, but it was %d.", ref );
     133        return 1;
     134    }
     135
    136136    psMemIncrRefCounter( mem );
    137137    psMemIncrRefCounter( mem );
    138138    psMemIncrRefCounter( mem );
    139    
     139
    140140    ref = psMemGetRefCounter( mem );
    141141    if ( ref != 4 ) {
    142             psError( __func__, "Expected to find buffer reference count to be 4, but it was %d.", ref );
    143             return 1;
    144         }
    145        
     142        psError( __func__, "Expected to find buffer reference count to be 4, but it was %d.", ref );
     143        return 1;
     144    }
     145
    146146    psMemDecrRefCounter( mem );
    147147    psMemDecrRefCounter( mem );
    148    
     148
    149149    ref = psMemGetRefCounter( mem );
    150150    if ( ref != 2 ) {
    151             psError( __func__, "Expected to find buffer reference count to be 2, but it was %d.", ref );
    152             return 1;
    153         }
    154        
     151        psError( __func__, "Expected to find buffer reference count to be 2, but it was %d.", ref );
     152        return 1;
     153    }
     154
    155155    psLogMsg( __func__, PS_LOG_INFO, "psFree shall be just decrement a multiple refererenced pointer." );
    156    
     156
    157157    psFree( mem );
    158    
     158
    159159    ref = psMemGetRefCounter( mem );
    160160    if ( ref != 1 ) {
    161             psError( __func__, "Expected to find buffer reference count to be 1, but it was %d.", ref );
    162             return 1;
    163         }
    164        
     161        psError( __func__, "Expected to find buffer reference count to be 1, but it was %d.", ref );
     162        return 1;
     163    }
     164
    165165    psFree( mem );
    166    
     166
    167167    return 0;
    168168}
     
    174174    int * mem[ 100 ];
    175175    psMemExhaustedCallback cb;
    176    
    177     for ( int lcv = 0; lcv < 100; lcv++ ) {
    178             mem[ lcv ] = NULL;
    179         }
    180        
     176
     177    for ( int lcv = 0; lcv < 100; lcv++ ) {
     178        mem[ lcv ] = NULL;
     179    }
     180
    181181    psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psRealloc shall call "
    182182              "the psMemExhaustedCallback.\n" );
    183              
     183
    184184    exhaustedCallbackCalled = 0;
    185    
     185
    186186    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
    187    
    188     for ( int lcv = 0; lcv < 100; lcv++ ) {
    189             mem[ lcv ] = ( int* ) psAlloc( 10 );
    190         }
    191        
    192     for ( int lcv = 0; lcv < 100; lcv++ ) {
    193             mem[ lcv ] = ( int* ) psRealloc( mem[ lcv ], SIZE_MAX - 1000 );
    194         }
    195        
     187
     188    for ( int lcv = 0; lcv < 100; lcv++ ) {
     189        mem[ lcv ] = ( int* ) psAlloc( 10 );
     190    }
     191
     192    for ( int lcv = 0; lcv < 100; lcv++ ) {
     193        mem[ lcv ] = ( int* ) psRealloc( mem[ lcv ], SIZE_MAX - 1000 );
     194    }
     195
    196196    psMemExhaustedCallbackSet( cb );
    197    
     197
    198198    if ( exhaustedCallbackCalled == 0 ) {
    199             psError( __FILE__, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ );
    200             return 1;
    201         }
    202        
    203     for ( int lcv = 0; lcv < 100; lcv++ ) {
    204             psFree( mem[ lcv ] );
    205         }
    206        
     199        psError( __FILE__, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ );
     200        return 1;
     201    }
     202
     203    for ( int lcv = 0; lcv < 100; lcv++ ) {
     204        psFree( mem[ lcv ] );
     205    }
     206
    207207    return 0;
    208208}
     
    213213    int * mem[ 100 ];
    214214    psMemExhaustedCallback cb;
    215    
    216     for ( int lcv = 0; lcv < 100; lcv++ ) {
    217             mem[ lcv ] = NULL;
    218         }
    219        
     215
     216    for ( int lcv = 0; lcv < 100; lcv++ ) {
     217        mem[ lcv ] = NULL;
     218    }
     219
    220220    psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psalloc shall call "
    221221              "the psMemExhaustedCallback.\n" );
    222              
     222
    223223    exhaustedCallbackCalled = 0;
    224    
     224
    225225    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
    226    
    227     for ( int lcv = 0; lcv < 100; lcv++ ) {
    228             mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX - 1000 );
    229         }
    230        
     226
     227    for ( int lcv = 0; lcv < 100; lcv++ ) {
     228        mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX - 1000 );
     229    }
     230
    231231    psMemExhaustedCallbackSet( cb );
    232    
     232
    233233    if ( exhaustedCallbackCalled == 0 ) {
    234             psError( __FILE__, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ );
    235             return 1;
    236         }
    237        
    238     for ( int lcv = 0; lcv < 100; lcv++ ) {
    239             psFree( mem[ lcv ] );
    240         }
    241        
     234        psError( __FILE__, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ );
     235        return 1;
     236    }
     237
     238    for ( int lcv = 0; lcv < 100; lcv++ ) {
     239        psFree( mem[ lcv ] );
     240    }
     241
    242242    return 0;
    243243}
     
    250250    int* mem3;
    251251    const int initialSize = 100;
    252    
     252
    253253    psLogMsg( __func__, PS_LOG_INFO, "psRealloc shall increase/decrease memory buffer while "
    254254              "preserving contents" );
    255              
     255
    256256    // allocate buffer with known values.
    257257    mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
     
    259259    mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    260260    for ( int lcv = 0;lcv < initialSize;lcv++ ) {
    261             mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv;
    262         }
    263        
     261        mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv;
     262    }
     263
    264264    psMemCheckCorruption( 1 );
    265265    psLogMsg( __func__, PS_LOG_INFO, "Expanding memory buffer." );
    266    
     266
    267267    // realloc to 2x
    268268    mem1 = ( int* ) psRealloc( mem1, 2 * initialSize * sizeof( int ) );
    269269    mem2 = ( int* ) psRealloc( mem2, 2 * initialSize * sizeof( int ) );
    270270    mem3 = ( int* ) psRealloc( mem3, 2 * initialSize * sizeof( int ) );
    271    
     271
    272272    // check values of initial block
    273273    for ( int i = 0;i < initialSize;i++ ) {
    274             if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
    275                     psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.",
    276                              __func__ );
    277                     break;
    278                 }
     274        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
     275            psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.",
     276                     __func__ );
     277            break;
    279278        }
    280        
     279    }
     280
    281281    psMemCheckCorruption( 1 );
    282282    psLogMsg( __func__, PS_LOG_INFO, "Shrinking memory buffer." );
    283    
     283
    284284    // realloc to 1/2 initial value.
    285285    mem1 = ( int* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( int ) );
    286286    mem2 = ( int* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( int ) );
    287287    mem3 = ( int* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( int ) );
    288    
     288
    289289    // check values of initial block
    290290    for ( int i = 0;i < initialSize / 2;i++ ) {
    291             if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
    292                     psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.",
    293                              __func__ );
    294                     break;
    295                 }
     291        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
     292            psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.",
     293                     __func__ );
     294            break;
    296295        }
    297        
     296    }
     297
    298298    psFree( mem1 );
    299299    psFree( mem2 );
    300300    psFree( mem3 );
    301    
     301
    302302    return 0;
    303303}
     
    311311    const int initialSize = 100;
    312312    int mark;
    313    
     313
    314314    allocCallbackCalled = 0;
    315315    freeCallbackCalled = 0;
    316316    psMemAllocateCallbackSet( memAllocateCallback );
    317317    psMemFreeCallbackSet( memFreeCallback );
    318    
     318
    319319    psMemAllocateCallbackSetID( currentId + 1 );
    320320    psMemFreeCallbackSetID( currentId + 1 );
    321    
     321
    322322    psLogMsg( __func__, PS_LOG_INFO, "call to psAlloc/psRealloc shall generate a callback if specified "
    323323              "memory ID is allocated." );
    324              
     324
    325325    // allocate buffer with known values.
    326326    mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    327327    mem2 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    328328    mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    329    
     329
    330330    psFree( mem1 );
    331331    psFree( mem2 );
    332332    psFree( mem3 );
    333    
     333
    334334    if ( allocCallbackCalled != 2 || freeCallbackCalled != 2 ) {
    335             psError( __FILE__, "alloc/free callbacks were not called the proper number of times in %s",
    336                      __func__ );
    337             return 1;
    338         }
    339        
     335        psError( __FILE__, "alloc/free callbacks were not called the proper number of times in %s",
     336                 __func__ );
     337        return 1;
     338    }
     339
    340340    allocCallbackCalled = 0;
    341341    freeCallbackCalled = 0;
    342    
     342
    343343    mark = psMemGetId();
    344    
     344
    345345    mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    346    
     346
    347347    psMemAllocateCallbackSetID( mark );
    348    
     348
    349349    mem1 = ( int* ) psRealloc( mem1, initialSize * 2 * sizeof( int ) );
    350    
     350
    351351    psFree( mem1 );
    352    
     352
    353353    if ( allocCallbackCalled != 2 ) {
    354             psError( __FILE__, "realloc callbacks were not called the proper number of times in %s",
    355                      __func__ );
    356             return 1;
    357         }
    358        
    359     return 0;
    360    
     354        psError( __FILE__, "realloc callbacks were not called the proper number of times in %s",
     355                 __func__ );
     356        return 1;
     357    }
     358
     359    return 0;
     360
    361361}
    362362
     
    370370    int nLeaks = 0;
    371371    int lineMark = 0;
    372    
     372
    373373    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckLeaks shall return the number of blocks above an ID "
    374374              "that are still allocated" );
    375              
     375
    376376    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    377             lineMark = __LINE__ + 1;
    378             buffers[ lcv ] = psAlloc( sizeof( int ) );
    379         }
    380        
     377        lineMark = __LINE__ + 1;
     378        buffers[ lcv ] = psAlloc( sizeof( int ) );
     379    }
     380
    381381    for ( lcv = 1;lcv < numBuffers;lcv++ ) {
     382        psFree( buffers[ lcv ] );
     383    }
     384
     385    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one instance." );
     386
     387    nLeaks = psMemCheckLeaks( currentId, &blks, stderr );
     388
     389    if ( nLeaks != 1 ) {
     390        psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
     391        return 1;
     392    }
     393
     394    if ( blks[ 0 ] ->lineno != lineMark ) {
     395        psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.",
     396                 lineMark, blks[ 0 ] ->lineno, __func__ );
     397        return 1;
     398    }
     399
     400    psFree( buffers[ 0 ] );
     401    psFree( blks );
     402
     403    psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with a different leak location" );
     404    psMemCheckLeaks( currentId, NULL, stderr );
     405
     406    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
     407        lineMark = __LINE__ + 1;
     408        buffers[ lcv ] = psAlloc( sizeof( int ) );
     409    }
     410
     411    for ( lcv = 0;lcv < numBuffers - 1;lcv++ ) {
     412        psFree( buffers[ lcv ] );
     413    }
     414
     415    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one error." );
     416
     417    nLeaks = psMemCheckLeaks( currentId, &blks, stderr );
     418
     419    if ( nLeaks != 1 ) {
     420        psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
     421        return 1;
     422    }
     423
     424    if ( blks[ 0 ] ->lineno != lineMark ) {
     425        psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
     426        return 1;
     427    }
     428
     429    psFree( buffers[ 4 ] );
     430    psFree( blks );
     431
     432    psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with multiple leak locations." );
     433
     434    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
     435        lineMark = __LINE__ + 1;
     436        buffers[ lcv ] = psAlloc( sizeof( int ) );
     437    }
     438
     439    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
     440        if ( lcv % 2 == 0 ) {
    382441            psFree( buffers[ lcv ] );
    383442        }
    384        
    385     psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one instance." );
    386    
     443    }
     444
     445    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce two errors." );
     446
    387447    nLeaks = psMemCheckLeaks( currentId, &blks, stderr );
    388    
    389     if ( nLeaks != 1 ) {
    390             psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
    391             return 1;
    392         }
    393        
     448
     449    if ( nLeaks != 2 ) {
     450        psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
     451        return 1;
     452    }
     453
    394454    if ( blks[ 0 ] ->lineno != lineMark ) {
    395             psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.",
    396                      lineMark, blks[ 0 ] ->lineno, __func__ );
    397             return 1;
    398         }
    399        
    400     psFree( buffers[ 0 ] );
    401     psFree( blks );
    402    
    403     psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with a different leak location" );
    404     psMemCheckLeaks( currentId, NULL, stderr );
    405    
    406     for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    407             lineMark = __LINE__ + 1;
    408             buffers[ lcv ] = psAlloc( sizeof( int ) );
    409         }
    410        
    411     for ( lcv = 0;lcv < numBuffers - 1;lcv++ ) {
    412             psFree( buffers[ lcv ] );
    413         }
    414        
    415     psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one error." );
    416    
    417     nLeaks = psMemCheckLeaks( currentId, &blks, stderr );
    418    
    419     if ( nLeaks != 1 ) {
    420             psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
    421             return 1;
    422         }
    423        
    424     if ( blks[ 0 ] ->lineno != lineMark ) {
    425             psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
    426             return 1;
    427         }
    428        
    429     psFree( buffers[ 4 ] );
    430     psFree( blks );
    431    
    432     psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with multiple leak locations." );
    433    
    434     for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    435             lineMark = __LINE__ + 1;
    436             buffers[ lcv ] = psAlloc( sizeof( int ) );
    437         }
    438        
    439     for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    440             if ( lcv % 2 == 0 ) {
    441                     psFree( buffers[ lcv ] );
    442                 }
    443         }
    444        
    445     psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce two errors." );
    446    
    447     nLeaks = psMemCheckLeaks( currentId, &blks, stderr );
    448    
    449     if ( nLeaks != 2 ) {
    450             psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
    451             return 1;
    452         }
    453        
    454     if ( blks[ 0 ] ->lineno != lineMark ) {
    455             psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
    456             return 1;
    457         }
    458        
     455        psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
     456        return 1;
     457    }
     458
    459459    psFree( blks );
    460460    psFree( buffers[ 1 ] );
    461461    psFree( buffers[ 3 ] );
    462    
     462
    463463    return 0;
    464464}
     
    470470    int corruptions = 0;
    471471    psMemProblemCallback cb;
    472    
     472
    473473    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption shall detect memory corruptions" );
    474    
     474
    475475    buffer = psAlloc( sizeof( int ) );
    476    
     476
    477477    // cause memory corruption via buffer underflow
    478478    *buffer = 1;
     
    480480    oldValue = *buffer;
    481481    *buffer = 2;
    482    
     482
    483483    problemCallbackCalled = 0;
    484484    cb = psMemProblemCallbackSet( memProblemCallback );
    485    
     485
    486486    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption should output an error message and "
    487487              "memProblemCallback callback should be called." );
    488              
     488
    489489    corruptions = psMemCheckCorruption( 0 );
    490    
     490
    491491    // restore the memory problem callback
    492492    psMemProblemCallbackSet( cb );
    493    
     493
    494494    // restore the value, 'uncorrupting' the buffer
    495495    *buffer = oldValue;
    496496    buffer++;
    497    
     497
    498498    psFree( buffer );
    499    
     499
    500500    if ( corruptions != 1 ) {
    501             psError( __FILE__, "Expected one memory corruption but found %d in %s.",
    502                      corruptions, __func__ );
    503             return 1;
    504         }
    505        
     501        psError( __FILE__, "Expected one memory corruption but found %d in %s.",
     502                 corruptions, __func__ );
     503        return 1;
     504    }
     505
    506506    if ( problemCallbackCalled != 1 ) {
    507             psError( __FILE__, "The memProblemCallback was not invoked but should have been in %s",
    508                      __func__ );
    509             return 1;
    510         }
    511        
    512     return 0;
    513    
     507        psError( __FILE__, "The memProblemCallback was not invoked but should have been in %s",
     508                 __func__ );
     509        return 1;
     510    }
     511
     512    return 0;
     513
    514514}
    515515
     
    547547
    548548    void * buffer = psAlloc( 1024 );
    549    
     549
    550550    psFree( buffer );
    551    
     551
    552552    psLogMsg( __func__, PS_LOG_INFO, "Next should be an error about multiple freeing." );
    553553    psFree( buffer );
    554    
    555     return 0;
    556 }
     554
     555    return 0;
     556}
  • trunk/psLib/test/sysUtils/tst_psString.c

    r717 r1406  
    1717 *  @author  Eric Van Alst, MHPCC
    1818 *
    19  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2004-05-18 19:22:35 $
     19 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2004-08-06 22:34:06 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/sysUtils/tst_psStringCopy.c

    r717 r1406  
    1717 *  @author  Eric Van Alst, MHPCC
    1818 *
    19  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2004-05-18 19:22:35 $
     19 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2004-08-06 22:34:06 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Note: See TracChangeset for help on using the changeset viewer.