IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2004, 1:26:49 PM (22 years ago)
Author:
desonia
Message:

changed function prototypes to match changes in the SDRS.

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

Legend:

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

    r1682 r1920  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-09-02 21:17:03 $
     8 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-09-28 23:26:49 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626
    2727testDescription tests[] = {
    28                               {
    29                                   testImageAlloc,546,"psImageAlloc",0,false
    30                               },
    31                               {
    32                                   testImageAlloc,548,"psImageFree",0,true
    33                               },
    34                               {
    35                                   testImageSubset,547,"psImageSubset",0,false
    36                               },
    37                               {
    38                                   testImageSubset,550,"psImageSubset",0,true
    39                               },
    40                               {
    41                                   testImageCopy,551,"psImageCopy",0,false
    42                               },
    43                               {
    44                                   NULL
    45                               }
     28                              {testImageAlloc,546,"psImageAlloc",0,false},
     29                              {testImageAlloc,548,"psImageFree",0,true},
     30                              {testImageSubset,547,"psImageSubset",0,false},
     31                              {testImageSubset,550,"psImageSubset",0,true},
     32                              {testImageCopy,551,"psImageCopy",0,false},
     33                              {NULL}
    4634                          };
    4735
     
    119107            }
    120108
    121             if (image->nChildren != 0) {
    122                 psError(__func__,"psImageAlloc returned non-zero number of children");
    123                 psFree(image);
    124                 return 6;
    125             }
    126 
    127109            if (image->children != NULL) {
    128                 psError(__func__,"psImageAlloc returned non-NULL children vector");
     110                psError(__func__,"psImageAlloc returned non-NULL children array");
    129111                psFree(image);
    130112                return 7;
     
    259241                }
    260242            }
    261 
    262             // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no
    263             // children is freed.
    264243            psFree(image);
    265244        }
    266245    }
    267246
    268     // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null.
    269     psFree(NULL);
    270 
    271247    // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple
    272     // children isfreed.
     248    // children is freed.
    273249    image = psImageAlloc(100,100,PS_TYPE_F32);
    274     psImageSubset(image,50,50,0,0);
    275     psImageSubset(image,50,50,20,20);
     250    psImageSubset(image,50,0,70,20);
     251    psImageSubset(image,70,20,90,40);
    276252
    277253    psFree(image);
     
    300276    memcpy(&preSubsetStruct,original,sizeof(psImage));
    301277
    302     subset2 = psImageSubset(original,c/2,r/2,c/4,r/4);
    303 
    304     subset3 = psImageSubset(original,c/2,r/2,0,0);
     278    subset2 = psImageSubset(original,c/4,r/4,c/4+c/2,r/4+r/2);
     279
     280    subset3 = psImageSubset(original,0,0,c/2,r/2);
     281
     282    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members nrow and ncol are equal to "
     283             "the input parameter nrow and ncol respectively.");
     284
     285    if (subset2->numCols != c/2 || subset2->numRows != r/2) {
     286        psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
     287                subset2->numCols, subset2->numRows, c/2,r/2);
     288        return 1;
     289    }
     290
     291    if (subset3->numCols != c/2 || subset3->numRows != r/2) {
     292        psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
     293                subset3->numCols, subset3->numRows, c/2,r/2);
     294        return 2;
     295    }
    305296
    306297    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure contains expected values in the "
     
    322313    }
    323314
    324     psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members nrow and ncol are equal to "
    325              "the input parameter nrow and ncol respectively.");
    326 
    327     if (subset3->numCols != c/2 || subset3->numRows != r/2) {
    328         psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
    329                 subset3->numCols, subset3->numRows, c/2,r/2);
    330         return 5;
    331     }
    332 
    333315    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member type is equal to the input "
    334316             "psImage structure member type.");
     
    367349    }
    368350
    369     psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member Nchildren is equal to "
    370              "zero.");
    371 
    372     if (subset2->nChildren != 0 || subset3->nChildren != 0) {
    373         psError(__func__,"psImageSubset didn't set nChildren to zero.");
    374         return 11;
    375     }
    376 
    377351    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member children is null.");
    378352
     
    386360             "out at parent[Nchildren-1].");
    387361
    388     if (original->nChildren != preSubsetStruct.nChildren+2) {
    389         psError(__func__,"psImageSubset didn't increment nChildren by one per subset.");
     362    if (original->children == NULL || original->children->n != 2) {
     363        psError(__func__,"psImageSubset didn't increment number of children by one per subset.");
    390364        return 12;
    391365    }
    392     if (original->children[0] != subset2 || original->children[1] != subset3) {
     366    if (original->children->data[0] != subset2 || original->children->data[1] != subset3) {
    393367        psError(__func__,"psImageSubset didn't properly store the children pointers.");
    394368        return 13;
     
    400374
    401375    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    402     subset1 = psImageSubset(NULL,c/2,r/2,0,0);
     376    subset1 = psImageSubset(NULL,0,0,c/2,r/2);
    403377    if (subset1 != NULL) {
    404378        psError(__func__,"psImageSubset didn't return NULL when input image was NULL.");
     
    412386    memcpy(&preSubsetStruct,original,sizeof(psImage));
    413387    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    414     subset1 = psImageSubset(original,c/2,0,0,0);
     388    subset1 = psImageSubset(original,0,r/2,c/2,r/2);
    415389    if (subset1 != NULL) {
    416390        psError(__func__,"psImageSubset didn't return NULL when numRows=0.");
     
    418392    }
    419393    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    420     subset1 = psImageSubset(original,0,r/2,0,0);
     394    subset1 = psImageSubset(original,c/2,0,c/2,r/2);
    421395    if (subset1 != NULL) {
    422396        psError(__func__,"psImageSubset didn't return NULL when numCols=0.");
     
    434408
    435409    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    436     subset1 = psImageSubset(original,c/2,r/2,c,0);
     410    subset1 = psImageSubset(original,0,0,c/2,r*2);
    437411    if (subset1 != NULL) {
    438412        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
     
    441415    }
    442416    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    443     subset1 = psImageSubset(original,c/2,r/2,0,r);
     417    subset1 = psImageSubset(original,0,0,c*2,r/2);
    444418    if (subset1 != NULL) {
    445419        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
     
    448422    }
    449423    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    450     subset1 = psImageSubset(original,c/2,r/2,-1,0);
     424    subset1 = psImageSubset(original,-1,0,c/2,r/2);
    451425    if (subset1 != NULL) {
    452426        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
     
    455429    }
    456430    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    457     subset1 = psImageSubset(original,c/2,r/2,0,-1);
     431    subset1 = psImageSubset(original,0,-1,c/2,r/2);
    458432    if (subset1 != NULL) {
    459433        psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of "
     
    468442
    469443    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    470     subset1 = psImageSubset(original,c/2,r/2,c/2,0);
     444    subset1 = psImageSubset(original,0,0,c/2,r+1);
    471445    if (subset1 != NULL) {
    472446        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via rows).");
     
    474448    }
    475449    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    476     subset1 = psImageSubset(original,c/2,r/2,0,r/2);
     450    subset1 = psImageSubset(original,0,0,c+1,r/2);
    477451    if (subset1 != NULL) {
    478452        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via cols).");
     
    480454    }
    481455    psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
    482     subset1 = psImageSubset(original,c/2,r/2,c/2,r/2);
     456    subset1 = psImageSubset(original,0,0,c+1,r+1);
    483457    if (subset1 != NULL) {
    484458        psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via row+cols).");
     
    494468
    495469    // Verify the returned psImage structure member Nchildren is set to zero.
    496     if (original->nChildren != 0) {
    497         psError(__func__,"psImageFreeChildren didn't set nChildren to zero.");
     470    if (original->children != NULL && original->children->n > 0) {
     471        psError(__func__,"psImageFreeChildren didn't set number of children to zero.");
    498472        return 25;
    499     }
    500 
    501     // Verify the returned psImage structure member children pointer is set to null.
    502     if (original->children != NULL) {
    503         psError(__func__,"psImageFreeChildren didn't set children ptr to NULL.");
    504         return 26;
    505473    }
    506474
  • trunk/psLib/test/image/verified/tst_psImage.stderr

    r1840 r1920  
    9595
    9696<DATE><TIME>|<HOST>|I|testImageSubset
     97    Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.
     98<DATE><TIME>|<HOST>|I|testImageSubset
    9799    Verify the returned psImage structure contains expected values in the row member, if the input psImage structure image contains known values.
    98 <DATE><TIME>|<HOST>|I|testImageSubset
    99     Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.
    100100<DATE><TIME>|<HOST>|I|testImageSubset
    101101    Verify the returned psImage structure member type is equal to the input psImage structure member type.
     
    104104<DATE><TIME>|<HOST>|I|testImageSubset
    105105    Verify the returned psImage structure member parent is equal to the input psImage structure pointer image.
    106 <DATE><TIME>|<HOST>|I|testImageSubset
    107     Verify the returned psImage structure member Nchildren is equal to zero.
    108106<DATE><TIME>|<HOST>|I|testImageSubset
    109107    Verify the returned psImage structure member children is null.
     
    121119    An error should follow...
    122120<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    123     Specified number of rows (64) or columns (0) is invalid.
     121    Specified subset range, [0:<LINENO>,128:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    124122<DATE><TIME>|<HOST>|I|testImageSubset
    125123    An error should follow...
    126124<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    127     Specified number of rows (0) or columns (128) is invalid.
     125    Specified subset range, [64:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    128126<DATE><TIME>|<HOST>|I|testImageSubset
    129127    Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters row0 and col0 are not within the range of values of psImage structure image.
     
    131129    An error should follow...
    132130<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    133     Specified subset range, [128:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     131    Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    134132<DATE><TIME>|<HOST>|I|testImageSubset
    135133    An error should follow...
    136134<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    137     Specified subset range, [0:<LINENO>,256:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     135    Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    138136<DATE><TIME>|<HOST>|I|testImageSubset
    139137    An error should follow...
    140138<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    141     Specified subset range, [-1:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     139    Specified subset range, [-1:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    142140<DATE><TIME>|<HOST>|I|testImageSubset
    143141    An error should follow...
    144142<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    145     Specified subset range, [0:<LINENO>,-1:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     143    Specified subset range, [0:<LINENO>,-1:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    146144<DATE><TIME>|<HOST>|I|testImageSubset
    147145    Verify the returned psImage structure pointer is null and program execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of data not within the input psImage structure image.  Also verify the input psImage structure is not modified.
     
    149147    An error should follow...
    150148<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    151     Specified subset range, [64:<LINENO>,0:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     149    Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    152150<DATE><TIME>|<HOST>|I|testImageSubset
    153151    An error should follow...
    154152<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    155     Specified subset range, [0:<LINENO>,128:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     153    Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    156154<DATE><TIME>|<HOST>|I|testImageSubset
    157155    An error should follow...
    158156<DATE><TIME>|<HOST>|E|psLib.image.psImageSubset
    159     Specified subset range, [64:<LINENO>,128:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     157    Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    160158<DATE><TIME>|<HOST>|I|testImageSubset
    161159    psImageFreeChildren shall deallocate any children images of a psImage structure
  • trunk/psLib/test/image/verified/tst_psImageExtraction.stderr

    r1840 r1920  
    2424    Following should be an error.
    2525<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    26     Specified subset range, [2001:<LINENO>,2002:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     26    Specified subset range, [2001:<LINENO>,2002:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    2727<DATE><TIME>|<HOST>|I|testImageSlice
    2828    Following should be an error.
    2929<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    30     Specified subset range, [200:<LINENO>,201:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     30    Specified subset range, [200:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    3131<DATE><TIME>|<HOST>|I|testImageSlice
    3232    Following should be an error.
    3333<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    34     Specified subset range, [200:<LINENO>,2200:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     34    Specified subset range, [200:<LINENO>,2200:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    3535<DATE><TIME>|<HOST>|I|testImageSlice
    3636    Following should be an error.
    3737<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    38     Specified subset range, [200:<LINENO>,201:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     38    Specified subset range, [200:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    3939<DATE><TIME>|<HOST>|I|testImageSlice
    4040    Following should be an error.
  • trunk/psLib/test/image/verified/tst_psImageManip.stderr

    r1915 r1920  
    125125    Following should error as overlay isn't within image boundaries
    126126<DATE><TIME>|<HOST>|E|psLib.image.psImageOverlaySection
    127     Specified subset range, [32:<LINENO>,64:<LINENO>], lies outside psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     127    Specified subset range, [32:<LINENO>,64:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    128128<DATE><TIME>|<HOST>|I|testImageOverlay
    129129    Following should error as overlay is NULL
Note: See TracChangeset for help on using the changeset viewer.