IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

Location:
trunk/psLib/test/sysUtils
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psAbort.c

    r1701 r2204  
    88 *  @author  Eric Van Alst, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    11  *  @date  $Date: 2004-09-07 21:26:13 $
     10 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     11 *  @date  $Date: 2004-10-27 00:57:33 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1717#include "psTest.h"
    1818
    19 static int testAbort00(void);
    20 static int testAbort01(void);
    21 static int testAbort02(void);
     19static psS32 testAbort00(void);
     20static psS32 testAbort01(void);
     21static psS32 testAbort02(void);
    2222
    2323testDescription tests[] = {
     
    2828                          };
    2929
    30 int main( int argc, char* argv[] )
     30psS32 main( psS32 argc, char* argv[] )
    3131{
    3232    psLogSetLevel( PS_LOG_INFO );
     
    3535}
    3636
    37 static int testAbort00(void)
     37static psS32 testAbort00(void)
    3838{
    39     int   intval = 1;
    40     long  longval = 2;
     39    psS32   intval = 1;
     40    psS64  longval = 2;
    4141    float floatval = 3.01;
    4242    char  charval = 'E';
     
    5454}
    5555
    56 static int testAbort01(void)
     56static psS32 testAbort01(void)
    5757{
    5858    // Test point #2 String values in abort message
     
    6565}
    6666
    67 static int testAbort02(void)
     67static psS32 testAbort02(void)
    6868{
    6969    // Test point #2 String values in abort message
  • trunk/psLib/test/sysUtils/tst_psError.c

    r2129 r2204  
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-10-14 21:14:58 $
     15 *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-10-27 00:57:33 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "psTest.h"
    2727
    28 static int testError00(void);
    29 static int testError01(void);
    30 static int testError02(void);
    31 static int testError03(void);
    32 static int testError04(void);
    33 static int testError05(void);
    34 static int testErrorRegister(void);
     28static psS32 testError00(void);
     29static psS32 testError01(void);
     30static psS32 testError02(void);
     31static psS32 testError03(void);
     32static psS32 testError04(void);
     33static psS32 testError05(void);
     34static psS32 testErrorRegister(void);
    3535
    3636// Function used in testError02 to verify the psErrorStackPrintV function
     
    5858                          };
    5959
    60 int main( int argc, char* argv[] )
     60psS32 main( psS32 argc, char* argv[] )
    6161{
    6262    psLogSetLevel( PS_LOG_INFO );
     
    6565}
    6666
    67 static int testError05(void)
     67static psS32 testError05(void)
    6868{
    6969    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
     
    8181}
    8282
    83 static int testError04(void)
     83static psS32 testError04(void)
    8484{
    8585    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
     
    134134}
    135135
    136 static int testError03(void)
     136static psS32 testError03(void)
    137137{
    138138    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
     
    214214}
    215215
    216 static int testError02(void)
     216static psS32 testError02(void)
    217217{
    218218    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
     
    228228}
    229229
    230 static int testError01(void)
     230static psS32 testError01(void)
    231231{
    232232    psErrorCode code=PS_ERR_BAD_PARAMETER_VALUE;
     
    277277}
    278278
    279 static int testError00(void)
    280 {
    281 
    282     int  intval=1;
    283     long longval = 2;
     279static psS32 testError00(void)
     280{
     281
     282    psS32  intval=1;
     283    psS64 longval = 2;
    284284    float floatval = 3.01;
    285285    char  charval = 'E';
     
    300300}
    301301
    302 static int testErrorRegister(void)
    303 {
    304 
    305     int numErr = 4;
     302static psS32 testErrorRegister(void)
     303{
     304
     305    psS32 numErr = 4;
    306306    psErrorDescription errDesc[] = { {PS_ERR_N_ERR_CLASSES+1,"first"},
    307307                                     {PS_ERR_N_ERR_CLASSES+2,"second"},
     
    314314    psErrorRegister(errDesc,numErr);
    315315
    316     for (int i = 0; i < numErr; i++) {
     316    for (psS32 i = 0; i < numErr; i++) {
    317317        const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
    318318        if (desc == NULL) {
  • trunk/psLib/test/sysUtils/tst_psLogMsg.c

    r1702 r2204  
    88#include "psTest.h"
    99
    10 static int testLogMsg00();
    11 static int testLogMsg01();
    12 static int testLogMsg02();
    13 static int testLogMsg03();
    14 static int testLogMsg04();
    15 static int testLogMsg05();
     10static psS32 testLogMsg00();
     11static psS32 testLogMsg01();
     12static psS32 testLogMsg02();
     13static psS32 testLogMsg03();
     14static psS32 testLogMsg04();
     15static psS32 testLogMsg05();
    1616
    1717testDescription tests[] = {
     
    3939                          };
    4040
    41 int main( int argc, char* argv[] )
     41psS32 main( psS32 argc, char* argv[] )
    4242{
    4343    psLogSetLevel( PS_LOG_INFO );
     
    4848
    4949static void myLogMsg(const char *name,
    50                      int level,
     50                     psS32 level,
    5151                     const char *fmt,
    5252                     ...)
     
    6060}
    6161
    62 static int testLogMsg00()
    63 {
    64     int i = 0;
     62static psS32 testLogMsg00()
     63{
     64    psS32 i = 0;
    6565
    6666    // Send a log messages for levels 0:9.  Only the first four messages
     
    7474}
    7575
    76 static int testLogMsg01()
    77 {
    78     int i = 0;
     76static psS32 testLogMsg01()
     77{
     78    psS32 i = 0;
    7979
    8080    // Send a log messages for levels 0:9.  Only the first four messages
     
    8888}
    8989
    90 static int testLogMsg02()
     90static psS32 testLogMsg02()
    9191{
    9292
    9393    psLogSetLevel(9);
    9494    // Send a log messages for levels 0:9.
    95     for (int i=0;i<10;i++) {
     95    for (psS32 i=0;i<10;i++) {
    9696        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
    9797    }
     
    105105}
    106106
    107 static int testLogMsg03()
    108 {
    109     int i;
     107static psS32 testLogMsg03()
     108{
     109    psS32 i;
    110110
    111111    fprintf(stderr,"------------- psLogSetFormat() -------------\n");
     
    161161
    162162
    163 int testLogMsg04()
     163psS32 testLogMsg04()
    164164{
    165165    psLogMsg("Under 15 chars", 0, "Hello World!\n");
     
    173173}
    174174
    175 int testLogMsg05()
    176 {
    177     int i = 0;
     175psS32 testLogMsg05()
     176{
     177    psS32 i = 0;
    178178    FILE* file;
    179179    char line[256];
  • trunk/psLib/test/sysUtils/tst_psMemory.c

    r1811 r2204  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-09-14 23:55:47 $
     8*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-10-27 00:57:33 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "pslib.h"
    2727
    28 static int TPFreeReferencedMemory( void );
    29 static int TPOutOfMemory( void );
    30 static int TPReallocOutOfMemory( void );
    31 static void* TPOutOfMemoryExhaustedCallback( size_t size );
    32 static int TPCheckBufferPositive( void );
    33 static int TPrealloc( void );
    34 static int TPallocCallback( void );
     28static psS32 TPFreeReferencedMemory( void );
     29static psS32 TPOutOfMemory( void );
     30static psS32 TPReallocOutOfMemory( void );
     31static psPtr TPOutOfMemoryExhaustedCallback( size_t size );
     32static psS32 TPCheckBufferPositive( void );
     33static psS32 TPrealloc( void );
     34static psS32 TPallocCallback( void );
    3535static psMemoryId memAllocateCallback( const psMemBlock *ptr );
    3636static psMemoryId memFreeCallback( const psMemBlock *ptr );
    37 static int TPcheckLeaks( void );
    38 static int TPmemCorruption( void );
    39 static int TPmultipleFree( void );
    40 void memProblemCallback( const psMemBlock *ptr, const char *file, int lineno );
    41 
    42 static int problemCallbackCalled = 0;
    43 static int allocCallbackCalled = 0;
    44 static int freeCallbackCalled = 0;
    45 static int exhaustedCallbackCalled = 0;
     37static psS32 TPcheckLeaks( void );
     38static psS32 TPmemCorruption( void );
     39static psS32 TPmultipleFree( void );
     40void memProblemCallback( const psMemBlock *ptr, const char *file, psS32 lineno );
     41
     42static psS32 problemCallbackCalled = 0;
     43static psS32 allocCallbackCalled = 0;
     44static psS32 freeCallbackCalled = 0;
     45static psS32 exhaustedCallbackCalled = 0;
    4646
    4747testDescription tests[] = {
     
    8181                          };
    8282
    83 int main( int argc, char* argv[] )
     83psS32 main( psS32 argc, char* argv[] )
    8484{
    8585    psLogSetLevel( PS_LOG_INFO );
     
    8989
    9090// Testpoint #449, psAlloc shall allocate memory blocks writeable by caller.
    91 int TPCheckBufferPositive( void )
    92 {
    93     int * mem;
    94     const int size = 100;
    95     int failed = 0;
     91psS32 TPCheckBufferPositive( void )
     92{
     93    psS32 * mem;
     94    const psS32 size = 100;
     95    psS32 failed = 0;
    9696
    9797    psLogMsg( __func__, PS_LOG_INFO, "psAlloc shall allocate memory blocks writeable by caller.\n" );
    9898
    99     mem = ( int* ) psAlloc( size * sizeof( int ) );
     99    mem = ( psS32* ) psAlloc( size * sizeof( psS32 ) );
    100100    if ( mem == NULL ) {
    101101        psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ );
     
    103103    }
    104104
    105     for ( int index = 0;index < size;index++ ) {
     105    for ( psS32 index = 0;index < size;index++ ) {
    106106        mem[ index ] = index;
    107107    }
    108108
    109     for ( int index = 0;index < size;index++ ) {
     109    for ( psS32 index = 0;index < size;index++ ) {
    110110        if ( mem[ index ] != index ) {
    111111            failed++;
     
    118118}
    119119
    120 int TPFreeReferencedMemory( void )
     120psS32 TPFreeReferencedMemory( void )
    121121{
    122122    // create memory
    123     int * mem;
    124     int ref = 0;
     123    psS32 * mem;
     124    psS32 ref = 0;
    125125
    126126    psLogMsg( __func__, PS_LOG_INFO, "memory reference count shall be incrementable/decrementable" );
    127127
    128     mem = ( int* ) psAlloc( 100 * sizeof( int ) );
     128    mem = ( psS32* ) psAlloc( 100 * sizeof( psS32 ) );
    129129
    130130    ref = psMemGetRefCounter( mem );
     
    170170// Bug/Task #562 regression test.  Upon requesting more memory than is available, psRealloc shall call
    171171// the psMemExhaustedCallback.
    172 int TPReallocOutOfMemory( void )
    173 {
    174     int * mem[ 100 ];
     172psS32 TPReallocOutOfMemory( void )
     173{
     174    psS32 * mem[ 100 ];
    175175    psMemExhaustedCallback cb;
    176176
    177     for ( int lcv = 0; lcv < 100; lcv++ ) {
     177    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
    178178        mem[ lcv ] = NULL;
    179179    }
     
    186186    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
    187187
    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/2 - 1000 );
     188    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
     189        mem[ lcv ] = ( psS32* ) psAlloc( 10 );
     190    }
     191
     192    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
     193        mem[ lcv ] = ( psS32* ) psRealloc( mem[ lcv ], SIZE_MAX/2 - 1000 );
    194194    }
    195195
     
    201201    }
    202202
    203     for ( int lcv = 0; lcv < 100; lcv++ ) {
     203    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
    204204        psFree( mem[ lcv ] );
    205205    }
     
    209209// Testpoint #450,  Upon requesting more memory than is available, psalloc shall call
    210210// the psMemExhaustedCallback.
    211 int TPOutOfMemory( void )
    212 {
    213     int * mem[ 100 ];
     211psS32 TPOutOfMemory( void )
     212{
     213    psS32 * mem[ 100 ];
    214214    psMemExhaustedCallback cb;
    215215
    216     for ( int lcv = 0; lcv < 100; lcv++ ) {
     216    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
    217217        mem[ lcv ] = NULL;
    218218    }
     
    225225    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
    226226
    227     for ( int lcv = 0; lcv < 100; lcv++ ) {
    228         mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX/2 - 1000 );
     227    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
     228        mem[ lcv ] = ( psS32* ) psAlloc( SIZE_MAX/2 - 1000 );
    229229    }
    230230
     
    236236    }
    237237
    238     for ( int lcv = 0; lcv < 100; lcv++ ) {
     238    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
    239239        psFree( mem[ lcv ] );
    240240    }
     
    244244
    245245// Testpoint #451,  psRealloc shall increase/decrease memory buffer while preserving contents
    246 int TPrealloc( void )
    247 {
    248     int * mem1;
    249     int* mem2;
    250     int* mem3;
    251     const int initialSize = 100;
     246psS32 TPrealloc( void )
     247{
     248    psS32 * mem1;
     249    psS32* mem2;
     250    psS32* mem3;
     251    const psS32 initialSize = 100;
    252252
    253253    psLogMsg( __func__, PS_LOG_INFO, "psRealloc shall increase/decrease memory buffer while "
     
    255255
    256256    // allocate buffer with known values.
    257     mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    258     mem2 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    259     mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    260     for ( int lcv = 0;lcv < initialSize;lcv++ ) {
     257    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
     258    mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
     259    mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
     260    for ( psS32 lcv = 0;lcv < initialSize;lcv++ ) {
    261261        mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv;
    262262    }
     
    266266
    267267    // realloc to 2x
    268     mem1 = ( int* ) psRealloc( mem1, 2 * initialSize * sizeof( int ) );
    269     mem2 = ( int* ) psRealloc( mem2, 2 * initialSize * sizeof( int ) );
    270     mem3 = ( int* ) psRealloc( mem3, 2 * initialSize * sizeof( int ) );
     268    mem1 = ( psS32* ) psRealloc( mem1, 2 * initialSize * sizeof( psS32 ) );
     269    mem2 = ( psS32* ) psRealloc( mem2, 2 * initialSize * sizeof( psS32 ) );
     270    mem3 = ( psS32* ) psRealloc( mem3, 2 * initialSize * sizeof( psS32 ) );
    271271
    272272    // check values of initial block
    273     for ( int i = 0;i < initialSize;i++ ) {
     273    for ( psS32 i = 0;i < initialSize;i++ ) {
    274274        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
    275275            psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.",
     
    283283
    284284    // realloc to 1/2 initial value.
    285     mem1 = ( int* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( int ) );
    286     mem2 = ( int* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( int ) );
    287     mem3 = ( int* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( int ) );
     285    mem1 = ( psS32* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( psS32 ) );
     286    mem2 = ( psS32* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( psS32 ) );
     287    mem3 = ( psS32* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( psS32 ) );
    288288
    289289    // check values of initial block
    290     for ( int i = 0;i < initialSize / 2;i++ ) {
     290    for ( psS32 i = 0;i < initialSize / 2;i++ ) {
    291291        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
    292292            psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.",
     
    303303}
    304304
    305 int TPallocCallback( void )
    306 {
    307     int * mem1;
    308     int* mem2;
    309     int* mem3;
    310     int currentId = psMemGetId();
    311     const int initialSize = 100;
    312     int mark;
     305psS32 TPallocCallback( void )
     306{
     307    psS32 * mem1;
     308    psS32* mem2;
     309    psS32* mem3;
     310    psS32 currentId = psMemGetId();
     311    const psS32 initialSize = 100;
     312    psS32 mark;
    313313
    314314    allocCallbackCalled = 0;
     
    324324
    325325    // allocate buffer with known values.
    326     mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    327     mem2 = ( int* ) psAlloc( initialSize * sizeof( int ) );
    328     mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) );
     326    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
     327    mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
     328    mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
    329329
    330330    psFree( mem1 );
     
    343343    mark = psMemGetId();
    344344
    345     mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) );
     345    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
    346346
    347347    psMemAllocateCallbackSetID( mark );
    348348
    349     mem1 = ( int* ) psRealloc( mem1, initialSize * 2 * sizeof( int ) );
     349    mem1 = ( psS32* ) psRealloc( mem1, initialSize * 2 * sizeof( psS32 ) );
    350350
    351351    psFree( mem1 );
     
    361361}
    362362
    363 int TPcheckLeaks( void )
    364 {
    365     const int numBuffers = 5;
    366     int* buffers[ 5 ];
    367     int lcv;
    368     int currentId = psMemGetId();
     363psS32 TPcheckLeaks( void )
     364{
     365    const psS32 numBuffers = 5;
     366    psS32* buffers[ 5 ];
     367    psS32 lcv;
     368    psS32 currentId = psMemGetId();
    369369    psMemBlock** blks;
    370     int nLeaks = 0;
    371     int lineMark = 0;
     370    psS32 nLeaks = 0;
     371    psS32 lineMark = 0;
    372372
    373373    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckLeaks shall return the number of blocks above an ID "
     
    376376    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    377377        lineMark = __LINE__ + 1;
    378         buffers[ lcv ] = psAlloc( sizeof( int ) );
     378        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
    379379    }
    380380
     
    406406    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    407407        lineMark = __LINE__ + 1;
    408         buffers[ lcv ] = psAlloc( sizeof( int ) );
     408        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
    409409    }
    410410
     
    434434    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
    435435        lineMark = __LINE__ + 1;
    436         buffers[ lcv ] = psAlloc( sizeof( int ) );
     436        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
    437437    }
    438438
     
    464464}
    465465
    466 int TPmemCorruption( void )
    467 {
    468     int * buffer = NULL;
    469     int oldValue = 0;
    470     int corruptions = 0;
     466psS32 TPmemCorruption( void )
     467{
     468    psS32 * buffer = NULL;
     469    psS32 oldValue = 0;
     470    psS32 corruptions = 0;
    471471    psMemProblemCallback cb;
    472472
    473473    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption shall detect memory corruptions" );
    474474
    475     buffer = psAlloc( sizeof( int ) );
     475    buffer = psAlloc( sizeof( psS32 ) );
    476476
    477477    // cause memory corruption via buffer underflow
     
    514514}
    515515
    516 void memProblemCallback( const psMemBlock *ptr, const char *file, int lineno )
     516void memProblemCallback( const psMemBlock *ptr, const char *file, psS32 lineno )
    517517{
    518518    psLogMsg( __func__, PS_LOG_INFO, "memory callback called for id %d (%s:%d).",
     
    536536}
    537537
    538 void* TPOutOfMemoryExhaustedCallback( size_t size )
     538psPtr TPOutOfMemoryExhaustedCallback( size_t size )
    539539{
    540540    psLogMsg( __func__, PS_LOG_INFO, "Custom MemExhaustedCallback was invoked." );
     
    543543}
    544544
    545 int TPmultipleFree( void )
    546 {
    547 
    548     void * buffer = psAlloc( 1024 );
     545psS32 TPmultipleFree( void )
     546{
     547
     548    psPtr buffer = psAlloc( 1024 );
    549549
    550550    psFree( buffer );
  • trunk/psLib/test/sysUtils/tst_psString.c

    r1977 r2204  
    1717 *  @author  Eric Van Alst, MHPCC
    1818 *
    19  *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2004-10-06 01:59:08 $
     19 *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2004-10-27 00:57:33 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psTest.h"
    2929
    30 static int testStringCopy00(void);
    31 static int testStringCopy01(void);
    32 static int testStringCopy02(void);
    33 static int testStringCopy03(void);
    34 static int testStringCopy04(void);
    35 static int testStringCopy05(void);
    36 static int testStringCopy06(void);
     30static psS32 testStringCopy00(void);
     31static psS32 testStringCopy01(void);
     32static psS32 testStringCopy02(void);
     33static psS32 testStringCopy03(void);
     34static psS32 testStringCopy04(void);
     35static psS32 testStringCopy05(void);
     36static psS32 testStringCopy06(void);
    3737
    3838testDescription tests[] = {
     
    4747                          };
    4848
    49 int main( int argc, char* argv[] )
     49psS32 main( psS32 argc, char* argv[] )
    5050{
    5151    psLogSetLevel( PS_LOG_INFO );
     
    5555
    5656/*
    57 int main( int argc,
     57psS32 main( psS32 argc,
    5858          char * argv[] )
    5959{
    60     bool  tpResult = false;
     60    psBool  tpResult = false;
    6161    char  stringval[20] = "E R R O R";
    6262    char  stringval1[20] = "e r r o r";
    6363    char  *stringvalnocopy = "F A I L";
    6464    char  *substringval = "e r r";
    65     int   substringlen = 6;
     65    psS32   substringlen = 6;
    6666    char  *emptyval = "";
    67     int   tpFails = 0;
    68     char  *strResult;
    69     int   increaseSize = 5;
    70     int   negativeSize = -5;
    71     int   result = 0;
    72     int   result1 = 0;
    73     int   memBlockAllocated = 0;
     67    psS32   tpFails = 0;
     68    char  *strResult;
     69    psS32   increaseSize = 5;
     70    psS32   negativeSize = -5;
     71    psS32   result = 0;
     72    psS32   result1 = 0;
     73    psS32   memBlockAllocated = 0;
    7474    psMemBlock ***memBlockPtr = NULL;
    7575 
    7676*/
    7777
    78 static int testStringCopy00(void)
    79 {
    80     char  stringval[20] = "E R R O R";
    81     int   result = 0;
    82     int   result1 = 0;
     78static psS32 testStringCopy00(void)
     79{
     80    char  stringval[20] = "E R R O R";
     81    psS32   result = 0;
     82    psS32   result1 = 0;
    8383    char  *strResult;
    8484
     
    107107}
    108108
    109 static int testStringCopy01(void)
     109static psS32 testStringCopy01(void)
    110110{
    111111    char  *emptyval = "";
    112     int   result = 0;
     112    psS32   result = 0;
    113113    char  *strResult;
    114114
     
    130130}
    131131
    132 static int testStringCopy02(void)
    133 {
    134     int   result = 0;
    135     int   result1 = 0;
     132static psS32 testStringCopy02(void)
     133{
     134    psS32   result = 0;
     135    psS32   result1 = 0;
    136136    char  *strResult;
    137137    char  stringval1[20] = "e r r o r";
    138     int   substringlen = 5;
     138    psS32   substringlen = 5;
    139139    char  *substringval = "e r r";
    140140
     
    161161}
    162162
    163 static int testStringCopy03(void)
    164 {
    165     int   result = 0;
    166     int   result1 = 0;
     163static psS32 testStringCopy03(void)
     164{
     165    psS32   result = 0;
     166    psS32   result1 = 0;
    167167    char  *strResult;
    168168    char  *stringvalnocopy = "F A I L";
     
    185185}
    186186
    187 static int testStringCopy04(void)
    188 {
    189     int   result = 0;
    190     int   result1 = 0;
    191     char  *strResult;
    192     char  stringval[20] = "E R R O R";
    193     int   increaseSize = 5;
     187static psS32 testStringCopy04(void)
     188{
     189    psS32   result = 0;
     190    psS32   result1 = 0;
     191    char  *strResult;
     192    char  stringval[20] = "E R R O R";
     193    psS32   increaseSize = 5;
    194194
    195195    // Test point #5 Copy string to larger string - psStringNCopy
     
    205205                strResult, stringval);
    206206        fprintf(stderr,"                     strlne result = %d expected %d\n",result1,
    207                 (int)strlen(stringval));
     207                (psS32)strlen(stringval));
    208208        return 1;
    209209    }
     
    214214}
    215215
    216 static int testStringCopy05(void)
    217 {
    218     char  *strResult;
    219     char  stringval[20] = "E R R O R";
    220     int   negativeSize = -5;
     216static psS32 testStringCopy05(void)
     217{
     218    char  *strResult;
     219    char  stringval[20] = "E R R O R";
     220    psS32   negativeSize = -5;
    221221
    222222    // Test point #6 Copy string with negative size - psStringNCopy
     
    224224    if ( strResult != NULL ) {
    225225        fprintf(stderr,"Failed test point #6 return value = %ld expected NULL\n",
    226                 (unsigned long)strResult);
     226                (psU64)strResult);
    227227        return 1;
    228228    }
     
    232232}
    233233
    234 static int testStringCopy06(void)
    235 {
    236     char  *strResult;
    237     char  stringval[20] = "E R R O R";
    238     int   result = 0;
     234static psS32 testStringCopy06(void)
     235{
     236    char  *strResult;
     237    char  stringval[20] = "E R R O R";
     238    psS32   result = 0;
    239239
    240240    // Test point #7 Verify creation of string literal - PS_STRING
  • trunk/psLib/test/sysUtils/tst_psStringCopy.c

    r1977 r2204  
    1717 *  @author  Eric Van Alst, MHPCC
    1818 *
    19  *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2004-10-06 01:59:08 $
     19 *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2004-10-27 00:57:33 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psTest.h"
    2929
    30 static int testStringCopy00(void);
    31 static int testStringCopy01(void);
    32 static int testStringCopy02(void);
    33 static int testStringCopy03(void);
    34 static int testStringCopy04(void);
    35 static int testStringCopy05(void);
    36 static int testStringCopy06(void);
     30static psS32 testStringCopy00(void);
     31static psS32 testStringCopy01(void);
     32static psS32 testStringCopy02(void);
     33static psS32 testStringCopy03(void);
     34static psS32 testStringCopy04(void);
     35static psS32 testStringCopy05(void);
     36static psS32 testStringCopy06(void);
    3737
    3838testDescription tests[] = {
     
    4747                          };
    4848
    49 int main( int argc, char* argv[] )
     49psS32 main( psS32 argc, char* argv[] )
    5050{
    5151    psLogSetLevel( PS_LOG_INFO );
     
    5555
    5656/*
    57 int main( int argc,
     57psS32 main( psS32 argc,
    5858          char * argv[] )
    5959{
    60     bool  tpResult = false;
     60    psBool  tpResult = false;
    6161    char  stringval[20] = "E R R O R";
    6262    char  stringval1[20] = "e r r o r";
    6363    char  *stringvalnocopy = "F A I L";
    6464    char  *substringval = "e r r";
    65     int   substringlen = 6;
     65    psS32   substringlen = 6;
    6666    char  *emptyval = "";
    67     int   tpFails = 0;
    68     char  *strResult;
    69     int   increaseSize = 5;
    70     int   negativeSize = -5;
    71     int   result = 0;
    72     int   result1 = 0;
    73     int   memBlockAllocated = 0;
     67    psS32   tpFails = 0;
     68    char  *strResult;
     69    psS32   increaseSize = 5;
     70    psS32   negativeSize = -5;
     71    psS32   result = 0;
     72    psS32   result1 = 0;
     73    psS32   memBlockAllocated = 0;
    7474    psMemBlock ***memBlockPtr = NULL;
    7575 
    7676*/
    7777
    78 static int testStringCopy00(void)
    79 {
    80     char  stringval[20] = "E R R O R";
    81     int   result = 0;
    82     int   result1 = 0;
     78static psS32 testStringCopy00(void)
     79{
     80    char  stringval[20] = "E R R O R";
     81    psS32   result = 0;
     82    psS32   result1 = 0;
    8383    char  *strResult;
    8484
     
    107107}
    108108
    109 static int testStringCopy01(void)
     109static psS32 testStringCopy01(void)
    110110{
    111111    char  *emptyval = "";
    112     int   result = 0;
     112    psS32   result = 0;
    113113    char  *strResult;
    114114
     
    130130}
    131131
    132 static int testStringCopy02(void)
    133 {
    134     int   result = 0;
    135     int   result1 = 0;
     132static psS32 testStringCopy02(void)
     133{
     134    psS32   result = 0;
     135    psS32   result1 = 0;
    136136    char  *strResult;
    137137    char  stringval1[20] = "e r r o r";
    138     int   substringlen = 5;
     138    psS32   substringlen = 5;
    139139    char  *substringval = "e r r";
    140140
     
    161161}
    162162
    163 static int testStringCopy03(void)
    164 {
    165     int   result = 0;
    166     int   result1 = 0;
     163static psS32 testStringCopy03(void)
     164{
     165    psS32   result = 0;
     166    psS32   result1 = 0;
    167167    char  *strResult;
    168168    char  *stringvalnocopy = "F A I L";
     
    185185}
    186186
    187 static int testStringCopy04(void)
    188 {
    189     int   result = 0;
    190     int   result1 = 0;
    191     char  *strResult;
    192     char  stringval[20] = "E R R O R";
    193     int   increaseSize = 5;
     187static psS32 testStringCopy04(void)
     188{
     189    psS32   result = 0;
     190    psS32   result1 = 0;
     191    char  *strResult;
     192    char  stringval[20] = "E R R O R";
     193    psS32   increaseSize = 5;
    194194
    195195    // Test point #5 Copy string to larger string - psStringNCopy
     
    205205                strResult, stringval);
    206206        fprintf(stderr,"                     strlne result = %d expected %d\n",result1,
    207                 (int)strlen(stringval));
     207                (psS32)strlen(stringval));
    208208        return 1;
    209209    }
     
    214214}
    215215
    216 static int testStringCopy05(void)
    217 {
    218     char  *strResult;
    219     char  stringval[20] = "E R R O R";
    220     int   negativeSize = -5;
     216static psS32 testStringCopy05(void)
     217{
     218    char  *strResult;
     219    char  stringval[20] = "E R R O R";
     220    psS32   negativeSize = -5;
    221221
    222222    // Test point #6 Copy string with negative size - psStringNCopy
     
    224224    if ( strResult != NULL ) {
    225225        fprintf(stderr,"Failed test point #6 return value = %ld expected NULL\n",
    226                 (unsigned long)strResult);
     226                (psU64)strResult);
    227227        return 1;
    228228    }
     
    232232}
    233233
    234 static int testStringCopy06(void)
    235 {
    236     char  *strResult;
    237     char  stringval[20] = "E R R O R";
    238     int   result = 0;
     234static psS32 testStringCopy06(void)
     235{
     236    char  *strResult;
     237    char  stringval[20] = "E R R O R";
     238    psS32   result = 0;
    239239
    240240    // Test point #7 Verify creation of string literal - PS_STRING
  • trunk/psLib/test/sysUtils/tst_psTrace.c

    r2202 r2204  
    1010
    1111
    12 static int testTrace00(void);
    13 static int testTrace01(void);
    14 static int testTrace02(void);
    15 static int testTrace03(void);
    16 static int testTrace04(void);
    17 static int testTrace05(void);
    18 static int testTrace05a(void);
    19 static int testTrace06(void);
    20 static int testTrace08(void);
     12static psS32 testTrace00(void);
     13static psS32 testTrace01(void);
     14static psS32 testTrace02(void);
     15static psS32 testTrace03(void);
     16static psS32 testTrace04(void);
     17static psS32 testTrace05(void);
     18static psS32 testTrace05a(void);
     19static psS32 testTrace06(void);
     20static psS32 testTrace08(void);
    2121
    2222testDescription tests[] = {
     
    3737                           };
    3838
    39 int main( int argc, char* argv[] )
     39psS32 main( psS32 argc, char* argv[] )
    4040{
    4141    psLogSetLevel( PS_LOG_INFO );
     
    4444}
    4545
    46 static int testTrace00(void)
    47 {
    48     int i;
    49     int lev = 0;
     46static psS32 testTrace00(void)
     47{
     48    psS32 i;
     49    psS32 lev = 0;
    5050
    5151    psTraceSetDestination(stderr);
     
    9494}
    9595
    96 static int testTrace01(void)
     96static psS32 testTrace01(void)
    9797{
    9898    psTraceSetDestination(stderr);
     
    104104}
    105105
    106 static int testTrace02(void)
     106static psS32 testTrace02(void)
    107107{
    108108    psTraceReset();
     
    133133}
    134134
    135 static int testTrace03(void)
    136 {
    137     int i = 0;
    138     int lev = 0;
     135static psS32 testTrace03(void)
     136{
     137    psS32 i = 0;
     138    psS32 lev = 0;
    139139
    140140    psTraceSetDestination(stderr);
     
    176176
    177177
    178 static int testTrace04(void)
     178static psS32 testTrace04(void)
    179179{
    180180    FILE *fp;
    181     int nb = 0;
     181    psS32 nb = 0;
    182182
    183183    fp = fopen("tst_psTrace02_OUT", "w");
     
    221221}
    222222
    223 static int testTrace05(void)
     223static psS32 testTrace05(void)
    224224{
    225225    psTraceSetDestination(stderr);
     
    247247}
    248248
    249 static int testTrace05a(void)
     249static psS32 testTrace05a(void)
    250250{
    251251    (void)psTraceSetLevel(".", 9);
     
    271271}
    272272
    273 static int testTrace06(void)
     273static psS32 testTrace06(void)
    274274{
    275275    psTraceSetDestination(stderr);
     
    311311
    312312// Ensure that the leading dot in the component names are optional.
    313 static int testTrace08(void)
     313static psS32 testTrace08(void)
    314314{
    315315    psTraceReset();
  • trunk/psLib/test/sysUtils/verified/tst_psTrace.stderr

    r2110 r2204  
    2525/***************************** TESTPOINT ******************************************\
    2626*             TestFile: tst_psTrace.c                                              *
    27 *            TestPoint: psTrace{psTraceSetLevel(): test static inheritance}        *
     27*            TestPoint: psTrace{psTraceSetLevel(): test static/dynamic inheritance} *
    2828*             TestType: Positive                                                   *
    2929\**********************************************************************************/
     
    4242     E               5
    4343
    44 ---> TESTPOINT PASSED (psTrace{psTraceSetLevel(): test static inheritance} | tst_psTrace.c)
     44---> TESTPOINT PASSED (psTrace{psTraceSetLevel(): test static/dynamic inheritance} | tst_psTrace.c)
    4545
    4646/***************************** TESTPOINT ******************************************\
Note: See TracChangeset for help on using the changeset viewer.