File: check.h

package info (click to toggle)
ion 3.2.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,768 kB
  • ctags: 11,049
  • sloc: ansic: 141,798; sh: 22,848; makefile: 7,818; python: 1,638; sql: 311; perl: 197; awk: 178; xml: 50; java: 19
file content (23 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * check.h
 * Like libcheck (check.sf.net), except it doesn't leak memory.
 */

#include <stdlib.h>
#include <stdio.h>

#define fail_unless(expr, ...) \
    _fail_unless((expr), __FILE__, __LINE__, \
    "Failure '"#expr"' occured", ## __VA_ARGS__, NULL)

#define CHECK_FINISH \
    return check_summary(argv[0])

#define ABORT_ON_FAIL      0
#define CONTINUE_ON_FAIL   1
#define SKIP_ON_FAIL       2
extern int failure_mode;

void _fail_unless(int result, const char *file, int line, const char *fmt, ...);

int check_summary(const char *name);