Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* string/tester.c: Mark test functions as static to avoid warnings.
  • Loading branch information
Ulrich Drepper committed Nov 26, 2000
1 parent 03fb20b commit c3560df
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 39 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2000-11-25 Ulrich Drepper <drepper@redhat.com>

* string/tester.c: Mark test functions as static to avoid warnings.

* iconv/gconv_conf.c (read_conf_file): Make mod_counter static to
preserve value over different gconv-modules files.

Expand Down
79 changes: 40 additions & 39 deletions string/tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const char *it = "<UNSET>"; /* Routine name for message routines. */
size_t errors = 0;

/* Complain if condition is not true. */
void
static void
check (int thing, int number)
{
if (!thing)
Expand All @@ -56,7 +56,7 @@ check (int thing, int number)
}

/* Complain if first two args don't strcmp as equal. */
void
static void
equal (const char *a, const char *b, int number)
{
check(a != NULL && b != NULL && STREQ (a, b), number);
Expand All @@ -66,7 +66,7 @@ char one[50];
char two[50];
char *cp;

void
static void
test_strcmp (void)
{
it = "strcmp";
Expand Down Expand Up @@ -120,15 +120,15 @@ test_strcmp (void)
do { \
int __n; \
char *cp; \
for (__n = 0; __n < sizeof (one); ++__n) \
for (__n = 0; __n < (int) sizeof (one); ++__n) \
one[__n] = 'Z'; \
fn (one, str); \
for (cp = one, __n = 0; __n < n; ++__n, ++cp) \
check (*cp == '0' + (n % 10), ntest); \
check (*cp == '\0', ntest); \
} while (0)

void
static void
test_strcpy (void)
{
int i;
Expand Down Expand Up @@ -175,7 +175,7 @@ test_strcpy (void)
SIMPLE_COPY(strcpy, 16, "6666666666666666", 57);
}

void
static void
test_stpcpy (void)
{
it = "stpcpy";
Expand Down Expand Up @@ -257,7 +257,7 @@ test_stpcpy (void)
SIMPLE_COPY(stpcpy, 16, "6666666666666666", 59);
}

void
static void
test_stpncpy (void)
{
it = "stpncpy";
Expand All @@ -272,7 +272,7 @@ test_stpncpy (void)
check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8);
}

void
static void
test_strcat (void)
{
it = "strcat";
Expand Down Expand Up @@ -302,7 +302,7 @@ test_strcat (void)
equal (one, "cd", 9);
}

void
static void
test_strncat (void)
{
/* First test it as strcat, with big counts, then test the count
Expand Down Expand Up @@ -344,7 +344,7 @@ test_strncat (void)
equal (one, "abcdgh", 12); /* Count and length equal. */
}

void
static void
test_strncmp (void)
{
/* First test as strcmp with big counts, then test count code. */
Expand All @@ -364,7 +364,7 @@ test_strncmp (void)
check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */
}

void
static void
test_strncpy (void)
{
/* Testing is a bit different because of odd semantics. */
Expand Down Expand Up @@ -406,7 +406,7 @@ test_strncpy (void)
equal (one, "hi there", 15); /* Stomped on source? */
}

void
static void
test_strlen (void)
{
it = "strlen";
Expand All @@ -427,7 +427,7 @@ test_strlen (void)
}
}

void
static void
test_strchr (void)
{
it = "strchr";
Expand Down Expand Up @@ -456,7 +456,7 @@ test_strchr (void)
}
}

void
static void
test_strchrnul (void)
{
const char *os;
Expand Down Expand Up @@ -490,7 +490,7 @@ test_strchrnul (void)
}
}

void
static void
test_rawmemchr (void)
{
it = "rawmemchr";
Expand All @@ -517,7 +517,7 @@ test_rawmemchr (void)
}
}

void
static void
test_index (void)
{
it = "index";
Expand All @@ -534,7 +534,7 @@ test_index (void)
check (index (one, '\0') == one, 8); /* NUL in empty string. */
}

void
static void
test_strrchr (void)
{
it = "strrchr";
Expand Down Expand Up @@ -563,7 +563,7 @@ test_strrchr (void)
}
}

void
static void
test_memrchr (void)
{
size_t l;
Expand Down Expand Up @@ -609,7 +609,7 @@ test_memrchr (void)
}
}

void
static void
test_rindex (void)
{
it = "rindex";
Expand All @@ -626,7 +626,7 @@ test_rindex (void)
check (rindex (one, '\0') == one, 8); /* NUL in empty string. */
}

void
static void
test_strpbrk (void)
{
it = "strpbrk";
Expand Down Expand Up @@ -655,7 +655,7 @@ test_strpbrk (void)
check(strpbrk(one, "efgh") == one+6, 17); /* And yet another. */
}

void
static void
test_strstr (void)
{
it = "strstr";
Expand All @@ -682,7 +682,7 @@ test_strstr (void)
check(strstr(one, "bbca") == one+1, 16); /* With overlap. */
}

void
static void
test_strspn (void)
{
it = "strspn";
Expand All @@ -693,7 +693,7 @@ test_strspn (void)
check(strspn("abc", "") == 0, 5); /* Null search list. */
}

void
static void
test_strcspn (void)
{
it = "strcspn";
Expand All @@ -704,7 +704,7 @@ test_strcspn (void)
check(strcspn("abc", "") == 3, 5); /* Null search list. */
}

void
static void
test_strtok (void)
{
it = "strtok";
Expand Down Expand Up @@ -754,7 +754,7 @@ test_strtok (void)
equal(one+4, "c", 33);
}

void
static void
test_strtok_r (void)
{
it = "strtok_r";
Expand Down Expand Up @@ -804,7 +804,7 @@ test_strtok_r (void)
equal(one+4, "c", 33);
}

void
static void
test_strsep (void)
{
char *ptr;
Expand Down Expand Up @@ -937,7 +937,7 @@ test_strsep (void)
check(cp == NULL, 88);
}

void
static void
test_memcmp (void)
{
it = "memcmp";
Expand All @@ -951,7 +951,7 @@ test_memcmp (void)
check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */
}

void
static void
test_memchr (void)
{
it = "memchr";
Expand Down Expand Up @@ -994,7 +994,7 @@ test_memchr (void)
}
}

void
static void
test_memcpy (void)
{
int i;
Expand Down Expand Up @@ -1031,7 +1031,7 @@ test_memcpy (void)
}
}

void
static void
test_mempcpy (void)
{
int i;
Expand Down Expand Up @@ -1068,7 +1068,7 @@ test_mempcpy (void)
}
}

void
static void
test_memmove (void)
{
it = "memmove";
Expand Down Expand Up @@ -1102,7 +1102,7 @@ test_memmove (void)
equal(one, "abcdefgh", 9); /* 100% overlap. */
}

void
static void
test_memccpy (void)
{
/* First test like memcpy, then the search part The SVID, the only
Expand Down Expand Up @@ -1144,7 +1144,7 @@ test_memccpy (void)
equal(two, "xbcdlebee", 15);
}

void
static void
test_memset (void)
{
int i;
Expand All @@ -1166,7 +1166,7 @@ test_memset (void)

/* Non-8bit fill character. */
memset (one, 0x101, sizeof (one));
for (i = 0; i < sizeof (one); ++i)
for (i = 0; i < (int) sizeof (one); ++i)
check (one[i] == '\01', 7);

/* Test for more complex versions of memset, for all alignments and
Expand Down Expand Up @@ -1206,7 +1206,7 @@ test_memset (void)
}
}

void
static void
test_bcopy (void)
{
/* Much like memcpy. Berklix manual is silent about overlap, so
Expand All @@ -1230,7 +1230,7 @@ test_bcopy (void)
equal(one, "hi there", 5); /* Stomped on source? */
}

void
static void
test_bzero (void)
{
it = "bzero";
Expand All @@ -1245,7 +1245,7 @@ test_bzero (void)
equal(one, "abcdef", 4); /* Zero-length copy. */
}

void
static void
test_bcmp (void)
{
it = "bcmp";
Expand All @@ -1258,7 +1258,7 @@ test_bcmp (void)
check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */
}

void
static void
test_strerror (void)
{
int f;
Expand Down Expand Up @@ -1386,5 +1386,6 @@ main (void)
status = EXIT_FAILURE;
printf("%Zd errors.\n", errors);
}
exit(status);

return status;
}

0 comments on commit c3560df

Please sign in to comment.