aboutsummaryrefslogtreecommitdiff
path: root/string/test-strncasecmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/test-strncasecmp.c')
-rw-r--r--string/test-strncasecmp.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/string/test-strncasecmp.c b/string/test-strncasecmp.c
index 1aebc37..126ced9 100644
--- a/string/test-strncasecmp.c
+++ b/string/test-strncasecmp.c
@@ -29,12 +29,10 @@
typedef int (*proto_t) (const char *, const char *, size_t);
static int simple_strncasecmp (const char *, const char *, size_t);
-static int stupid_strncasecmp (const char *, const char *, size_t);
-IMPL (stupid_strncasecmp, 0)
-IMPL (simple_strncasecmp, 0)
IMPL (strncasecmp, 1)
+/* Naive implementation to verify results. */
static int
simple_strncasecmp (const char *s1, const char *s2, size_t n)
{
@@ -55,27 +53,6 @@ simple_strncasecmp (const char *s1, const char *s2, size_t n)
}
static int
-stupid_strncasecmp (const char *s1, const char *s2, size_t max)
-{
- size_t ns1 = strlen (s1) + 1;
- size_t ns2 = strlen (s2) + 1;
- size_t n = ns1 < ns2 ? ns1 : ns2;
- if (n > max)
- n = max;
- int ret = 0;
-
- while (n--)
- {
- if ((ret = ((unsigned char) tolower (*s1)
- - (unsigned char) tolower (*s2))) != 0)
- break;
- ++s1;
- ++s2;
- }
- return ret;
-}
-
-static int
check_result (impl_t *impl, const char *s1, const char *s2, size_t n,
int exp_result)
{