aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
blob: 2a1c656edb2a1bde19af7c79c603376560798799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* See LICENSE file for copyright and license details. */


#define assert(EXPR)\
	do {\
		if (EXPR)\
			break;\
		fprintf(stderr, "Failed at %s:%i: %s\n", __FILE__, __LINE__, #EXPR);\
		exit(1);\
	} while (0)



#define strcmp(...) test_strcmp(__VA_ARGS__)
static inline int
test_strcmp(const char *a, const char *b)
{
	return (!a || !b) ? !b - !a : (strcmp)(a, b);
}