IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

File:
1 edited

Legend:

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

    r2204 r2273  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-27 00:57:33 $
     8 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-11-04 01:05:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7171                    continue;
    7272                }
    73                 psError(__func__,"psImageAlloc returned NULL for type %x, size %dx%d.",
     73                psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned NULL for type %x, size %dx%d.",
    7474                        type[t], numCols[i], numRows[i]);
    7575                psFree(image);
     
    7878
    7979            if (image->type.dimen != PS_DIMEN_IMAGE || image->type.type != type[t]) {
    80                 psError(__func__,"psImageAlloc allocated wrong dimen/type (%d/%d), should be "
     80                psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong dimen/type (%d/%d), should be "
    8181                        "PS_IMAGE_DIMEN/%d", image->type.dimen, image->type.type, type[t]);
    8282                psFree(image);
     
    8585
    8686            if (image->numCols != numCols[i] || image->numRows != numRows[i]) {
    87                 psError(__func__,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)",
     87                psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)",
    8888                        image->numCols, image->numRows, numCols[i], numRows[i],type[t]);
    8989                psFree(image);
     
    9292
    9393            if (image->col0 != 0 || image->row0 != 0) {
    94                 psError(__func__,"psImageAlloc returned row0/col0 of %d/%d.  Should be 0/0.",
     94                psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned row0/col0 of %d/%d.  Should be 0/0.",
    9595                        image->row0, image->row0);
    9696                psFree(image);
     
    9999
    100100            if (image->parent != NULL) {
    101                 psError(__func__,"psImageAlloc returned non-NULL parent");
     101                psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL parent");
    102102                psFree(image);
    103103                return 5;
     
    105105
    106106            if (image->children != NULL) {
    107                 psError(__func__,"psImageAlloc returned non-NULL children array");
     107                psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL children array");
    108108                psFree(image);
    109109                return 7;
     
    123123                        for (psS32 c=0;c<cols;c++) {
    124124                            if (image->data.U16[r][c] != 2*c+r) {
    125                                 psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);
     125                                psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in uint16 image at (%d,%d)",c,r);
    126126                                psFree(image);
    127127                                return 8;
     
    143143                        for (psS32 c=0;c<cols;c++) {
    144144                            if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) {
    145                                 psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r);
     145                                psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in float image at (%d,%d)",c,r);
    146146                                psFree(image);
    147147                                return 8;
     
    163163                        for (psS32 c=0;c<cols;c++) {
    164164                            if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) {
    165                                 psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r);
     165                                psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in double image at (%d,%d)",c,r);
    166166                                psFree(image);
    167167                                return 8;
     
    184184                            if (fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON ||
    185185                                    fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) {
    186                                 psError(__func__,"Could not set all pixels in complex image at (%d,%d)",c,r);
     186                                psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in complex image at (%d,%d)",c,r);
    187187                                psFree(image);
    188188                                return 8;
     
    205205                        for (psS32 c=0;c<cols;c++) {
    206206                            if (image->data.PTR[r][c] != temp) {
    207                                 psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x",
     207                                psError(PS_ERR_UNKNOWN, true, "Could not set pixel in pointer image at (%d,%d): %x %x",
    208208                                        c,r,image->data.PTR[r][c],temp);
    209209                                psFree(image);
     
    229229                        for (psS32 c=0;c<cols;c++) {
    230230                            if (image->data.U8[r][c] != (uint8_t)(r + c)) {
    231                                 psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)",
     231                                psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in image (type=%d) at (%d,%d)",
    232232                                        type[t],c,r);
    233233                                psFree(image);
     
    281281    // Verify the returned psImage structure pointer is equal to the input parameter output.
    282282    if (img2 != img3) {
    283         psError(__func__,"the image given for recycled wasn't");
     283        psError(PS_ERR_UNKNOWN, true,"the image given for recycled wasn't");
    284284        return 1;
    285285    }
     
    289289    img4 = psImageCopy(NULL,img,PS_TYPE_F32);
    290290    if (img4 == NULL) {
    291         psError(__func__,"output image doesn't exist");
     291        psError(PS_ERR_UNKNOWN, true,"output image doesn't exist");
    292292        return 4;
    293293    }
    294294    if (img4->type.type != img->type.type) {
    295         psError(__func__,"output image is not the same type as input image");
     295        psError(PS_ERR_UNKNOWN, true,"output image is not the same type as input image");
    296296        return 4;
    297297    }
     
    301301        for (unsigned col=0;col<c;col++) {
    302302            if( imgInRow[col] != imgOutRow[col] ) {
    303                 psError(__func__,"Input image not equal to output image at %d,%d!",
     303                psError(PS_ERR_UNKNOWN, true,"Input image not equal to output image at %d,%d!",
    304304                        col, row);
    305305                return 4;
     
    321321    img2 = psImageCopy(img2,img,PS_TYPE_##OUT); \
    322322    if (img2 == NULL) { \
    323         psError(__func__,"psImageCopy failed to copy U8."); \
     323        psError(PS_ERR_UNKNOWN, true,"psImageCopy failed to copy U8."); \
    324324        return 2; \
    325325    } \
     
    329329        for (psU32 col=0;col<c;col++) { \
    330330            if (abs(imgRow[col] - (ps##IN)(row+col)) > 0.5) { \
    331                 psError(__func__,"Input image was changed at %d,%d!", \
     331                psError(PS_ERR_UNKNOWN, true,"Input image was changed at %d,%d!", \
    332332                        col,row); \
    333333                return 2; \
    334334            } \
    335335            if (abs(img2Row[col] - (ps##OUT)(imgRow[col])) > 0.5) { \
    336                 psError(__func__,"returned psImage values after copy don't match at %d,%d " \
     336                psError(PS_ERR_UNKNOWN, true,"returned psImage values after copy don't match at %d,%d " \
    337337                        "(%d vs %d)",\
    338338                        col,row,img2Row[col], (ps##OUT)(imgRow[col])); \
     
    382382    img3 = psImageCopy(NULL,NULL,PS_TYPE_F32);
    383383    if (img3 != NULL) {
    384         psError(__func__,"psImageCopy didn't return NULL when input image was NULL.");
     384        psError(PS_ERR_UNKNOWN, true,"psImageCopy didn't return NULL when input image was NULL.");
    385385        return 3;
    386386    }
Note: See TracChangeset for help on using the changeset viewer.