summaryrefslogtreecommitdiffstats
path: root/src/tests/asn.1/debug.h
blob: c538c36d2ac9470d6bba78906785e28dffc1baa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef __DEBUG_H__
#define __DEBUG_H__

/*
  assert utility macro for test programs:
  If the predicate (pred) is true, then
  OK: <message> is printed.  Otherwise,
  ERROR: <message> is printed.

  message should be a printf format string.
*/

#include <stdio.h>

#define test(pred,message)                      \
    if(pred) printf("OK: ");                    \
    else { printf("ERROR: "); error_count++; }  \
    printf(message);

#endif