5 /* TODO: not thread-safe nor fork-safe */
6 static volatile int test_status;
8 #define TEST_LOC2(l) __FILE__ ":" #l
9 #define TEST_LOC1(l) TEST_LOC2(l)
10 #define error(...) test_printf("ERROR " TEST_LOC1(__LINE__) ": " __VA_ARGS__)
12 static int test_printf(const char *s, ...)
20 n = vsnprintf(buf, sizeof buf, s, ap);
24 else if (n >= sizeof buf) {
31 return write(1, buf, n);