|
@@ -40,6 +40,12 @@
|
|
|
# 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>";
|
|
@@ -646,6 +652,7 @@ test_rawmemchr (void)
|
|
|
static void
|
|
|
test_index (void)
|
|
|
{
|
|
|
+#ifdef __TEST_SUSV3_LEGACY__
|
|
|
it = "index";
|
|
|
check (index ("abcd", 'z') == NULL, 1);
|
|
|
(void) strcpy (one, "abcd");
|
|
@@ -658,6 +665,7 @@ test_index (void)
|
|
|
(void) strcpy (one, "");
|
|
|
check (index (one, 'b') == NULL, 7);
|
|
|
check (index (one, '\0') == one, 8);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void
|
|
@@ -738,6 +746,7 @@ test_memrchr (void)
|
|
|
static void
|
|
|
test_rindex (void)
|
|
|
{
|
|
|
+#ifdef __TEST_SUSV3_LEGACY__
|
|
|
it = "rindex";
|
|
|
check (rindex ("abcd", 'z') == NULL, 1);
|
|
|
(void) strcpy (one, "abcd");
|
|
@@ -750,6 +759,7 @@ test_rindex (void)
|
|
|
(void) strcpy (one, "");
|
|
|
check (rindex (one, 'b') == NULL, 7);
|
|
|
check (rindex (one, '\0') == one, 8);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void
|
|
@@ -1346,6 +1356,7 @@ test_memset (void)
|
|
|
static void
|
|
|
test_bcopy (void)
|
|
|
{
|
|
|
+#ifdef __TEST_SUSV3_LEGACY__
|
|
|
|
|
|
don't test it. */
|
|
|
it = "bcopy";
|
|
@@ -1365,11 +1376,13 @@ test_bcopy (void)
|
|
|
(void) bcopy(one, two, 9);
|
|
|
equal(two, "hi there", 4);
|
|
|
equal(one, "hi there", 5);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void
|
|
|
test_bzero (void)
|
|
|
{
|
|
|
+#ifdef __TEST_SUSV3_LEGACY__
|
|
|
it = "bzero";
|
|
|
(void) strcpy(one, "abcdef");
|
|
|
bzero(one+2, 2);
|
|
@@ -1380,6 +1393,7 @@ test_bzero (void)
|
|
|
(void) strcpy(one, "abcdef");
|
|
|
bzero(one+2, 0);
|
|
|
equal(one, "abcdef", 4);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void
|
|
@@ -1409,6 +1423,7 @@ test_strndup (void)
|
|
|
static void
|
|
|
test_bcmp (void)
|
|
|
{
|
|
|
+#ifdef __TEST_SUSV3_LEGACY__
|
|
|
it = "bcmp";
|
|
|
check(bcmp("a", "a", 1) == 0, 1);
|
|
|
check(bcmp("abc", "abc", 3) == 0, 2);
|
|
@@ -1417,6 +1432,7 @@ test_bcmp (void)
|
|
|
check(bcmp("alph", "beta", 4) != 0, 5);
|
|
|
check(bcmp("abce", "abcd", 3) == 0, 6);
|
|
|
check(bcmp("abc", "def", 0) == 0, 8);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void
|