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_03.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
     
    4444    // Test A - Create void pointer vector
    4545    printPositiveTestHeader(stdout,"psVector", "Create void pointer vector");
    46     psVector *psVec = psVectorAlloc(PS_TYPE_PTR, 5);
     46    psVector *psVec = psVectorAlloc(5, PS_TYPE_PTR);
    4747    printf("Vector size = %d\n", psVec->nalloc);
    4848    printf("Vector population = %d\n", psVec->n);
     
    5757        ts->y = 10.1*i;
    5858        mySt[i] = ts;
    59         psVec->vec.vp[i] = ts;
     59        psVec->data.PTR[i] = ts;
    6060        psVec->n++;
    6161        psMemIncrRefCounter(ts);
     
    6363
    6464    for(int i = 0; i < 5; i++) {
    65         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     65        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    6666        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    6767    }
     
    7373    // Test C - Reallocate void pointer vector bigger
    7474    printPositiveTestHeader(stdout,"psVector", "Reallocate void pointer vector bigger");
    75     psVec = psVectorRealloc(psVec, 10);
     75    psVec = psVectorRealloc(10, psVec);
    7676    printf("Adding more elements to void pointer vector...\n");
    7777    for(int i = 5; i < 10; i++) {
     
    8080        ts->y = 10.1*i;
    8181        mySt[i] = ts;
    82         psVec->vec.vp[i] = ts;
     82        psVec->data.PTR[i] = ts;
    8383        psVec->n++;
    8484        psMemIncrRefCounter(ts);
    8585    }
    8686    for(int i = 0; i < 10; i++) {
    87         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     87        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    8888        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    8989    }
     
    9595    // Test D - Reallocate void pointer vector smaller
    9696    printPositiveTestHeader(stdout,"psVector","Reallocate void pointer vector smaller");
    97     psVec = psVectorRealloc(psVec, 3);
     97    psVec = psVectorRealloc(3, psVec);
    9898    for(int i = 0; i < 3; i++) {
    99         testStruct *ts = (testStruct*)psVec->vec.vp[i];
     99        testStruct *ts = (testStruct*)psVec->data.PTR[i];
    100100        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
    101101    }
Note: See TracChangeset for help on using the changeset viewer.