IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12410


Ignore:
Timestamp:
Mar 12, 2007, 12:04:34 PM (19 years ago)
Author:
jhoblitt
Message:

add is_bool() macro
ws

File:
1 edited

Legend:

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

    r12390 r12410  
    11#include <math.h>
     2
    23
    34#include <pslib.h>
     
    5657}
    5758
     59
    5860// use to test the value of a double
    5961# define ok_double(VALUE,EXPECT,...)\
     
    7173    } \
    7274}
     75
    7376
    7477// use to test the value of a double
     
    8891}
    8992
     93
    9094# define ok_str(VALUE, EXPECT, ...) \
    9195{ \
     
    97101    } \
    98102}
     103
    99104
    100105# define ok_strn(VALUE, EXPECT, N, ...)\
     
    108113}
    109114
     115
    110116# define is_int(VALUE, EXPECT, ...)\
    111117{ \
     
    118124}
    119125
     126
    120127# define is_long(VALUE, EXPECT, ...)\
    121128{ \
     
    127134    } \
    128135}
     136
     137# define is_bool(VALUE, EXPECT, ...)\
     138{ \
     139    int cmp = (VALUE == EXPECT); \
     140    ok(cmp, __VA_ARGS__); \
     141    if (!cmp) { \
     142        diag("         got: '%s'", VALUE ? "true" : "false"); \
     143        diag("    expected: '%s'", EXPECT ? "true" : "false"); \
     144    } \
     145}
Note: See TracChangeset for help on using the changeset viewer.