# undef __TEST_BSD_FUNCS__
#endif
+#if defined(__UCLIBC_SUSV3_LEGACY__) || defined(__UCLIBC_SUSV3_LEGACY__)
+# define __TEST_SUSV3_LEGACY__
+#else
+# undef __TEST_SUSV3_LEGACY__
+#endif
+
#define STREQ(a, b) (strcmp((a), (b)) == 0)
const char *it = "<UNSET>"; /* Routine name for message routines. */
static void
test_index (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "index";
check (index ("abcd", 'z') == NULL, 1); /* Not found. */
(void) strcpy (one, "abcd");
(void) strcpy (one, "");
check (index (one, 'b') == NULL, 7); /* Empty string. */
check (index (one, '\0') == one, 8); /* NUL in empty string. */
+#endif
}
static void
static void
test_rindex (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "rindex";
check (rindex ("abcd", 'z') == NULL, 1); /* Not found. */
(void) strcpy (one, "abcd");
(void) strcpy (one, "");
check (rindex (one, 'b') == NULL, 7); /* Empty string. */
check (rindex (one, '\0') == one, 8); /* NUL in empty string. */
+#endif
}
static void
static void
test_bcopy (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
/* Much like memcpy. Berklix manual is silent about overlap, so
don't test it. */
it = "bcopy";
(void) bcopy(one, two, 9);
equal(two, "hi there", 4); /* Just paranoia. */
equal(one, "hi there", 5); /* Stomped on source? */
+#endif
}
static void
test_bzero (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "bzero";
(void) strcpy(one, "abcdef");
bzero(one+2, 2);
(void) strcpy(one, "abcdef");
bzero(one+2, 0);
equal(one, "abcdef", 4); /* Zero-length copy. */
+#endif
}
static void
static void
test_bcmp (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "bcmp";
check(bcmp("a", "a", 1) == 0, 1); /* Identity. */
check(bcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */
check(bcmp("alph", "beta", 4) != 0, 5);
check(bcmp("abce", "abcd", 3) == 0, 6); /* Count limited. */
check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */
+#endif
}
static void