summaryrefslogtreecommitdiff
path: root/test/assert.h
blob: b9b5719f0af7bd5140f51be6196b9b5dded4a69b (plain)
1
2
3
4
5
6
7
8
9
10
#include <stdbool.h>

#define ASSERT(cond, msg, ...) assert(cond, #cond, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define ASSERT_STR_EQ(left, right, msg, ...)                                        \
  assert_streq(left, right, __FILE__, __LINE__, msg, ##__VA_ARGS__)

void assert(bool cond, const char *cond_str, const char *file, int line,
            const char *msg, ...);
void assert_streq(const char *left, const char *right, const char *file,
                  int line, const char *msg, ...);