aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/curlcheck.h
blob: c34f99093c3b80bbc9a5eb26bf336301c58aefa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*****************************************************************************
 *                                  _   _ ____  _
 *  Project                     ___| | | |  _ \| |
 *                             / __| | | | |_) | |
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 */

#include "test.h"

#define fail_unless(expr, msg)                          \
  if(!(expr)) {                                         \
    fprintf(stderr, "%s:%d Assertion '%s' failed: %s" , \
            __FILE__, __LINE__, #expr, msg);            \
    unitfail++;                                         \
  }

extern int unitfail;

#define UNITTEST_START                          \
  int test(char *unused)                        \
  {                                             \
  (void)unused;                                 \
  unit_setup();

#define UNITTEST_STOP                           \
  unit_stop();                                  \
  return unitfail;                              \
  }