IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12405


Ignore:
Timestamp:
Mar 12, 2007, 10:46:45 AM (19 years ago)
Author:
gusciora
Message:

Fixed divide-by-zero code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/tap_psImagePixelManip.c

    r12094 r12405  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-02-27 23:56:12 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-03-12 20:46:45 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1616#include "tap.h"
    1717#include "pstap.h"
     18#define VERBOSE false
    1819
    1920psS32 main(psS32 argc, char* argv[])
     
    2122    psLogSetFormat("HLNM");
    2223    psLogSetLevel(PS_LOG_INFO);
    23     plan_tests(85);
     24    plan_tests(86);
    2425
    2526    // testImageClip()
     
    696697        }
    697698        retVal = psImageOverlaySection(img,img2,0,0,"/");
    698         ok(retVal == 0, "psImageOverlaySection returned zero when checking divide-by-zero");
    699         printf("XXX: retVal is %d, should be 0\n", retVal);
     699        ok(retVal != 0, "psImageOverlaySection returned non-zero when checking divide-by-zero");
     700        errorFlag = false;
     701
     702
     703
     704
     705
     706
     707
     708
     709
     710
     711
     712
     713
     714
     715
     716
     717
     718
     719
     720
     721
     722
     723
     724
     725
     726
     727
     728
     729
     730
     731
     732        for (unsigned row=0;row<r;row++)
     733        {
     734            for (unsigned col=0;col<c;col++) {
     735                if (!isnan(img->data.F32[row][col])) {
     736                    if (VERBOSE) diag("img[%d][%d] is %f, should be NAN\n", row, col, img->data.F32[row][col]);
     737                    errorFlag = true;
     738                }
     739            }
     740        }
     741        ok(!errorFlag, "psImageOverlaySection() properly set data to NANs");
     742
    700743        psFree(img);
    701744        psFree(img2);
Note: See TracChangeset for help on using the changeset viewer.