From 472b8f20c0f74d20dbb434abce10ee86054b9975 Mon Sep 17 00:00:00 2001 From: yctct Date: Thu, 5 Feb 2026 12:18:33 +0100 Subject: Remove tests --- ft_memcmp.c | 87 ------------------------------------------------------------- 1 file changed, 87 deletions(-) (limited to 'ft_memcmp.c') diff --git a/ft_memcmp.c b/ft_memcmp.c index 32f8eec..0993493 100644 --- a/ft_memcmp.c +++ b/ft_memcmp.c @@ -33,90 +33,3 @@ int ft_memcmp(const void *s1, const void *s2, size_t n) return (cs1[i] - cs2[i]); } -/* -#include - -int main(void) -{ - char s[] = {-128, 0, 127, 0}; - char sCpy[] = {-128, 0, 127, 0}; - - printf("%i\n", ft_memcmp(s, sCpy, 4)); - printf("%i\n", memcmp(s, sCpy, 4)); - printf("%i\n", ft_memcmp("abcdefghij", "abcdefgxyz", 7)); - printf("%i\n", memcmp("abcdefghij", "abcdefgxyz", 7)); -} -int ft_memcmp(const void *s1, const void *s2, size_t n) -{ - size_t i; - unsigned char *a; - unsigned char *b; - - i = 0; - a = (unsigned char *)s1; - b = (unsigned char *)s2; - if (s1 == s2 || n == 0) - return (0); - while (*a == *b && i < n - 1) - { - a++; - b++; - i++; - } - return (*a - *b); -} -*/ -/* -int main(void) -{ - char s[] = {-128, 0, 127, 0}; - char sCpy[] = {-128, 0, 127, 0}; - char s2[] = {0, 0, 127, 0}; - char s3[] = {0, 0, 42, 0}; - - printf("\n"); - printf("%i\n", ft_memcmp(s, sCpy, 4)); - printf("%i\n", memcmp(s, sCpy, 4)); - printf("\n"); - printf("%i\n", ft_memcmp(s, s2, 0)); - printf("%i\n", memcmp(s, s2, 0)); - printf("\n"); - printf("%i\n", ft_memcmp(s, s2, 1)); - printf("%i\n", memcmp(s, s2, 1)); - printf("\n"); - printf("%i\n", ft_memcmp(s2, s, 1)); - printf("%i\n", memcmp(s2, s, 1)); - printf("\n"); - printf("%i\n", ft_memcmp(s2, s3, 4)); - printf("%i\n", memcmp(s2, s3, 4)); - printf("\n"); - printf("\n"); - printf("%i\n", ft_memcmp("salut", "salut", 5)); - printf("%i\n", memcmp("salut", "salut", 5)); - printf("\n"); - printf("%i\n", ft_memcmp("t\200", "t\0", 2)); - printf("%i\n", memcmp("t\200", "t\0", 2)); - printf("\n"); - printf("%i\n", ft_memcmp("testss", "test", 5)); - printf("%i\n", memcmp("testss", "test", 5)); - printf("\n"); - printf("%i\n", ft_memcmp("test", "tEst", 4)); - printf("%i\n", memcmp("test", "tEst", 4)); - printf("\n"); - printf("%i\n", ft_memcmp("", "test", 4)); - printf("%i\n", memcmp("", "test", 4)); - printf("\n"); - printf("%i\n", ft_memcmp("test", "", 4)); - printf("%i\n", memcmp("test", "", 4)); - printf("\n"); - printf("%i\n", ft_memcmp("abcdefghij", "abcdefgxyz", 7)); - printf("%i\n", memcmp("abcdefghij", "abcdefgxyz", 7)); - printf("\n"); - printf("%i\n", ft_memcmp("abcdefgh", "abcdwxyz", 6)); - printf("%i\n", memcmp("abcdefgh", "abcdwxyz", 6)); - printf("\n"); - printf("%i\n", ft_memcmp("zyxbcdefgh", "abcdefgxyz", 0)); - printf("%i\n", memcmp("zyxbcdefgh", "abcdefgxyz", 0)); - return (0); -} -*/ -- cgit v1.2.3