IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 14, 2004, 11:04:23 AM (22 years ago)
Author:
harman
Message:

Updated tests to reflect major changes to psVector

File:
1 edited

Legend:

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

    r620 r688  
    44 *
    55 *  This test driver contains the following tests for psSort test point 1:
    6  *     A)  Create float arrays
    7  *     B)  Sort input float array and put results into output float array
    8  *     C)  Free float arrays
     6 *     A)  Create float vectors
     7 *     B)  Sort input float vector and put results into output float vector
     8 *     C)  Free float vectors
    99 *
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-05-08 01:19:28 $
     12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-05-14 21:04:23 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323         char* argv[])
    2424{
    25     psArray *in = NULL;
    26     psArray *out = NULL;
     25    psVector *in = NULL;
     26    psVector *out = NULL;
    2727
    2828
    29     // Test A - Create float arrays
    30     printPositiveTestHeader(stdout,"psSort", "Create float arrays");
    31     in = psFloatArrayAlloc(5);
     29    // Test A - Create float vectors
     30    printPositiveTestHeader(stdout,"psSort", "Create float vectors");
     31    in = psVectorAlloc(PS_TYPE_FLOAT, 5);
    3232    in->n = 5;
    33     out = psFloatArrayAlloc(5);
     33    out = psVectorAlloc(PS_TYPE_FLOAT, 5);
    3434    out->n = 5;
    35     in->arr.fltArr[0] = 7.0f;
    36     in->arr.fltArr[1] = 9.0f;
    37     in->arr.fltArr[2] = 3.0f;
    38     in->arr.fltArr[3] = 1.0f;
    39     in->arr.fltArr[4] = 5.0f;
     35    in->vec.f[0] = 7.0f;
     36    in->vec.f[1] = 9.0f;
     37    in->vec.f[2] = 3.0f;
     38    in->vec.f[3] = 1.0f;
     39    in->vec.f[4] = 5.0f;
    4040    for(int i=0; i<5; i++) {
    41         printf("arr[%d] = %f\n", i, in->arr.fltArr[i]);
     41        printf("vec[%d] = %f\n", i, in->vec.f[i]);
    4242    }
    43     printFooter(stdout, "psSort", "Create float arrays", true);
     43    printFooter(stdout, "psSort", "Create float vectors", true);
    4444
    4545
    46     // Test B - Sort input float array and put results into output float array
    47     printPositiveTestHeader(stdout,"psSort", "Sort float array");
     46    // Test B - Sort input float vector and put results into output float vector
     47    printPositiveTestHeader(stdout,"psSort", "Sort float vector");
    4848    out = psSort(out, in);
    4949    for(int i=0; i<5; i++) {
    50         printf("arr[%d] = %f\n", i, out->arr.fltArr[i]);
     50        printf("vec[%d] = %f\n", i, out->vec.f[i]);
    5151    }
    52     printFooter(stdout, "psSort", "Sort float array", true);
     52    printFooter(stdout, "psSort", "Sort float vector", true);
    5353
    5454
    55     // Test C - Free float arrays
    56     printPositiveTestHeader(stdout,"psSort", "Free float arrays");
    57     psFloatArrayFree(in);
    58     psFloatArrayFree(out);
     55    // Test C - Free float vectors
     56    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
     57    psVectorFree(in);
     58    psVectorFree(out);
    5959    psMemCheckLeaks(0, NULL, stdout);
    6060    int nBad = psMemCheckCorruption(0);
     
    6262        printf("ERROR: Found %d bad memory blocks\n", nBad);
    6363    }
    64     printFooter(stdout, "psSort", "Free float arrays", true);
     64    printFooter(stdout, "psSort", "Free float vectors", true);
    6565
     66    return 0;
    6667}
Note: See TracChangeset for help on using the changeset viewer.