clean string_memset code
[libc-test] / src / functional / string.c
index 2e06eb9..1d159f4 100644 (file)
 
 #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)
 {
@@ -78,7 +78,6 @@ 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)");
@@ -111,6 +110,6 @@ int main(void)
        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;
 }