utesthelp.h File Reference

Unit test helper macros. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "dnxError.h"

Go to the source code of this file.

Defines

#define CHECK_ZERO(expr)
#define CHECK_TRUE(expr)
#define CHECK_NONZERO(expr)   CHECK_ZERO(!(expr))
#define CHECK_FALSE(expr)   CHECK_TRUE(!(expr))
#define IMPLEMENT_DNX_DEBUG(v)
#define IMPLEMENT_DNX_SYSLOG(v)


Detailed Description

Unit test helper macros.

Author:
John Calcote (jcalcote@users.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file utesthelp.h.


Define Documentation

#define CHECK_FALSE ( expr   )     CHECK_TRUE(!(expr))

Definition at line 55 of file utesthelp.h.

#define CHECK_NONZERO ( expr   )     CHECK_ZERO(!(expr))

Definition at line 54 of file utesthelp.h.

#define CHECK_TRUE ( expr   ) 

Value:

do {                                                                          \
   if (!(expr))                                                               \
   {                                                                          \
      fprintf(stderr, "FAILED: Boolean(%s)\n  at %s(%d).\n",                  \
            #expr, __FILE__, __LINE__);                                       \
      exit(1);                                                                \
   }                                                                          \
} while (0)

Definition at line 45 of file utesthelp.h.

#define CHECK_ZERO ( expr   ) 

Value:

do {                                                                          \
   int ret;                                                                   \
   if ((ret = (expr)) != 0)                                                   \
   {                                                                          \
      fprintf(stderr, "FAILED: '%s'\n  at %s(%d).\n  error %d: %s\n",         \
            #expr, __FILE__, __LINE__, ret, dnxErrorString(ret));             \
      exit(1);                                                                \
   }                                                                          \
} while (0)

Definition at line 35 of file utesthelp.h.

#define IMPLEMENT_DNX_DEBUG (  ) 

Value:

void dnxDebug(int l, char * f, ... ) \
{ if (v) { va_list a; va_start(a,f); vprintf(f,a); va_end(a); puts(""); } }

Definition at line 57 of file utesthelp.h.

#define IMPLEMENT_DNX_SYSLOG (  ) 

Value:

void dnxLog(char * f, ... ) \
{ if (v) { va_list a; va_start(a,f); vprintf(f,a); va_end(a); puts(""); } }

Definition at line 61 of file utesthelp.h.


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6