IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10788


Ignore:
Timestamp:
Dec 16, 2006, 11:49:09 PM (20 years ago)
Author:
magnier
Message:

added note(), fixed fabs/fabsl vs fabsf/fabs

File:
1 edited

Legend:

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

    r9876 r10788  
    33#include "tap.h"
    44
    5 #define done() ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks"); \
    6 return exit_status()
     5#define done() ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks"); return exit_status()
    76
    8        # define mem() ok(psMemCheckLeaks(psMemGetLastId(), NULL, stdout, false) == 0, "Memory Leaks")
     7        # define mem() ok(psMemCheckLeaks(psMemGetLastId(), NULL, stdout, false) == 0, "Memory Leaks")
    98
    10        # define checkLeaks false
     9        # define checkLeaks false
    1110
    12        # define checkMem() if(checkLeaks) mem()
     11        # define checkMem() if(checkLeaks) mem()
    1312
    14            # ifdef __GNUC__
     13            # ifdef __GNUC__
    1514
    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__);
     15            // write a comment which is counted as a test (and swallowed by prove)
     16            # define note(A, ...) _gen_result(1, __func__, __FILE__, __LINE__, A, ## __VA_ARGS__);
     17
     18// use to test the value of a float
     19# define ok_float(VALUE,EXPECT,COMMENT, ...)\
     20ok((fabsf((VALUE)-(EXPECT)) < FLT_EPSILON), COMMENT, ## __VA_ARGS__);
    1921
    2022// use to test the value of a double
    2123# define ok_double(VALUE,EXPECT,COMMENT, ...)\
    22 ok((fabsl((VALUE)-(EXPECT)) < DBL_EPSILON), COMMENT, ## __VA_ARGS__);
     24ok((fabs((VALUE)-(EXPECT)) < DBL_EPSILON), COMMENT, ## __VA_ARGS__);
    2325
    2426// use to test the value of a float within a defined tolerance
    2527# define ok_float_tol(VALUE,EXPECT,TOL,COMMENT, ...)\
    26 ok((fabs((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
     28ok((fabsf((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
    2729
    2830// use to test the value of a double within a defined tolerance
    2931# define ok_double_tol(VALUE,EXPECT,TOL,COMMENT, ...)\
    30 ok((fabsl((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
     32ok((fabs((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__);
    3133
    3234# define ok_str(VALUE,EXPECT,COMMENT, ...)\
     
    3537#elif __STDC_VERSION__ >= 199901L /* __GNUC__ */
    3638
     39// write a comment which is counted as a test (and swallowed by prove)
     40# define note(A, ...) _gen_result(1, __func__, __FILE__, __LINE__, A, ...);
     41
    3742// use to test the value of a float
    3843# define ok_float(VALUE,EXPECT, ...)\
    39 ok((fabs((VALUE)-(EXPECT)) < FLT_EPSILON), __VA_ARGS__);
     44ok((fabsf((VALUE)-(EXPECT)) < FLT_EPSILON), __VA_ARGS__);
    4045
    4146// use to test the value of a double
    4247# define ok_double(VALUE,EXPECT, ...)\
    43 ok((fabsl((VALUE)-(EXPECT)) < DBL_EPSILON), __VA_ARGS__);
     48ok((fabs((VALUE)-(EXPECT)) < DBL_EPSILON), __VA_ARGS__);
    4449
    4550// use to test the value of a float
    4651# define ok_float_tol(VALUE,EXPECT,TOL, ...)\
    47 ok((fabs((VALUE)-(EXPECT)) < (TOL)), __VA_ARGS__);
     52ok((fabsf((VALUE)-(EXPECT)) < (TOL)), __VA_ARGS__);
    4853
    4954// use to test the value of a double
    5055# define ok_double_tol(VALUE,EXPECT,TOL, ...)\
    51 ok((fabsl((VALUE)-(EXPECT)) < )(TOL)), __VA_ARGS__);
     56ok((fabs((VALUE)-(EXPECT)) < )(TOL)), __VA_ARGS__);
    5257
    5358# define ok_str(VALUE,EXPECT, ...)\
Note: See TracChangeset for help on using the changeset viewer.