IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2004, 1:29:39 PM (22 years ago)
Author:
harman
Message:

Changed psVector to be consistent with psImage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psVector_02.c

    r717 r831  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-05-18 19:22:34 $
     14 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-06-02 23:29:29 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3939    // Test A - Create void pointer vector
    4040    printPositiveTestHeader(stdout,"psVector", "Create void pointer vector");
    41     psVector *psVec = psVectorAlloc(PS_TYPE_PTR, 5);
     41    psVector *psVec = psVectorAlloc(5, PS_TYPE_PTR);
    4242    printf("Vector size = %d\n", psVec->nalloc);
    4343    printf("Vector population = %d\n", psVec->n);
     
    5252        ts->y = 10.1*i;
    5353        mySt[i] = ts;
    54         psVec->vec.vp[i] = ts;
     54        psVec->data.PTR[i] = ts;
    5555        psVec->n++;
    5656        psMemIncrRefCounter(ts);
     
    5858
    5959    for(int i = 0; i < 5; i++) {
    60         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     60        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    6161        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    6262    }
     
    6868    // Test C - Reallocate void pointer vector bigger
    6969    printPositiveTestHeader(stdout,"psVector", "Reallocate void pointer vector bigger");
    70     psVec = psVectorRealloc(psVec, 10);
     70    psVec = psVectorRealloc(10, psVec);
    7171    printf("Adding more elements to void pointer vector...\n");
    7272    for(int i = 5; i < 10; i++) {
     
    7575        ts->y = 10.1*i;
    7676        mySt[i] = ts;
    77         psVec->vec.vp[i] = ts;
     77        psVec->data.PTR[i] = ts;
    7878        psVec->n++;
    7979        psMemIncrRefCounter(ts);
    8080    }
    8181    for(int i = 0; i < 10; i++) {
    82         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     82        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    8383        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    8484    }
     
    9090    // Test D - Reallocate void pointer vector smaller
    9191    printPositiveTestHeader(stdout,"psVector","Reallocate void pointer vector smaller");
    92     psVec = psVectorRealloc(psVec, 3);
     92    psVec = psVectorRealloc(3, psVec);
    9393    for(int i = 0; i < 3; i++) {
    94         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     94        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    9595        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    9696    }
Note: See TracChangeset for help on using the changeset viewer.