IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 6, 2006, 9:45:33 PM (20 years ago)
Author:
magnier
Message:

added tests for psImageShift and psImageInterpolate, fixed low-level bugs in psImageInterpolate BILINEAR, added BICUBE; added ok_float_tol and ok_double_tol to pstap.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/pstap/src/pstap.h

    r9868 r9875  
    66return exit_status()
    77
    8        #define mem() ok(psMemCheckLeaks(psMemGetLastId(), NULL, stdout, false) == 0, "Memory Leaks")
     8       # define mem() ok(psMemCheckLeaks(psMemGetLastId(), NULL, stdout, false) == 0, "Memory Leaks")
    99
    10        #define checkLeaks false
     10       # define checkLeaks false
    1111
    12        #define checkMem() if(checkLeaks) mem()
     12       # define checkMem() if(checkLeaks) mem()
    1313
    14            #ifdef __GNUC__
     14           # ifdef __GNUC__
    1515
    16            // use to test the value of a double
    17            # define ok_double(VALUE,EXPECT,COMMENT, ...)\
    18            ok((fabsl((VALUE)-(EXPECT)) < DBL_EPSILON), COMMENT, ## __VA_ARGS__);
     16           // use to test the value of a float
     17           # define ok_float(VALUE,EXPECT,COMMENT, ...)\
     18           ok((fabs((VALUE)-(EXPECT)) < FLT_EPSILON), COMMENT, ## __VA_ARGS__);
    1919
    20 // use to test the value of a float
    21 # define ok_float(VALUE,EXPECT,COMMENT, ...)\
    22 ok((fabs((VALUE)-(EXPECT)) < FLT_EPSILON), COMMENT, ## __VA_ARGS__);
     20// use to test the value of a double
     21# define ok_double(VALUE,EXPECT,COMMENT, ...)\
     22ok((fabsl((VALUE)-(EXPECT)) < DBL_EPSILON), COMMENT, ## __VA_ARGS__);
     23
     24// use to test the value of a float within a defined tolerance
     25# define ok_float_tol(VALUE,EXPECT,TOL,COMMENT, ...)\
     26ok((fabs((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
     27
     28// use to test the value of a double within a defined tolerance
     29# define ok_double_tol(VALUE,EXPECT,TOL,COMMENT, ...)\
     30ok((fabsl((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
    2331
    2432# define ok_str(VALUE,EXPECT,COMMENT, ...)\
     
    3038#elif __STDC_VERSION__ >= 199901L /* __GNUC__ */
    3139
     40// use to test the value of a float
     41# define ok_float(VALUE,EXPECT, ...)\
     42ok((fabs((VALUE)-(EXPECT)) < FLT_EPSILON), __VA_ARGS__);
     43
    3244// use to test the value of a double
    3345# define ok_double(VALUE,EXPECT, ...)\
     
    3547
    3648// use to test the value of a float
    37 # define ok_float(VALUE,EXPECT, ...)\
    38 ok((fabs((VALUE)-(EXPECT)) < FLT_EPSILON), __VA_ARGS__);
     49# define ok_float_tol(VALUE,EXPECT,TOL, ...)\
     50ok((fabs((VALUE)-(EXPECT)) < (TOL)), __VA_ARGS__);
     51
     52// use to test the value of a double
     53# define ok_double_tol(VALUE,EXPECT,TOL, ...)\
     54ok((fabsl((VALUE)-(EXPECT)) < )(TOL)), __VA_ARGS__);
    3955
    4056# define ok_str(VALUE,EXPECT, ...)\
Note: See TracChangeset for help on using the changeset viewer.