IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1303


Ignore:
Timestamp:
Jul 27, 2004, 1:29:08 PM (22 years ago)
Author:
evanalst
Message:

Add check for psVectorSort having the input/output vectors of the same type.

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

Legend:

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

    r1300 r1303  
    66 *     A)  Create float vectors of different sizes
    77 *     B)  Attempt to sort vectors...should get errors
    8  *     C)  Free float vectors
     8 *     C)  Create float vector and double vector
     9 *     D)  Attempt to sort vectors...should get errors
     10 *     E)  Free float, double vectors
    911 *
    1012 *  @author  Ross Harman, MHPCC
    1113 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-07-27 22:48:19 $
     14 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2004-07-27 23:28:56 $
    1416 *
    1517 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2527    psVector *in = NULL;
    2628    psVector *out = NULL;
    27 
     29    psVector *in2 = NULL;
     30    psVector *out2 = NULL;
    2831
    2932    // Test A - Create float vectors
     
    4649    printFooter(stdout, "psVectorSort", "Sort float vector", true);
    4750
     51    // Test C - Create float vector and double vector
     52    printPositiveTestHeader(stdout,"psVectorSort","Create float & double vectors of same size");
     53    in2 = psVectorAlloc(5, PS_TYPE_F32);
     54    in2->n = 5;
     55    out2 = psVectorAlloc(5, PS_TYPE_F64);
     56    out2->n = 5;
     57    for(int j=0; j<5; j++) {
     58        printf("vec[%d] = %f\n", j, in2->data.F32[j]);
     59    }
     60    printFooter(stdout, "psVectorSort", "Create float and double vectors same size", true);
     61
     62    // Test D - Attempt to sort vectors with output of different type should create error
     63    printNegativeTestHeader(stdout,"psVectorSort", "Sort F32/F64 vector",
     64                            "Input and output vector different types", 0);
     65    out2 = psVectorSort(out2, in2);
     66    printFooter(stdout, "psVectorSort", "Sort float vector", true);
    4867
    4968    // Test C - Free float vectors
    5069    printPositiveTestHeader(stdout,"psVectorSort", "Free float vectors");
    5170    psFree(in);
     71    psFree(in2);
    5272    psFree(out);
     73    psFree(out2);
    5374    int nLeaks = psMemCheckLeaks(0, NULL, stdout);
    5475    if(nLeaks) {
  • trunk/psLib/test/collections/verified/tst_psVectorSort_03.stderr

    r1233 r1303  
    11 <DATE> <TIME> |<HOST>|E|   psVectorSort| : Line 178 - Input and output vector sizes are not equal: in=5 out=6
     2 <DATE> <TIME> |<HOST>|E|   psVectorSort| : Line 184 - Input and output vectors are not same type: in=1028 out=1032
  • trunk/psLib/test/collections/verified/tst_psVectorSort_03.stdout

    r1233 r1303  
    2626/***************************** TESTPOINT ******************************************\
    2727*             TestFile: tst_psVectorSort_03.c                                      *
     28*            TestPoint: psVectorSort{Create float & double vectors of same size}   *
     29*             TestType: Positive                                                   *
     30\**********************************************************************************/
     31
     32vec[0] = 0.000000
     33vec[1] = 0.000000
     34vec[2] = 0.000000
     35vec[3] = 0.000000
     36vec[4] = 0.000000
     37
     38---> TESTPOINT PASSED (psVectorSort{Create float and double vectors same size} | tst_psVectorSort_03.c)
     39
     40/***************************** TESTPOINT ******************************************\
     41*             TestFile: tst_psVectorSort_03.c                                      *
     42*            TestPoint: psVectorSort{Sort F32/F64 vector}                          *
     43*             TestType: Negative                                                   *
     44*    ExpectedErrorText: Input and output vector different types                    *
     45*  ExpectedStatusValue: 0                                                          *
     46\**********************************************************************************/
     47
     48
     49---> TESTPOINT PASSED (psVectorSort{Sort float vector} | tst_psVectorSort_03.c)
     50
     51/***************************** TESTPOINT ******************************************\
     52*             TestFile: tst_psVectorSort_03.c                                      *
    2853*            TestPoint: psVectorSort{Free float vectors}                           *
    2954*             TestType: Positive                                                   *
Note: See TracChangeset for help on using the changeset viewer.