diff --git a/Makefile b/Makefile index c6bc71a..43b37e3 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: lalgarra +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2025/10/03 18:03:12 by lalgarra #+# #+# # -# Updated: 2025/10/08 20:53:52 by lalgarra ### ########.fr # +# Updated: 2025/10/08 20:35:23 by lalgarra ### ########.fr # # # # **************************************************************************** # @@ -22,7 +22,7 @@ TESTS := ft_isalpha_test ft_isdigit_test ft_isalnum_test ft_isascii_test \ ft_memset_test ft_bzero_test ft_memcpy_test ft_calloc_test \ ft_memmove_test ft_strlcpy_test ft_strlcat_test ft_strchr_test \ ft_strrchr_test ft_strncmp_test ft_memcmp_test ft_strnstr_test \ - ft_atoi_test ft_substr_test ft_strjoin_test ft_strtrim_test + ft_atoi_test ft_substr_test ft_strjoin_test %_test : %_test.c $(CC) $(CFLAGS) $*_test.c -L$(LIBDIR) -lft -o $*_test diff --git a/ft_strjoin_test.c b/ft_strjoin_test.c index 426a62d..aa641c6 100644 --- a/ft_strjoin_test.c +++ b/ft_strjoin_test.c @@ -6,15 +6,17 @@ /* By: lalgarra +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/10/08 20:21:32 by lalgarra #+# #+# */ -/* Updated: 2025/10/08 20:54:31 by lalgarra ### ########.fr */ +/* Updated: 2025/10/08 20:41:28 by lalgarra ### ########.fr */ /* */ /* ************************************************************************** */ + + #include "libft.h" #include #include -static void ft_putstr_fd1(char *res, int fd) +static void ft_putstr_fd1(char *res, int fd) { if (res == NULL) ft_putstr_fd("-NULL-", fd); diff --git a/ft_strnstr_test.c b/ft_strnstr_test.c index df6e60f..b1f9184 100644 --- a/ft_strnstr_test.c +++ b/ft_strnstr_test.c @@ -6,10 +6,11 @@ /* By: lalgarra +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/10/06 20:46:15 by lalgarra #+# #+# */ -/* Updated: 2025/10/08 20:55:13 by lalgarra ### ########.fr */ +/* Updated: 2025/10/07 18:00:51 by lalgarra ### ########.fr */ /* */ /* ************************************************************************** */ + #include "libft.h" #include #include @@ -102,7 +103,7 @@ static void do_test6(char *prefix, char big[], char littl[]) zero(big, littl); size = 20; memcpy(littl, "e\x00g", 3); - memcpy(big, "is there\x00 a nyacat ?", 20); + memcpy(big, "is there\x00 a nyacat ?",20); test(prefix, big, littl, size); } diff --git a/ft_strtrim_expected.output b/ft_strtrim_expected.output deleted file mode 100644 index 09f1a1f..0000000 --- a/ft_strtrim_expected.output +++ /dev/null @@ -1,6 +0,0 @@ -test 1: str1:[Lorem], result:[Lorem] -test 2: str1:[ Lorem ], result:[Lorem] -test 3: str1:[ Lorem ], result:[ore] -test 4: str1:[ ], result:[] -test 5: str1:[-NULL-], result:[] -test 6: str1:[Lorem], result:[Lorem] diff --git a/ft_strtrim_test.c b/ft_strtrim_test.c deleted file mode 100644 index df42a61..0000000 --- a/ft_strtrim_test.c +++ /dev/null @@ -1,50 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strtrim_test.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: lalgarra +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/10/08 20:50:12 by lalgarra #+# #+# */ -/* Updated: 2025/10/08 21:53:15 by lalgarra ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" -#include -#include - -static void ft_putstr_fd1(char *res, int fd) -{ - if (res == NULL) - ft_putstr_fd("-NULL-", fd); - else - ft_putstr_fd(res, fd); -} - -static void test(char *prefix, char *str1, char *set) -{ - char *res; - int fd; - - fd = STDOUT_FILENO; - ft_putstr_fd(prefix, fd); - ft_putstr_fd("str1:[", fd); - ft_putstr_fd1(str1, fd); - res = ft_strtrim(str1, set); - ft_putstr_fd("], result:[", fd); - ft_putstr_fd1(res, fd); - free(res); - ft_putendl_fd("]", fd); -} - -int main(void) -{ - test("test 1: ", "Lorem", " "); - test("test 2: ", " Lorem ", " "); - test("test 3: ", " Lorem ", " Lm"); - test("test 4: ", " ", " "); - test("test 5: ", (void *)0, " "); - test("test 6: ", "Lorem", (void *)0); - return (0); -}