IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2005, 2:04:36 PM (21 years ago)
Author:
drobbin
Message:

Added and update PixelGet/Set, ImageGet/Set, and test fxns

Location:
trunk/psLib/test/types
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/types/tst_psPixels.c

    r4547 r5101  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.1 $
     7 *  @version $Revision: 1.2 $
    88 *           $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-07-13 02:47:01 $
     9 *  @date $Date: 2005-09-23 00:04:36 $
    1010 *
    1111 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    2121static int testPixelsFromMask(void);
    2222static int testPixelsConcatenate(void);
     23static psS32 testPixelsGetSet(void);
    2324
    2425testDescription tests[] = {
     
    2930                              {testPixelsFromMask,865,"psPixelsFromMask",0,false},
    3031                              {testPixelsConcatenate,866,"psPixelsConcatenate",0,false},
     32                              {testPixelsGetSet,867,"psPixelsGet/Set",0,false},
    3133                              {NULL}
    3234                          };
     
    502504}
    503505
     506psS32 testPixelsGetSet(void)
     507{
     508    psPixels *in = psPixelsAlloc(5);
     509    in->n = 0;
     510    psPixelCoord value;
     511    psPixelCoord out;
     512    value.x = 3;
     513    value.y = 13;
     514    if ( psPixelsSet(in, 2, value) ) {
     515        psError(PS_ERR_LOCATION_INVALID, true, "psPixelSet set to Invalid location\n");
     516        return 1;
     517    }
     518    if ( !psPixelsSet(in, 0, value) ) {
     519        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
     520        return 2;
     521    }
     522    if ( !psPixelsSet(in, 1, value) ) {
     523        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
     524        return 3;
     525    }
     526    out = psPixelsGet(in, 1);
     527    if ( out.x != 3 || out.y != 13 ) {
     528        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
     529                out.x, out.y);
     530        return 4;
     531    }
     532    value.x = 1;
     533    value.y = 2;
     534    if ( !psPixelsSet(in, 0, value) ) {
     535        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
     536        return 5;
     537    }
     538    out = psPixelsGet(in, 0);
     539    if (out.x != 1 || out.y != 2) {
     540        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
     541                out.x, out.y);
     542        return 6;
     543    }
     544    psFree(in);
     545    return 0;
     546}
     547
  • trunk/psLib/test/types/verified/tst_psPixels.stderr

    r4547 r5101  
    7373---> TESTPOINT PASSED (psPixels{psPixelsConcatenate} | tst_psPixels.c)
    7474
     75/***************************** TESTPOINT ******************************************\
     76*             TestFile: tst_psPixels.c                                             *
     77*            TestPoint: psPixels{psPixelsGet/Set}                                  *
     78*             TestType: Positive                                                   *
     79\**********************************************************************************/
     80
     81
     82---> TESTPOINT PASSED (psPixels{psPixelsGet/Set} | tst_psPixels.c)
     83
Note: See TracChangeset for help on using the changeset viewer.