IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 988


Ignore:
Timestamp:
Jun 10, 2004, 1:14:22 PM (22 years ago)
Author:
harman
Message:

Added more testpoints

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

Legend:

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

    r831 r988  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-06-02 23:29:29 $
     12 *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-06-10 23:14:22 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525    psVector *in = NULL;
    2626    psVector *out = NULL;
     27    psVector *tempVec = NULL;
    2728
    2829
    2930    // Test A - Create float vectors
    3031    printPositiveTestHeader(stdout,"psSort", "Create float vectors");
    31     in = psVectorAlloc(5, PS_TYPE_F32);
    32     in->n = 5;
    33     out = psVectorAlloc(5, PS_TYPE_F32);
    34     out->n = 5;
     32    in = psVectorAlloc(7, PS_TYPE_F32);
     33    in->n = 7;
     34    out = psVectorAlloc(7, PS_TYPE_F32);
     35    out->n = 7;
    3536    in->data.F32[0] = 7.0f;
    3637    in->data.F32[1] = 9.0f;
     
    3839    in->data.F32[3] = 1.0f;
    3940    in->data.F32[4] = 5.0f;
    40     for(int i=0; i<5; i++) {
     41    in->data.F32[5] = 5.0f;
     42    in->data.F32[6] = -20.0f;
     43    for(int i=0; i<7; i++) {
    4144        printf("vec[%d] = %f\n", i, in->data.F32[i]);
    4245    }
     
    4649    // Test B - Sort input float vector and put results into output float vector
    4750    printPositiveTestHeader(stdout,"psSort", "Sort float vector");
     51    tempVec = out;
    4852    out = psSort(out, in);
    49     for(int i=0; i<5; i++) {
     53    for(int i=0; i<7; i++) {
    5054        printf("vec[%d] = %f\n", i, out->data.F32[i]);
     55    }
     56    if(out != tempVec) {
     57        printf("Error: Return pointer not equal to output argument pointer\n");
    5158    }
    5259    printFooter(stdout, "psSort", "Sort float vector", true);
    5360
    5461
    55     // Test C - Free float vectors
     62    // Test C - Sort input float vector into itself
     63    printPositiveTestHeader(stdout,"psSort", "Sort input float vector into itself");
     64    in = psSort(in, in);
     65    for(int i=0; i<7; i++) {
     66        printf("vec[%d] = %f\n", i, out->data.F32[i]);
     67    }
     68    printFooter(stdout, "psSort", "Sort input float vector into itself", true);
     69
     70
     71    // Test D - Free float vectors
    5672    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
    5773    psVectorFree(in);
  • trunk/psLib/test/collections/tst_psSort_04.c

    r831 r988  
    55 *  This test driver contains the following tests for psSort test point 4:
    66 *     A)  Attempt to sort with null input vector
    7  *     B)  Attempt to sort with null output vector
    8  *     C)  Free vectors
     7 *     B)  Free vectors
    98 *
    109 *  @author  Ross Harman, MHPCC
    1110 *
    12  *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-06-02 23:29:29 $
     11 *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     12 *  @date  $Date: 2004-06-10 23:14:22 $
    1413 *
    1514 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2423{
    2524    psVector *badIn = NULL;
    26     psVector *badOut = NULL;
    27     psVector *goodIn = psVectorAlloc(5, PS_TYPE_F32);
    2825    psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32);
    2926
     
    3431    printFooter(stdout, "psSort", "Attempt to sort with null input vector", true);
    3532
    36     // Test B - Attempt to sort with null output vector
    37     printNegativeTestHeader(stdout,"psSort", "Attempt to sort with null output vector",
    38                             "Null output vector", 0);
    39     badOut = psSort(badOut, goodIn);
    40     printFooter(stdout, "psSort", "Attempt to sort with null output vector", true);
    41 
    42     // Test C - Free vectors
     33    // Test B - Free vectors
    4334    printPositiveTestHeader(stdout, "psSort", "Free vectors");
    44     psVectorFree(goodIn);
    4535    psVectorFree(goodOut);
    4636    psMemCheckLeaks(0, NULL, stdout);
  • trunk/psLib/test/collections/verified/tst_psSort_01.stdout

    r805 r988  
    1010vec[3] = 1.000000
    1111vec[4] = 5.000000
     12vec[5] = 5.000000
     13vec[6] = -20.000000
    1214
    1315---> TESTPOINT PASSED (psSort{Create float vectors} | tst_psSort_01.c)
     
    1921\----------------------------------------------------------------------------------/
    2022
    21 vec[0] = 1.000000
    22 vec[1] = 3.000000
    23 vec[2] = 5.000000
    24 vec[3] = 7.000000
    25 vec[4] = 9.000000
     23vec[0] = -20.000000
     24vec[1] = 1.000000
     25vec[2] = 3.000000
     26vec[3] = 5.000000
     27vec[4] = 5.000000
     28vec[5] = 7.000000
     29vec[6] = 9.000000
    2630
    2731---> TESTPOINT PASSED (psSort{Sort float vector} | tst_psSort_01.c)
     32
     33/----------------------------- TESTPOINT ------------------------------------------\
     34|             TestFile: tst_psSort_01.c                                            |
     35|            TestPoint: psSort{Sort input float vector into itself}                |
     36|             TestType: Positive                                                   |
     37\----------------------------------------------------------------------------------/
     38
     39vec[0] = -20.000000
     40vec[1] = 1.000000
     41vec[2] = 3.000000
     42vec[3] = 5.000000
     43vec[4] = 5.000000
     44vec[5] = 7.000000
     45vec[6] = 9.000000
     46
     47---> TESTPOINT PASSED (psSort{Sort input float vector into itself} | tst_psSort_01.c)
    2848
    2949/----------------------------- TESTPOINT ------------------------------------------\
  • trunk/psLib/test/collections/verified/tst_psSort_04.stderr

    r805 r988  
    1  <DATE> <TIME> <HOST> |E|psSort         | : Line 124 - Null input vector
    2  <DATE> <TIME> <HOST> |E|psSort         | : Line 119 - Null output vector
     1 <DATE> <TIME> <HOST> |E|psSort         | : Line 118 - Null input vector
  • trunk/psLib/test/collections/verified/tst_psSort_04.stdout

    r805 r988  
    1212/----------------------------- TESTPOINT ------------------------------------------\
    1313|             TestFile: tst_psSort_04.c                                            |
    14 |            TestPoint: psSort{Attempt to sort with null output vector}            |
    15 |             TestType: Negative                                                   |
    16 |    ExpectedErrorText: Null output vector                                         |
    17 |  ExpectedStatusValue: 0                                                          |
    18 \----------------------------------------------------------------------------------/
    19 
    20 
    21 ---> TESTPOINT PASSED (psSort{Attempt to sort with null output vector} | tst_psSort_04.c)
    22 
    23 /----------------------------- TESTPOINT ------------------------------------------\
    24 |             TestFile: tst_psSort_04.c                                            |
    2514|            TestPoint: psSort{Free vectors}                                       |
    2615|             TestType: Positive                                                   |
Note: See TracChangeset for help on using the changeset viewer.