IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1664


Ignore:
Timestamp:
Aug 31, 2004, 9:36:02 AM (22 years ago)
Author:
desonia
Message:

added test for psImage of PS_TYPE_PTR.

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

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImage.c

    r1606 r1664  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-08-23 22:36:03 $
     8 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-08-31 19:36:02 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6363                                 0,1,100,1,150,100
    6464                             };
    65     unsigned int types = 12;
     65    unsigned int types = 13;
    6666    psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
    6767                          PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64,
    68                           PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64 };
     68                          PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64,
     69                          PS_TYPE_PTR };
    6970
    7071    psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure");
     
    7475
    7576        for (unsigned int i=0;i<sizes;i++) {
     77
     78            if (numRows[i] == 0 || numCols[i] == 0) {
     79                psLogMsg(__func__,PS_LOG_INFO,"Following should be an error.");
     80            }
    7681
    7782            image = psImageAlloc(numCols[i],numRows[i],type[t]);
     
    206211                        }
    207212                    }
     213                }
     214                break;
     215            case PS_TYPE_PTR: {
     216                    unsigned int rows = numRows[i];
     217                    unsigned int cols = numCols[i];
     218                    psImage* temp = psImageAlloc(1,1,PS_TYPE_F32);
     219
     220                    for (int r=0;r<rows;r++) {
     221                        for (int c=0;c<cols;c++) {
     222                            image->data.PTR[r][c] = psMemIncrRefCounter(temp);
     223                        }
     224                    }
     225                    for (int r=0;r<rows;r++) {
     226                        for (int c=0;c<cols;c++) {
     227                            if (image->data.PTR[r][c] != temp) {
     228                                psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x",
     229                                        c,r,image->data.PTR[r][c],temp);
     230                                psFree(image);
     231                                psFree(temp);
     232                                return 8;
     233                            }
     234                        }
     235                    }
     236                    psFree(temp);
    208237                }
    209238                break;
  • trunk/psLib/test/image/verified/tst_psImage.stderr

    r1606 r1664  
    77<DATE><TIME>|<HOST>|I| testImageAlloc|#546 - psImageAlloc shall allocate memory for a psImage structure
    88<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 101h
     9<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    910<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    1011<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 102h
     12<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    1113<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    1214<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 104h
     15<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    1316<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    1417<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 108h
     18<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    1519<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    1620<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 301h
     21<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    1722<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    1823<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 302h
     24<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    1925<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    2026<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 304h
     27<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    2128<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    2229<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 308h
     30<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    2331<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    2432<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 404h
     33<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    2534<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    2635<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 408h
     36<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    2737<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    2838<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 808h
     39<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    2940<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    3041<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 810h
     42<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
     43<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
     44<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 0h
     45<DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error.
    3146<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
    3247
Note: See TracChangeset for help on using the changeset viewer.