#ifndef COMMON_H
#define COMMON_H
#include <stdio.h>
extern int status;
int test(const char *file, int line, const char *expr, int retval, int exp_errnum, int stop_on_error);
void *test_ptr(const char *file, int line, const char *expr, void *retval, int exp_errnum, int stop_on_error);
void _assert(const char *file, int line, const char *expr, int test_status, int stop_on_error);
#define TEST(expr, exp_errnum) test(__FILE__, __LINE__, #expr, (expr), (exp_errnum), STOP_ON_ERROR)
#define TEST_PTR(expr, exp_errnum) test_ptr(__FILE__, __LINE__, #expr, (expr), (exp_errnum), STOP_ON_ERROR)
#define ASSERT(expr) _assert(__FILE__, __LINE__, #expr, (expr), STOP_ON_ERROR)
#define NEWLINE() putchar('\n')
#endif