IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 23, 2005, 2:17:44 PM (21 years ago)
Author:
drobbin
Message:

Updated, fixed, and added error tests to the Set/Get functions & tests

Location:
trunk/psLib/test/types
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/types/tst_psArray.c

    r4898 r5114  
    1717 *  @author  Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2005-08-30 01:14:13 $
     19 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2005-09-24 00:17:44 $
    2121 *
    2222 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252static psS32 testArray01( void );
    5353static psS32 testArrayAdd( void );
     54static psS32 testArrayGetSet( void );
    5455
    5556
     
    5859                              {testArray01, -2, "psArray", 0, false},
    5960                              {testArrayAdd, 788, "psArrayAdd", 0, false},
     61                              {testArrayGetSet, -3, "psArrayGetSet", 0, false},
    6062                              {NULL}
    6163                          };
     
    440442    return 0;  // the value that indicates success is part of the testDescription
    441443}
     444
     445psS32 testArrayGetSet( void )
     446{
     447    psArray *test;
     448    int *p1 = psAlloc(sizeof(int));
     449    int *p2 = psAlloc(sizeof(int));
     450    int *p3 = psAlloc(sizeof(int));
     451    test = psArrayAlloc(5);
     452    test->n = 0;
     453    *p1 = 10;
     454    *p2 = 4;
     455    *p3 = 666;
     456
     457    if ( !psArraySet(test, 0, p1) )
     458        fprintf(stderr, "ArraySet failed to set S32 at position 0\n");
     459    if ( psArraySet(test, 10, p1) )
     460        fprintf(stderr, "ArraySet Improperly set S32 at out of range position\n");
     461    if ( !psArraySet(test, 1, p2) )
     462        fprintf(stderr, "ArraySet Failed to set S32 at position 1\n");
     463    if ( psArrayGet(test, 0) != p1 )
     464        fprintf(stderr, "ArrayGet Failed to return the correct S32 from position 0\n");
     465    if ( psArrayGet(test, -1) != p2)
     466        fprintf(stderr, "ArrayGet Failed to return the correct S32 from tail using -1\n");
     467
     468    if ( psArraySet(test, -6, p3) )
     469        fprintf(stderr, "ArraySet failed to fail using an out of range negative number\n");
     470
     471    psFree(test);
     472    psFree(p3);
     473
     474    return 0;
     475}
  • trunk/psLib/test/types/verified/tst_psArray.stderr

    r4547 r5114  
    219219---> TESTPOINT PASSED (psArray{psArrayAdd} | tst_psArray.c)
    220220
     221/***************************** TESTPOINT ******************************************\
     222*             TestFile: tst_psArray.c                                              *
     223*            TestPoint: psArray{psArrayGetSet}                                     *
     224*             TestType: Positive                                                   *
     225\**********************************************************************************/
     226
     227<DATE><TIME>|<HOST>|E|psArraySet (FILE:LINENO)
     228    Specified position, 10, is greater than n+1 of the array, 1.
     229<DATE><TIME>|<HOST>|E|psArraySet (FILE:LINENO)
     230    Invalid position.  Negative number too large
     231
     232---> TESTPOINT PASSED (psArray{psArrayGetSet} | tst_psArray.c)
     233
  • trunk/psLib/test/types/verified/tst_psPixels.stderr

    r5101 r5114  
    7979\**********************************************************************************/
    8080
     81<DATE><TIME>|<HOST>|E|psPixelsSet (FILE:LINENO)
     82    Invalid position.  Number too large
    8183
    8284---> TESTPOINT PASSED (psPixels{psPixelsGet/Set} | tst_psPixels.c)
Note: See TracChangeset for help on using the changeset viewer.