svn commit: trunk/uClibc/test/string
vapier at uclibc.org
vapier at uclibc.org
Sat Dec 2 19:31:41 UTC 2006
Author: vapier
Date: 2006-12-02 11:31:40 -0800 (Sat, 02 Dec 2006)
New Revision: 16766
Log:
fix building when susv3 legacy stuff is disabled
Modified:
trunk/uClibc/test/string/tester.c
Changeset:
Modified: trunk/uClibc/test/string/tester.c
===================================================================
--- trunk/uClibc/test/string/tester.c 2006-12-02 19:19:38 UTC (rev 16765)
+++ trunk/uClibc/test/string/tester.c 2006-12-02 19:31:40 UTC (rev 16766)
@@ -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>"; /* Routine name for message routines. */
@@ -646,6 +652,7 @@
static void
test_index (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "index";
check (index ("abcd", 'z') == NULL, 1); /* Not found. */
(void) strcpy (one, "abcd");
@@ -658,6 +665,7 @@
(void) strcpy (one, "");
check (index (one, 'b') == NULL, 7); /* Empty string. */
check (index (one, '\0') == one, 8); /* NUL in empty string. */
+#endif
}
static void
@@ -738,6 +746,7 @@
static void
test_rindex (void)
{
+#ifdef __TEST_SUSV3_LEGACY__
it = "rindex";
check (rindex ("abcd", 'z') == NULL, 1); /* Not found. */
(void) strcpy (one, "abcd");
@@ -750,6 +759,7 @@
(void) strcpy (one, "");
check (rindex (one, 'b') == NULL, 7); /* Empty string. */
check (rindex (one, '\0') == one, 8); /* NUL in empty string. */
+#endif
}
static void
@@ -1346,6 +1356,7 @@
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";
@@ -1365,11 +1376,13 @@
(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);
@@ -1380,6 +1393,7 @@
(void) strcpy(one, "abcdef");
bzero(one+2, 0);
equal(one, "abcdef", 4); /* Zero-length copy. */
+#endif
}
static void
@@ -1409,6 +1423,7 @@
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. */
@@ -1417,6 +1432,7 @@
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
More information about the uClibc-cvs
mailing list