IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2004, 1:52:09 PM (22 years ago)
Author:
desonia
Message:

general, pre-release cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/tst_pmMaskBadPixels.c

    r1888 r2138  
    1717 *  @author Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    20  *  @date $Date: 2004-09-24 23:42:28 $
     19 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     20 *  @date $Date: 2004-10-14 23:52:09 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5656
    5757
    58 static int testMaskBadPixels(void);
     58static int testMaskBadPixels1(void);
     59static int testMaskBadPixels2(void);
     60static int testMaskBadPixels3(void);
     61static int testMaskBadPixels4(void);
     62static int testMaskBadPixels5(void);
     63static int testMaskBadPixels6(void);
     64static int testMaskBadPixels7(void);
     65static int testMaskBadPixels8(void);
     66static int testMaskBadPixels9(void);
     67static int testMaskBadPixels10(void);
     68static int testMaskBadPixels11(void);
    5969
    6070
    6171testDescription tests[] = {
    62                               {testMaskBadPixels, 885, "pmMaskBadPixels", 0, false},
     72                              {testMaskBadPixels1, 885, "pmMaskBadPixels - Create mask based on maskVal argument", 0, false},
     73                              {testMaskBadPixels2, 885, "pmMaskBadPixels - Create mask based on saturation argument", 0, false},
     74                              {testMaskBadPixels3, 885, "pmMaskBadPixels - Create mask based on growVal and grow arguments", 0, false},
     75                              {testMaskBadPixels4, 885, "pmMaskBadPixels - Auto create mask based on maskVal argument", 0, false},
     76                              {testMaskBadPixels5, 885, "pmMaskBadPixels - Attempt to use null mask", 0, false},
     77                              {testMaskBadPixels6, 885, "pmMaskBadPixels - Attempt tp use null input image", 0, false},
     78                              {testMaskBadPixels7, 885, "pmMaskBadPixels - Attempt to use input image bigger than mask", 0, false},
     79                              {testMaskBadPixels8, 885, "pmMaskBadPixels - Attempt to use input image mask bigger than mask", 0, false},
     80                              {testMaskBadPixels9, 885, "pmMaskBadPixels - Attempt to use offset greater than input image", 0, false},
     81                              {testMaskBadPixels10, 885, "pmMaskBadPixels - Attempt to use complex input image", 0, false},
     82                              {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false},
    6383                              {NULL}
    6484                          };
     
    7191
    7292
    73 int testMaskBadPixels( void )
    74 {
    75 
    76 
     93int testMaskBadPixels1( void )
     94{
    7795    // Test A - Create mask based on maskVal argument
    78     printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test A - Create mask based on maskVal argument");
    7996    CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50);
    8097    CREATE_AND_SET_IMAGE(mask1,U8,0,50,50)
     
    87104    psFree(inReadout);
    88105    psFree(inImage1);
    89     printFooter(stdout, "pmMaskBadPixels", "Test A - Create mask based on maskVal argument", true);
    90     printf("\n\n\n");
    91 
    92 
     106
     107    return 0;
     108}
     109
     110int testMaskBadPixels2( void )
     111{
    93112    // Test B - Create mask based on saturation argument
    94     printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test B - Create mask based on saturation argument");
    95113    CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50);
    96114    CREATE_AND_SET_IMAGE(mask2,U8,0,50,50)
     
    102120    psFree(inReadout2);
    103121    psFree(inImage2);
    104     printFooter(stdout, "pmMaskBadPixels", "Test B - Create mask based on saturation argument", true);
    105     printf("\n\n\n");
    106 
    107 
     122
     123    return 0;
     124}
     125
     126int testMaskBadPixels3( void )
     127{
    108128    // Test C - Create mask based on growVal and grow arguments
    109     printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test C - Create mask based on growVal and grow arguments");
    110129    CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50);
    111130    CREATE_AND_SET_IMAGE(mask3,U8,0,50,50)
     
    120139    psFree(inReadout3);
    121140    psFree(inImage3);
    122     printFooter(stdout, "pmMaskBadPixels", "Test C - Create mask based on growVal and grow arguments", true);
    123     printf("\n\n\n");
    124 
    125 
     141
     142    return 0;
     143}
     144
     145int testMaskBadPixels4( void )
     146{
    126147    // Test D - Auto Create mask based on maskVal argument
    127     printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument");
    128148    CREATE_AND_SET_IMAGE(inImage4,F64,50.0,50,50);
    129149    CREATE_AND_SET_IMAGE(mask4,U8,0,50,50)
     
    138158    psFree(inReadout4);
    139159    psFree(inImage4);
    140     printFooter(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument", true);
    141     printf("\n\n\n");
    142 
    143 
     160
     161    return 0;
     162}
     163
     164int testMaskBadPixels5( void )
     165{
    144166    // Test E - Attempt to use null mask
    145     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test E - Attempt to use null mask",
    146                             "Null not allowed for mask image", 0);
    147167    CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50);
    148168    psReadout *inReadout5 = psReadoutAlloc(0, 0, inImage5);
    149     pmMaskBadPixels(inReadout4, NULL, 0, 100.0, 1, 10);
     169    pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10);
    150170    psFree(inReadout5);
    151171    psFree(inImage5);
    152     printFooter(stdout, "pmMaskBadPixels", "Test E - Attempt to use null mask", true);
    153     printf("\n\n\n");
    154 
    155 
     172
     173    return 0;
     174}
     175
     176int testMaskBadPixels6( void )
     177{
    156178    // Test F - Attempt tp use null input image
    157     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test F - Attempt tp use null input image",
    158                             "Null not allowed for input image", 0);
    159 
    160179    CREATE_AND_SET_IMAGE(mask6,U8,0,50,50)
    161180    psReadout *inReadout6 = psReadoutAlloc(0, 0, NULL);
     
    163182    pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10);
    164183    psFree(inReadout6);
    165     printFooter(stdout, "pmMaskBadPixels", "Test F - Attempt tp use null input image", true);
    166     printf("\n\n\n");
    167 
    168 
     184
     185    return 0;
     186}
     187
     188int testMaskBadPixels7( void )
     189{
    169190    // Test G - Attempt to use input image bigger than mask
    170     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask",
    171                             "Input image size exceeds that of mask image", 0);
    172191    CREATE_AND_SET_IMAGE(inImage7,F64,0.0,60,60);
    173192    CREATE_AND_SET_IMAGE(mask7,U8,0,50,50)
    174193    CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50)
    175194    psReadout *inReadout7 = psReadoutAlloc(0, 0, inImage7);
    176     inReadout4->mask = mask7i;
    177     pmMaskBadPixels(inReadout4, mask7, 0, 100.0, 1, 10);
     195    inReadout7->mask = mask7i;
     196    pmMaskBadPixels(inReadout7, mask7, 0, 100.0, 1, 10);
    178197    psFree(mask7);
    179198    psFree(inReadout7);
    180199    psFree(inImage7);
    181     printFooter(stdout, "pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask", true);
    182     printf("\n\n\n");
    183 
    184 
     200
     201    return 0;
     202}
     203
     204int testMaskBadPixels8( void )
     205{
    185206    // Test H - Attempt to use input image mask bigger than mask
    186     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask",
    187                             "Input image mask size exceeds that of mask image", 0);
    188207    CREATE_AND_SET_IMAGE(inImage8,F64,0.0,50,50);
    189208    CREATE_AND_SET_IMAGE(mask8,U8,0,50,50)
     
    195214    psFree(inReadout8);
    196215    psFree(inImage8);
    197     printFooter(stdout, "pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask", true);
    198     printf("\n\n\n");
    199 
    200 
     216
     217    return 0;
     218}
     219
     220int testMaskBadPixels9( void )
     221{
    201222    // Test I - Attempt to use offset greater than input image
    202     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test I - Attempt to use offset greater than input image",
    203                             "Total offset >= input image size", 0);
    204223    CREATE_AND_SET_IMAGE(inImage9,F64,0.0,50,50);
    205224    CREATE_AND_SET_IMAGE(mask9,U8,0,50,50)
     
    207226    psReadout *inReadout9 = psReadoutAlloc(0, 0, inImage9);
    208227    inReadout9->mask = mask9i;
    209     *(int*)&inReadout->col0 = 150;
    210     *(int*)&inReadout->row0 = 150;
     228    *(int*)&inReadout9->col0 = 150;
     229    *(int*)&inReadout9->row0 = 150;
    211230    pmMaskBadPixels(inReadout9, mask9, 0, 100.0, 1, 10);
    212231    psFree(mask9);
    213232    psFree(inReadout9);
    214233    psFree(inImage9);
    215     printFooter(stdout, "pmMaskBadPixels", "Test I - Attempt to use offset greater than input image", true);
    216     printf("\n\n\n");
    217 
    218 
     234
     235    return 0;
     236}
     237
     238int testMaskBadPixels10( void )
     239{
    219240    // Test J - Attempt to use complex input image
    220     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test J - Attempt to use complex input image",
    221                             "Complex types not allowed for input image", 0);
    222241    CREATE_AND_SET_IMAGE(inImage10,C64,50.0,50,50);
    223242    CREATE_AND_SET_IMAGE(mask10,U8,0,50,50)
     
    229248    psFree(inReadout10);
    230249    psFree(inImage10);
    231     printFooter(stdout, "pmMaskBadPixels", "Test J - Attempt to use complex input image", true);
    232     printf("\n\n\n");
    233 
    234 
     250
     251    return 0;
     252}
     253
     254int testMaskBadPixels11( void )
     255{
    235256    // Test K - Attempt to use non-mask type mask image
    236     printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image",
    237                             "Mask must be PS_TYPE_MASK type", 0);
    238257    CREATE_AND_SET_IMAGE(inImage11,F64,50.0,50,50);
    239258    CREATE_AND_SET_IMAGE(mask11,F64,0,50,50)
    240259    CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50)
    241     psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage10);
     260    psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage11);
    242261    inReadout11->mask = mask11i;
    243262    pmMaskBadPixels(inReadout11, mask11, 0, 100.0, 1, 10);
     
    245264    psFree(inReadout11);
    246265    psFree(inImage11);
    247     printFooter(stdout, "pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image", true);
    248     printf("\n\n\n");
    249 
    250     return 0;
    251 }
     266
     267    return 0;
     268}
     269
Note: See TracChangeset for help on using the changeset viewer.