#define TEST(r, f, x, m) ( \
((r) = (f)) == (x) || \
- (error("%s failed (" m ")\n", #f, r, x), 0) )
+ (t_error("%s failed (" m ")\n", #f, r, x), 0) )
#define TEST_S(s, x, m) ( \
!strcmp((s),(x)) || \
- (error("[%s] != [%s] (%s)\n", s, x, m), 0) )
+ (t_error("[%s] != [%s] (%s)\n", s, x, m), 0) )
int main(void)
{
TEST(s, strtok(NULL, " ;"), b+16, "%p != %p");
TEST_S(s, "foo", "strtok result");
-#ifdef HAVE_BSD_STRL
memset(b, 'x', sizeof b);
TEST(i, strlcpy(b, "abc", sizeof b - 1), 3, "length %d != %d");
TEST(i, b[3], 0, "strlcpy did not null-terminate short string (%d)");
memcpy(b, "abc\0\0\0x\0", 8);
TEST(i, strlcat(b, "123", 3), 6, "length %d != %d");
TEST_S(b, "abc", "strlcat result");
-#endif
- return test_status;
+
+ return t_status;
}