IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1304


Ignore:
Timestamp:
Jul 27, 2004, 2:05:32 PM (22 years ago)
Author:
evanalst
Message:

Add test point to verify the output vector is of type U32.

Location:
trunk/psLib/test/collections
Files:
2 added
1 edited

Legend:

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

    r1233 r1304  
    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-07-28 00:05:19 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828
    2929    // Test A - Create float vectors
    30     printPositiveTestHeader(stdout,"psVectorSort", "Create vectors");
     30    printPositiveTestHeader(stdout,"psVectorSortIndex", "Create vectors");
    3131    in = psVectorAlloc(5, PS_TYPE_F32);
    3232    in->n = 5;
    33     out = psVectorAlloc(5, PS_TYPE_F32);
    34     out->n = 5;
    3533    in->data.F32[0] = 7.0f;
    3634    in->data.F32[1] = 9.0f;
     
    4139        printf("arr[%d] = %f\n", i, in->data.F32[i]);
    4240    }
    43     printFooter(stdout, "psVectorSort", "Create vectors", true);
     41    printFooter(stdout, "psVectorSortIndex", "Create vectors", true);
    4442
    4543
    4644    // Test B - Sort integer vector of indices based on pre-sort order of floating point vector
    47     printPositiveTestHeader(stdout,"psVectorSort", "Create sorted index vector");
     45    printPositiveTestHeader(stdout,"psVectorSortIndex", "Create sorted index vector");
    4846    out = psVectorSortIndex(out, in);
    4947    for(int i=0; i<5; i++) {
    50         printf("arr[%d] = %d\n", i, out->data.S32[i]);
     48        printf("arr[%d] = %d\n", i, out->data.U32[i]);
    5149    }
    52     printFooter(stdout, "psVectorSort", "Create sorted index vector", true);
     50    printFooter(stdout, "psVectorSortIndex", "Create sorted index vector", true);
    5351
     52    // Test D - Verify the output vector is of type psU32
     53    printPositiveTestHeader(stdout,"psVectorSortIndex", "Verify output vector type");
     54    if(out->type.type != PS_TYPE_U32) {
     55        printf("ERROR: output vector is of type %d\n", out->type.type);
     56    }
     57    printFooter(stdout, "psVectorSortIndex", "Verify output vector type", true);
    5458
    5559    // Test C - Free vectors
    56     printPositiveTestHeader(stdout,"psVectorSort", "Free vectors");
     60    printPositiveTestHeader(stdout,"psVectorSortIndex", "Free vectors");
    5761    psFree(in);
    5862    psFree(out);
    59     psMemCheckLeaks(0, NULL, stdout);
     63    int nLeaks = psMemCheckLeaks(0, NULL, stdout);
     64    if(nLeaks) {
     65        printf("ERROR: Found %d memory leaks\n", nLeaks);
     66    }
    6067    int nBad = psMemCheckCorruption(0);
    6168    if(nBad) {
Note: See TracChangeset for help on using the changeset viewer.