IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11402


Ignore:
Timestamp:
Jan 29, 2007, 2:52:07 PM (19 years ago)
Author:
gusciora
Message:

Removed about a million ok messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/mathtypes/tap_psImage.c

    r10808 r11402  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-12-18 19:10:56 $
     8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-01-30 00:52:07 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2424
    2525
    26 static int Okay = 1;
    27 
    28 static int setOkay( int okay )
    29 {
    30     Okay = okay;
    31     return okay;
    32 }
     26//static int Okay = 1;
     27//static int setOkay( int okay )
     28//{
     29//    Okay = okay;
     30//    return okay;
     31//}
    3332
    3433#define OK(exp) \
     
    4544int main(int argc, char* argv[])
    4645{
    47     plan_tests(1449971);
     46    plan_tests(383);
    4847
    4948    void testImageAlloc(void);
     
    149148                        }
    150149                    }
    151                     for (psS32 r=0;r<rows;r++) {
    152                         for (psS32 c=0;c<cols;c++) {
    153                             ok (OK(image->data.U16[r][c] == 2*c+r),
    154                                 "Could not set all pixels in uint16 image at "
    155                                 "(%d,%d)",c,r);
    156                             RET_OK
    157                         }
    158                     }
     150                    bool errorFlag = false;
     151                    for (psS32 r=0;r<rows;r++) {
     152                        for (psS32 c=0;c<cols;c++) {
     153                            if (image->data.U16[r][c] != 2*c+r) {
     154                                diag("ERROR: Could not set all pixels in uint16 image at (%d,%d)",c,r);
     155                                errorFlag = true;
     156                            }
     157                        }
     158                    }
     159                    ok(!errorFlag, "psImageAlloc() set data correctly (U16)");
    159160                }
    160161                break;
     
    168169                        }
    169170                    }
    170                     for (psS32 r=0;r<rows;r++) {
    171                         for (psS32 c=0;c<cols;c++) {
    172                             ok (OK(!(fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON)),
    173                                 "Set all pixels in float image at (%d,%d)",c,r);
    174                             RET_OK
    175                         }
    176                     }
     171                    bool errorFlag = false;
     172                    for (psS32 r=0;r<rows;r++) {
     173                        for (psS32 c=0;c<cols;c++) {
     174                            if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) {
     175                                diag("Could not set all pixels in float image at (%d,%d)",c,r);
     176                                errorFlag = true;
     177                            }
     178                        }
     179                    }
     180                    ok(!errorFlag, "psImageAlloc() set data correctly (F32)");
    177181                }
    178182                break;
     
    186190                        }
    187191                    }
    188                     for (psS32 r=0;r<rows;r++) {
    189                         for (psS32 c=0;c<cols;c++) {
    190                             ok (OK(!(fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON)),
    191                                 "Set all pixels in double image at (%d,%d)",c,r);
    192                             RET_OK
    193                         }
    194                     }
     192                    bool errorFlag = false;
     193                    for (psS32 r=0;r<rows;r++) {
     194                        for (psS32 c=0;c<cols;c++) {
     195                            if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) {
     196                                diag("Set all pixels in double image at (%d,%d)",c,r);
     197                                errorFlag = true;
     198                            }
     199                        }
     200                    }
     201                    ok(!errorFlag, "psImageAlloc() set data correctly (F64)");
    195202                }
    196203                break;
     
    204211                        }
    205212                    }
    206                     for (psS32 r=0;r<rows;r++) {
    207                         for (psS32 c=0;c<cols;c++) {
    208                             ok (OK(!(fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON ||
    209                                      fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON )),
    210                                 "Set all pixels in complex image at (%d,%d)",c,r);
    211                             RET_OK
    212                         }
    213                     }
     213                    bool errorFlag = false;
     214                    for (psS32 r=0;r<rows;r++) {
     215                        for (psS32 c=0;c<cols;c++) {
     216                            if(fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON ||
     217                                    fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON) {
     218                                diag("Set all pixels in complex image at (%d,%d)",c,r);
     219                                errorFlag = true;
     220                            }
     221                        }
     222                    }
     223                    ok(!errorFlag, "psImageAlloc() set data correctly (C32)");
    214224                }
    215225                break;
     
    224234                        }
    225235                    }
    226                     for (psS32 r=0;r<rows;r++) {
    227                         for (psS32 c=0;c<cols;c++) {
    228                             ok (OK(!(image->data.U8[r][c] != (uint8_t)(r + c))),
    229                                 "Set all pixels in image (type=%d) at (%d,%d)",
    230                                 type[t],c,r);
    231                             RET_OK
    232                         }
    233                     }
     236                    bool errorFlag = false;
     237                    for (psS32 r=0;r<rows;r++) {
     238                        for (psS32 c=0;c<cols;c++) {
     239                            if (image->data.U8[r][c] != (uint8_t)(r + c)) {
     240                                diag("Set all pixels in image (type=%d) at (%d,%d)",
     241                                     type[t],c,r);
     242                                errorFlag = true;
     243                            }
     244                        }
     245                    }
     246                    ok(!errorFlag, "psImageAlloc() set data correctly (default)");
    234247                }
    235248            }
Note: See TracChangeset for help on using the changeset viewer.