├── tests ├── Bonus_functions │ ├── ft_lstsize │ │ ├── test01.output │ │ ├── test02.output │ │ └── test03.output │ ├── ft_lstlast │ │ ├── test01.output │ │ └── test02.output │ ├── ft_lstnew │ │ ├── test03.output │ │ ├── test02.output │ │ └── test01.output │ ├── ft_lstiter │ │ └── test01.output │ ├── ft_lstadd_back │ │ └── test01.output │ ├── ft_lstadd_front │ │ └── test01.output │ ├── ft_lstclear │ │ └── test01.output │ ├── ft_lstdelone │ │ └── test01.output │ └── ft_lstmap │ │ └── test01.output ├── Part1_functions │ ├── ft_atoi │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test09.output │ │ ├── test10.output │ │ ├── test11.output │ │ ├── test12.output │ │ ├── test13.output │ │ ├── test14.output │ │ ├── test17.output │ │ ├── test18.output │ │ ├── test19.output │ │ ├── test16.output │ │ └── test15.output │ ├── ft_memcmp │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test09.output │ │ └── main.c │ ├── ft_strchr │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ └── main.c │ ├── ft_strlen │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ └── main.c │ ├── ft_strncmp │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test09.output │ │ ├── test10.output │ │ └── test11.output │ ├── ft_strrchr │ │ ├── test03.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test05.output │ │ └── test08.output │ ├── ft_bzero │ │ ├── test01.output │ │ ├── test02.output │ │ └── main.c │ ├── ft_isalnum │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_isalpha │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_isascii │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_isdigit │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_isprint │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_memchr │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ └── main.c │ ├── ft_strnstr │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test09.output │ │ ├── test10.output │ │ ├── test06.output │ │ ├── test02.output │ │ ├── test01.output │ │ ├── test04.output │ │ └── test03.output │ ├── ft_tolower │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_toupper │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_memset │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test03.output │ │ └── main.c │ ├── ft_memmove │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ └── main.c │ ├── ft_strlcat │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ └── test09.output │ ├── ft_strlcpy │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ └── test05.output │ ├── ft_strdup │ │ ├── test01.output │ │ └── main.c │ ├── ft_calloc │ │ ├── test01.output │ │ └── main.c │ ├── ft_memcpy │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ └── main.c │ └── ft_memccpy │ │ ├── test03.output │ │ ├── test02.output │ │ ├── test01.output │ │ └── test04.output ├── Part2_functions │ ├── ft_itoa │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test10.output │ │ ├── test09.output │ │ └── main.c │ ├── ft_putstr_fd │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test01.output │ │ ├── test02.output │ │ └── main.c │ ├── ft_split │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test05.output │ │ └── test04.output │ ├── ft_strjoin │ │ ├── test04.output │ │ ├── test03.output │ │ ├── test02.output │ │ ├── test01.output │ │ └── main.c │ ├── ft_strtrim │ │ ├── test05.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test01.output │ │ └── test04.output │ ├── ft_substr │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test01.output │ │ ├── test02.output │ │ └── main.c │ ├── ft_putnbr_fd │ │ ├── test01.output │ │ ├── test02.output │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test05.output │ │ ├── test06.output │ │ ├── test07.output │ │ ├── test08.output │ │ ├── test09.output │ │ └── main.c │ ├── ft_putchar_fd │ │ ├── test03.output │ │ ├── test05.output │ │ ├── test07.output │ │ ├── test02.output │ │ ├── test04.output │ │ ├── test06.output │ │ └── test01.output │ ├── ft_putendl_fd │ │ ├── test03.output │ │ ├── test04.output │ │ ├── test01.output │ │ ├── test02.output │ │ └── main.c │ └── ft_strmapi │ │ └── test01.output └── Additional_functions │ ├── ft_putnbr │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ ├── test08.output │ ├── test09.output │ └── main.c │ ├── ft_putstr │ ├── test03.output │ ├── test04.output │ ├── test01.output │ ├── test02.output │ └── main.c │ ├── ft_strcmp │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ └── main.c │ ├── ft_strequ │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ └── main.c │ ├── ft_strndup │ ├── test02.output │ ├── test01.output │ ├── test03.output │ └── main.c │ ├── ft_strnequ │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ ├── test08.output │ ├── test09.output │ ├── test10.output │ └── test11.output │ ├── ft_strnew │ ├── test02.output │ ├── test01.output │ └── main.c │ ├── ft_isblank │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_iscntrl │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_isgraph │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_islower │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_isspace │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_isupper │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_isxdigit │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_memdel │ ├── test01.output │ └── main.c │ ├── ft_putchar │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_putendl │ ├── test03.output │ ├── test04.output │ ├── test01.output │ ├── test02.output │ └── main.c │ ├── ft_strcasecmp │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ └── main.c │ ├── ft_strcasestr │ ├── test05.output │ ├── test07.output │ ├── test06.output │ ├── test02.output │ ├── test01.output │ ├── test04.output │ ├── test03.output │ └── main.c │ ├── ft_strdel │ ├── test01.output │ └── main.c │ ├── ft_strncasecmp │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ ├── test06.output │ ├── test07.output │ ├── test08.output │ ├── test09.output │ ├── test10.output │ └── test11.output │ ├── ft_strstr │ ├── test05.output │ ├── test07.output │ ├── test06.output │ ├── test02.output │ ├── test01.output │ ├── test04.output │ └── test03.output │ ├── ft_str_is_alpha │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_str_is_numeric │ ├── test07.output │ ├── test02.output │ ├── test03.output │ ├── test05.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_strclr │ ├── test01.output │ └── main.c │ ├── ft_striter │ ├── test01.output │ └── main.c │ ├── ft_striteri │ ├── test01.output │ └── main.c │ ├── ft_strmap │ ├── test01.output │ └── main.c │ ├── ft_str_is_lowercase │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_str_is_printable │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_str_is_uppercase │ ├── test03.output │ ├── test05.output │ ├── test07.output │ ├── test02.output │ ├── test04.output │ ├── test06.output │ ├── test01.output │ └── main.c │ ├── ft_strcat │ ├── test01.output │ ├── test02.output │ ├── test03.output │ └── main.c │ ├── ft_strcpy │ ├── test01.output │ ├── test02.output │ ├── test03.output │ └── main.c │ ├── ft_strncat │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ └── main.c │ ├── ft_strncpy │ ├── test01.output │ ├── test02.output │ ├── test03.output │ ├── test04.output │ ├── test05.output │ └── test06.output │ ├── ft_strtok │ ├── test03.output │ ├── test01.output │ ├── test02.output │ └── main.c │ ├── ft_memalloc │ ├── test01.output │ └── main.c │ ├── ft_strlowcase │ ├── test01.output │ ├── test02.output │ ├── test03.output │ └── main.c │ ├── ft_strupcase │ ├── test01.output │ ├── test02.output │ ├── test03.output │ └── main.c │ ├── ft_strcapitalize │ ├── test01.output │ ├── test02.output │ ├── test03.output │ └── main.c │ └── ft_itoa_base │ ├── test10.output │ ├── test11.output │ ├── test12.output │ ├── test13.output │ ├── test14.output │ ├── test15.output │ ├── test08.output │ ├── test06.output │ ├── test07.output │ ├── test09.output │ ├── test05.output │ ├── test04.output │ ├── test03.output │ ├── test02.output │ └── test01.output ├── .gitignore ├── srcs ├── img_readme.png ├── variables │ ├── display.sh │ ├── options.sh │ ├── functions │ │ ├── bonus.sh │ │ └── part_2.sh │ ├── colors.sh │ └── core.sh ├── config_template.sh ├── check_compilation.sh └── check_norme.sh └── supported_functions.md /tests/Bonus_functions/ft_lstsize/test01.output: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstsize/test02.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstsize/test03.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test02.output: -------------------------------------------------------------------------------- 1 | 546 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test03.output: -------------------------------------------------------------------------------- 1 | -4886 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test04.output: -------------------------------------------------------------------------------- 1 | 548 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test05.output: -------------------------------------------------------------------------------- 1 | 54854 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test06.output: -------------------------------------------------------------------------------- 1 | 74 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test07.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test08.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test09.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test10.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test11.output: -------------------------------------------------------------------------------- 1 | 47 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test12.output: -------------------------------------------------------------------------------- 1 | -47 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test13.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test14.output: -------------------------------------------------------------------------------- 1 | 469 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test17.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test18.output: -------------------------------------------------------------------------------- 1 | -46 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test19.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test02.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test03.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test04.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test05.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test06.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test07.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test08.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/test09.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test05.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test06.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test01.output: -------------------------------------------------------------------------------- 1 | 7 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test02.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test03.output: -------------------------------------------------------------------------------- 1 | 27 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test04.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test05.output: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/test06.output: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test02.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test03.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test04.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test05.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test06.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test07.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test08.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test09.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test10.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strncmp/test11.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test03.output: -------------------------------------------------------------------------------- 1 | o -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test06.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test07.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test02.output: -------------------------------------------------------------------------------- 1 | 9 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test03.output: -------------------------------------------------------------------------------- 1 | -9 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test04.output: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test05.output: -------------------------------------------------------------------------------- 1 | -10 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test06.output: -------------------------------------------------------------------------------- 1 | 8124 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test07.output: -------------------------------------------------------------------------------- 1 | -9874 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putstr_fd/test03.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_split/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strjoin/test04.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strtrim/test05.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_substr/test03.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_substr/test04.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test02.output: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test03.output: -------------------------------------------------------------------------------- 1 | -5 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test04.output: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test05.output: -------------------------------------------------------------------------------- 1 | -57 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putstr/test03.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test02.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test03.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test04.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test05.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test06.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/test07.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test01.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test02.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test03.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test04.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test05.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test06.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/test07.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strndup/test02.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test01.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test02.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test03.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test04.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test05.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test06.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test07.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test08.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test09.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test10.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnequ/test11.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnew/test02.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test16.output: -------------------------------------------------------------------------------- 1 | 2147483647 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_bzero/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_bzero/test02.output: -------------------------------------------------------------------------------- 1 | eeeee -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test03.output: -------------------------------------------------------------------------------- 1 | 1111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test05.output: -------------------------------------------------------------------------------- 1 | 111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test07.output: -------------------------------------------------------------------------------- 1 | 11111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test03.output: -------------------------------------------------------------------------------- 1 | 1111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test05.output: -------------------------------------------------------------------------------- 1 | 111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test07.output: -------------------------------------------------------------------------------- 1 | 11110 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test01.output: -------------------------------------------------------------------------------- 1 | bonjour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test02.output: -------------------------------------------------------------------------------- 1 | onjour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test03.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test04.output: -------------------------------------------------------------------------------- 1 | jour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test05.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test01.output: -------------------------------------------------------------------------------- 1 | bonjour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test02.output: -------------------------------------------------------------------------------- 1 | onjour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test03.output: -------------------------------------------------------------------------------- 1 | jour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/test04.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test05.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test07.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test08.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test09.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test10.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test01.output: -------------------------------------------------------------------------------- 1 | bonjour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test02.output: -------------------------------------------------------------------------------- 1 | our -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test04.output: -------------------------------------------------------------------------------- 1 | jour -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test05.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strrchr/test08.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test03.output: -------------------------------------------------------------------------------- 1 | :;<=>?@ -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test05.output: -------------------------------------------------------------------------------- 1 | [\]^_` -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test07.output: -------------------------------------------------------------------------------- 1 | {|}~ -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test03.output: -------------------------------------------------------------------------------- 1 | :;<=>?@ -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test05.output: -------------------------------------------------------------------------------- 1 | [\]^_` -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test07.output: -------------------------------------------------------------------------------- 1 | {|}~ -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test08.output: -------------------------------------------------------------------------------- 1 | 543000 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test10.output: -------------------------------------------------------------------------------- 1 | 2147483647 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test02.output: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test03.output: -------------------------------------------------------------------------------- 1 | -5 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test04.output: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test05.output: -------------------------------------------------------------------------------- 1 | -57 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test07.output: -------------------------------------------------------------------------------- 1 | 00001 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test03.output: -------------------------------------------------------------------------------- 1 | 1111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test05.output: -------------------------------------------------------------------------------- 1 | 111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test07.output: -------------------------------------------------------------------------------- 1 | 11110 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_memdel/test01.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test03.output: -------------------------------------------------------------------------------- 1 | :;<=>?@ -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test05.output: -------------------------------------------------------------------------------- 1 | [\]^_` -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test07.output: -------------------------------------------------------------------------------- 1 | {|}~ -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putendl/test03.output: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test06.output: -------------------------------------------------------------------------------- 1 | 164189 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test07.output: -------------------------------------------------------------------------------- 1 | -987441 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test02.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test03.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test04.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test05.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test06.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/test07.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test05.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test07.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strdel/test01.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test01.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test02.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test03.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test04.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test05.output: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test06.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test07.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test08.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test09.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test10.output: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncasecmp/test11.output: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test05.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test07.output: -------------------------------------------------------------------------------- 1 | NULL -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstlast/test01.output: -------------------------------------------------------------------------------- 1 | gbcdef 2 | -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstlast/test02.output: -------------------------------------------------------------------------------- 1 | gbcdef 2 | -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstnew/test03.output: -------------------------------------------------------------------------------- 1 | NULL 2 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_atoi/test15.output: -------------------------------------------------------------------------------- 1 | -2147483648 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test02.output: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test02.output: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/test09.output: -------------------------------------------------------------------------------- 1 | -2147483648 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test03.output: -------------------------------------------------------------------------------- 1 | :;<=>?@ -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test05.output: -------------------------------------------------------------------------------- 1 | [\]^_` -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test07.output: -------------------------------------------------------------------------------- 1 | {|}~ -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putendl_fd/test03.output: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test06.output: -------------------------------------------------------------------------------- 1 | 164189 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test07.output: -------------------------------------------------------------------------------- 1 | -987441 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test08.output: -------------------------------------------------------------------------------- 1 | 2147483647 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strjoin/test03.output: -------------------------------------------------------------------------------- 1 | lorem ipsum -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strmapi/test01.output: -------------------------------------------------------------------------------- 1 | lOrEm IpSuM -------------------------------------------------------------------------------- /tests/Part2_functions/ft_substr/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsu -------------------------------------------------------------------------------- /tests/Part2_functions/ft_substr/test02.output: -------------------------------------------------------------------------------- 1 | psum dolor -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test02.output: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test08.output: -------------------------------------------------------------------------------- 1 | 2147483647 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/test09.output: -------------------------------------------------------------------------------- 1 | -2147483648 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strclr/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_striter/test01.output: -------------------------------------------------------------------------------- 1 | lOrEm IpSuM -------------------------------------------------------------------------------- /tests/Additional_functions/ft_striteri/test01.output: -------------------------------------------------------------------------------- 1 | lOrEm IpSuM -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strmap/test01.output: -------------------------------------------------------------------------------- 1 | lOrEm IpSuM -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strndup/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstnew/test02.output: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memset/test01.output: -------------------------------------------------------------------------------- 1 | cccccjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memset/test02.output: -------------------------------------------------------------------------------- 1 | ccccccccccccccj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memset/test04.output: -------------------------------------------------------------------------------- 1 | jjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test06.output: -------------------------------------------------------------------------------- 1 | dolor sit amet -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test02.output: -------------------------------------------------------------------------------- 1 | 0123456789 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/test09.output: -------------------------------------------------------------------------------- 1 | -2147483648 -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putstr_fd/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum do -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strjoin/test02.output: -------------------------------------------------------------------------------- 1 | dolor sit amet -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | user_output_test* 2 | deepthought 3 | my_config.sh 4 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putstr/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum do -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test03.output: -------------------------------------------------------------------------------- 1 | 1111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test05.output: -------------------------------------------------------------------------------- 1 | 111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test07.output: -------------------------------------------------------------------------------- 1 | 11110 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test03.output: -------------------------------------------------------------------------------- 1 | 0000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test05.output: -------------------------------------------------------------------------------- 1 | 000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test07.output: -------------------------------------------------------------------------------- 1 | 00000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test06.output: -------------------------------------------------------------------------------- 1 | dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcat/test01.output: -------------------------------------------------------------------------------- 1 | rrrrrrlorem -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcat/test02.output: -------------------------------------------------------------------------------- 1 | rrrrrr -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcat/test03.output: -------------------------------------------------------------------------------- 1 | lorem ipsum -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcpy/test01.output: -------------------------------------------------------------------------------- 1 | loremfff -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcpy/test02.output: -------------------------------------------------------------------------------- 1 | lorem ipsum -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcpy/test03.output: -------------------------------------------------------------------------------- 1 | ffffffff -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/test01.output: -------------------------------------------------------------------------------- 1 | rrrrrrlo -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/test02.output: -------------------------------------------------------------------------------- 1 | rrrrrrlorem -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/test03.output: -------------------------------------------------------------------------------- 1 | rrrrrr -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/test04.output: -------------------------------------------------------------------------------- 1 | rrrrrr -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/test05.output: -------------------------------------------------------------------------------- 1 | lorem ipsu -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test01.output: -------------------------------------------------------------------------------- 1 | loremsssssss -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test02.output: -------------------------------------------------------------------------------- 1 | loremsssss -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test03.output: -------------------------------------------------------------------------------- 1 | ssssssssss -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test04.output: -------------------------------------------------------------------------------- 1 | lorssssssssss -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test05.output: -------------------------------------------------------------------------------- 1 | sssssssssssss -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncpy/test06.output: -------------------------------------------------------------------------------- 1 | lorem ipsu -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test06.output: -------------------------------------------------------------------------------- 1 | dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strtok/test03.output: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/test01.output: -------------------------------------------------------------------------------- 1 | conseipsum dolor sit a -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/test02.output: -------------------------------------------------------------------------------- 1 | consect dolor sit a -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/test03.output: -------------------------------------------------------------------------------- 1 | lorem ipum dolor sit a -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/test04.output: -------------------------------------------------------------------------------- 1 | orem ipssum dolor sit -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/test05.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test01.output: -------------------------------------------------------------------------------- 1 | 11 2 | rrrrrrlorem -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test02.output: -------------------------------------------------------------------------------- 1 | 6 2 | rrrrrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test03.output: -------------------------------------------------------------------------------- 1 | 11 2 | lorem ipsum -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test04.output: -------------------------------------------------------------------------------- 1 | 32 2 | rrrrrrlorem ip -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test05.output: -------------------------------------------------------------------------------- 1 | 26 2 | rrrrrra -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test06.output: -------------------------------------------------------------------------------- 1 | 27 2 | rrrrrra -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test07.output: -------------------------------------------------------------------------------- 1 | 31 2 | rrrrrrrrrrrrrrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test08.output: -------------------------------------------------------------------------------- 1 | 32 2 | rrrrrra -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcat/test09.output: -------------------------------------------------------------------------------- 1 | 40 2 | rrrrrrrrrrrrrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcpy/test01.output: -------------------------------------------------------------------------------- 1 | 5 2 | lorem -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcpy/test02.output: -------------------------------------------------------------------------------- 1 | 0 2 | rrrrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcpy/test03.output: -------------------------------------------------------------------------------- 1 | 11 2 | lorrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcpy/test04.output: -------------------------------------------------------------------------------- 1 | 26 2 | lorem ipsum do -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlcpy/test05.output: -------------------------------------------------------------------------------- 1 | 26 2 | rrrrrr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test02.output: -------------------------------------------------------------------------------- 1 | ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putendl_fd/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum do 2 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putendl/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum do 2 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test02.output: -------------------------------------------------------------------------------- 1 | 1111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test02.output: -------------------------------------------------------------------------------- 1 | 0000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test02.output: -------------------------------------------------------------------------------- 1 | ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strtok/test01.output: -------------------------------------------------------------------------------- 1 | abcdef;ghijkl.mnopqr -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strtok/test02.output: -------------------------------------------------------------------------------- 1 | abc,def;ghi,jkl.mno,pqr -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strdup/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test04.output: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyz -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test06.output: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyz -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test04.output: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test06.output: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strjoin/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsumdolor sit amet -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strtrim/test02.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strtrim/test03.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test04.output: -------------------------------------------------------------------------------- 1 | 11111100000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test06.output: -------------------------------------------------------------------------------- 1 | 11111100000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test04.output: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test06.output: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyz -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putstr/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test02.output: -------------------------------------------------------------------------------- 1 | iPsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strndup/test03.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Part1_functions/ft_calloc/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcpy/test01.output: -------------------------------------------------------------------------------- 1 | zyxwvutsrqponmjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcpy/test02.output: -------------------------------------------------------------------------------- 1 | jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcpy/test03.output: -------------------------------------------------------------------------------- 1 | zyxwvutjjjjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test04.output: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test06.output: -------------------------------------------------------------------------------- 1 | abcdefghijklmnopqrstuvwxyz -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putstr_fd/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_memalloc/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putendl/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet 2 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test01.output: -------------------------------------------------------------------------------- 1 | lorEm ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test04.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strlowcase/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnew/test01.output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strstr/test03.output: -------------------------------------------------------------------------------- 1 | ipsum dolor sit lorem ipsum dolor -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strupcase/test01.output: -------------------------------------------------------------------------------- 1 | LOREM IPSUM DOLOR SIT AMET -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstnew/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit 2 | 3 | NULL -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memccpy/test03.output: -------------------------------------------------------------------------------- 1 | jjj 2 | zyxwvutsrqponmlkjihgfedcbajjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strnstr/test03.output: -------------------------------------------------------------------------------- 1 | ipsum dolor sit lorem ipsum dolor -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putendl_fd/test01.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet 2 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putstr_fd/test02.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor sit amet -------------------------------------------------------------------------------- /srcs/img_readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtoty/Libftest/HEAD/srcs/img_readme.png -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putstr/test02.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test04.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test06.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test04.output: -------------------------------------------------------------------------------- 1 | 11111111111111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test06.output: -------------------------------------------------------------------------------- 1 | 00000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcapitalize/test01.output: -------------------------------------------------------------------------------- 1 | Lorem Ipsum Dolor Sit Amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/test03.output: -------------------------------------------------------------------------------- 1 | iPSum dolor sit lorem ipsum dolor -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memccpy/test02.output: -------------------------------------------------------------------------------- 1 | NULL 2 | zyxjjjjjjjjjjjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memset/test03.output: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | jjjjjjjjj -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putendl_fd/test02.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor sit amet 3 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strtrim/test01.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor 3 | sit amet -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strtrim/test04.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor 3 | sit amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putendl/test02.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum dolor sit amet 3 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strupcase/test02.output: -------------------------------------------------------------------------------- 1 | 2 | LOREM 4IPSUM DOLOR S 3 | IT AMET -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstiter/test01.output: -------------------------------------------------------------------------------- 1 | dddddd 2 | dddddd 3 | dddddd 4 | dddddd 5 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcapitalize/test02.output: -------------------------------------------------------------------------------- 1 | 2 | Lorem 4ipsum Dolor S 3 | It Amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strlowcase/test02.output: -------------------------------------------------------------------------------- 1 | 2 | lorem 4ipsum dolor s 3 | it amet -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strlowcase/test03.output: -------------------------------------------------------------------------------- 1 | hey ! 42mots quarante-deux; cinquante+et+un -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strupcase/test03.output: -------------------------------------------------------------------------------- 1 | HEY ! 42MOTS QUARANTE-DEUX; CINQUANTE+ET+UN -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstadd_back/test01.output: -------------------------------------------------------------------------------- 1 | gbcdef 2 | dbcdef 3 | bbcdef 4 | abcdef 5 | -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstadd_front/test01.output: -------------------------------------------------------------------------------- 1 | abcdef 2 | bbcdef 3 | dbcdef 4 | gbcdef 5 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/test01.output: -------------------------------------------------------------------------------- 1 | 111111111111111111111111111111111111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000001111111111111111 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/test01.output: -------------------------------------------------------------------------------- 1 |  2 |  !"#$%&'()*+,-./ -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/test01.output: -------------------------------------------------------------------------------- 1 |  2 |  !"#$%&'()*+,-./ -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/test01.output: -------------------------------------------------------------------------------- 1 | 000000000100000000000000000000001000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/test01.output: -------------------------------------------------------------------------------- 1 | 111111111111111111111111111111110000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/test01.output: -------------------------------------------------------------------------------- 1 | 000000000111110000000000000000001000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/test01.output: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/test01.output: -------------------------------------------------------------------------------- 1 |  2 |  !"#$%&'()*+,-./ -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstclear/test01.output: -------------------------------------------------------------------------------- 1 | abcdef 2 | bbcdef 3 | NULL 4 | NULL 5 | nb_free_done = 2 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memccpy/test01.output: -------------------------------------------------------------------------------- 1 | jjjjjjjjjjjjjjjjjjjj 2 | zyxwvutsrjjjjjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putchar_fd/test01.output: -------------------------------------------------------------------------------- 1 |  2 |  !"#$%&'()*+,-./ -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/test01.output: -------------------------------------------------------------------------------- 1 | 100000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/test01.output: -------------------------------------------------------------------------------- 1 | 100000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/test01.output: -------------------------------------------------------------------------------- 1 | 100000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/test01.output: -------------------------------------------------------------------------------- 1 | 100000000000000000000000000000001111111111111111 -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/test01.output: -------------------------------------------------------------------------------- 1 | 100000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstdelone/test01.output: -------------------------------------------------------------------------------- 1 | abcdef 2 | bbcdef 3 | NULL 4 | gbcdef 5 | nb_free_done = 1 -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memccpy/test04.output: -------------------------------------------------------------------------------- 1 | jjjjjjjjjjjjjjjjjjjjjjjjjj 2 | zyxjjjjjjjjjjjjjjjjjjjjjjjjjj -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcapitalize/test03.output: -------------------------------------------------------------------------------- 1 | Salut, Comment Tu Vas ? 42mots Trente-Deux; Vingt+Et+Un -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/test06.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtoty/Libftest/HEAD/tests/Part1_functions/ft_memchr/test06.output -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test10.output: -------------------------------------------------------------------------------- 1 | 0 2 | A 3 | A 4 | 10 5 | 10 6 | 6116 7 | 7467 8 | 340A67 9 | A02220282 10 | A02220281 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test11.output: -------------------------------------------------------------------------------- 1 | 0 2 | B 3 | B 4 | 10 5 | 10 6 | 4850 7 | 586A 8 | 2222A0 9 | 4BB2308A8 10 | 4BB2308A7 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test12.output: -------------------------------------------------------------------------------- 1 | 0 2 | C 3 | C 4 | 10 5 | 10 6 | 390C 7 | 4657 8 | 160203 9 | 282BA4AAB 10 | 282BA4AAA 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test13.output: -------------------------------------------------------------------------------- 1 | 0 2 | D 3 | D 4 | 10 5 | 10 6 | 2D64 7 | 3854 8 | 101C5A 9 | 1652CA932 10 | 1652CA931 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test14.output: -------------------------------------------------------------------------------- 1 | 0 2 | E 3 | E 4 | 10 5 | 10 6 | 2619 7 | 2DD4 8 | AAD50 9 | C87E66B8 10 | C87E66B7 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test15.output: -------------------------------------------------------------------------------- 1 | 0 2 | F 3 | F 4 | 10 5 | 10 6 | 1FBC 7 | 2692 8 | 84918 9 | 80000000 10 | 7FFFFFFF 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test08.output: -------------------------------------------------------------------------------- 1 | 0 2 | 8 3 | 8 4 | 10 5 | 10 6 | 12126 7 | 14481 8 | 1016763 9 | 5478773672 10 | 5478773671 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test06.output: -------------------------------------------------------------------------------- 1 | 0 2 | 6 3 | 6 4 | 10 5 | 10 6 | 32454 7 | 40534 8 | 4421043 9 | 104134211162 10 | 104134211161 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test07.output: -------------------------------------------------------------------------------- 1 | 0 2 | 7 3 | 7 4 | 10 5 | 10 6 | 17674 7 | 23222 8 | 2044430 9 | 20000000000 10 | 17777777777 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test09.output: -------------------------------------------------------------------------------- 1 | 0 2 | 9 3 | -9 4 | 10 5 | -10 6 | 8124 7 | -9874 8 | 543000 9 | -2147483648 10 | 2147483647 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test05.output: -------------------------------------------------------------------------------- 1 | 0 2 | 5 3 | 5 4 | 10 5 | 10 6 | 101340 7 | 113414 8 | 15345520 9 | 553032005532 10 | 553032005531 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test04.output: -------------------------------------------------------------------------------- 1 | 0 2 | 4 3 | 4 4 | 10 5 | 10 6 | 224444 7 | 303444 8 | 114334000 9 | 13344223434043 10 | 13344223434042 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test03.output: -------------------------------------------------------------------------------- 1 | 0 2 | 3 3 | 3 4 | 10 5 | 10 6 | 1332330 7 | 2122102 8 | 2010210120 9 | 2000000000000000 10 | 1333333333333333 11 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test02.output: -------------------------------------------------------------------------------- 1 | 0 2 | 2 3 | 2 4 | 10 5 | 10 6 | 102010220 7 | 111112201 8 | 1000120212010 9 | 12112122212110202102 10 | 12112122212110202101 11 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_split/test02.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum 3 | dolor 4 | sit 5 | amet, 6 | consectetur 7 | adipiscing 8 | elit. 9 | Sed 10 | non 11 | risus. 12 | Suspendisse 13 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_split/test03.output: -------------------------------------------------------------------------------- 1 | lorem 2 | ipsum 3 | dolor 4 | sit 5 | amet, 6 | consectetur 7 | adipiscing 8 | elit. 9 | Sed 10 | non 11 | risus. 12 | Suspendisse 13 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_itoa_base/test01.output: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 1 4 | 10 5 | 10 6 | 1111110111100 7 | 10011010010010 8 | 10000100100100011000 9 | 10000000000000000000000000000000 10 | 1111111111111111111111111111111 11 | -------------------------------------------------------------------------------- /tests/Bonus_functions/ft_lstmap/test01.output: -------------------------------------------------------------------------------- 1 | elem content = abcdef 2 | elem content = bbcdef 3 | elem content = dbcdef 4 | elem content = gbcdef 5 | 6 | tmp = yyyyyy elem = yyyyyy 7 | tmp = yyyyyy 8 | tmp = yyyyyy 9 | tmp = yyyyyy 10 | tmp = yyyyyy 11 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_split/test05.output: -------------------------------------------------------------------------------- 1 | lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultricies diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. 2 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_split/test04.output: -------------------------------------------------------------------------------- 1 | lorem 2 | psum dolor s 3 | t amet, consectetur ad 4 | p 5 | sc 6 | ng el 7 | t. Sed non r 8 | sus. Suspend 9 | sse lectus tortor, d 10 | gn 11 | ss 12 | m s 13 | t amet, ad 14 | p 15 | sc 16 | ng nec, ultr 17 | c 18 | es sed, dolor. Cras elementum ultr 19 | c 20 | es d 21 | am. Maecenas l 22 | gula massa, var 23 | us a, semper congue, eu 24 | smod non, m 25 | . 26 | -------------------------------------------------------------------------------- /srcs/variables/display.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # display.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2019/11/19 17:26:32 by jtoty #+# #+# # 11 | # Updated: 2019/11/19 21:27:26 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | ################################################### 16 | # Display variables # 17 | ################################################### 18 | 19 | NORME_COL=23 20 | CHEAT_COL=50 21 | COMPIL_COL=38 22 | TEST_COL=67 23 | RESULT_COL=87 24 | TITLE_LENGTH=92 25 | CHAR_LENGTH="-" 26 | CHAR_WIDTH="|" 27 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasestr/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "libft.h" 4 | 5 | static void ft_print_result(char const *s) 6 | { 7 | int len; 8 | 9 | len = 0; 10 | while (s[len]) 11 | len++; 12 | write(1, s, len); 13 | } 14 | 15 | static void check_strcasestr(const char *haystack, const char *needle) 16 | { 17 | const char *str; 18 | 19 | if (!(str = ft_strcasestr(haystack, needle))) 20 | ft_print_result("NULL"); 21 | else 22 | ft_print_result(str); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | int arg; 28 | 29 | if (argc == 1) 30 | return (0); 31 | else if ((arg = atoi(argv[1])) == 1) 32 | check_strcasestr("lorEm ipsum dolor sit amet", "loRem"); 33 | else if (arg == 2) 34 | check_strcasestr("lorem iPsum dolor sit amet", "iPSum"); 35 | else if (arg == 3) 36 | check_strcasestr("lorem iPSum dolor sit lorem ipsum dolor", "ipsum"); 37 | else if (arg == 4) 38 | check_strcasestr("lorem ipsum dolor sit amet", ""); 39 | else if (arg == 5) 40 | check_strcasestr("lorem ipsum dolor sit amet", "ipSUmm"); 41 | else if (arg == 6) 42 | check_strcasestr("lorem ipsum dolor sit amet", "dOl"); 43 | else if (arg == 7) 44 | check_strcasestr("lorem ipsum dolor sit amet", "consECtetur"); 45 | return (0); 46 | } 47 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_memalloc/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:23:17 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:50:25 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | char *str; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if (atoi(argv[1]) == 1) 25 | { 26 | str = (char *)ft_memalloc(30); 27 | if (!str) 28 | write(1, "NULL", 4); 29 | else 30 | write(1, str, 30); 31 | free(str); 32 | } 33 | return (0); 34 | } 35 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_calloc/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2019/11/20 11:59:07 by jtoty #+# #+# */ 9 | /* Updated: 2019/11/20 15:38:38 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | char *str; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if (atoi(argv[1]) == 1) 25 | { 26 | str = (char *)ft_calloc(30, sizeof(char)); 27 | if (!str) 28 | write(1, "NULL", 4); 29 | else 30 | write(1, str, 30); 31 | free(str); 32 | } 33 | return (0); 34 | } 35 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_memdel/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:23:58 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:50:35 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | void *mem; 20 | 21 | alarm(5); 22 | mem = malloc(sizeof(*mem) * 10); 23 | if (argc == 1 || !mem) 24 | return (0); 25 | else if (atoi(argv[1]) == 1) 26 | { 27 | ft_memdel(&mem); 28 | if (!mem) 29 | write(1, "NULL", 4); 30 | else 31 | write(1, "NOT NULL", 8); 32 | } 33 | return (0); 34 | } 35 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strdel/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:31:46 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:47 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | char *str; 20 | 21 | alarm(5); 22 | str = (char *)malloc(sizeof(*str) * 10); 23 | if (argc == 1 || !str) 24 | return (0); 25 | else if (atoi(argv[1]) == 1) 26 | { 27 | ft_strdel(&str); 28 | if (!str) 29 | write(1, "NULL", 4); 30 | else 31 | write(1, "NOT NULL", 8); 32 | } 33 | return (0); 34 | } 35 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strclr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:31:34 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:36 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | int main(int argc, const char *argv[]) 19 | { 20 | char *str; 21 | 22 | alarm(5); 23 | if (argc == 1) 24 | return (0); 25 | if (atoi(argv[1]) == 1) 26 | { 27 | str = (char *)malloc(sizeof(*str) * 10); 28 | if (!str) 29 | return (0); 30 | memset(str, 'u', 9); 31 | str[9] = '\0'; 32 | ft_strclr(str); 33 | write(1, str, 10); 34 | free(str); 35 | } 36 | return (0); 37 | } 38 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putstr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:31:08 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:18 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putstr("lorem ipsum dolor sit amet"); 26 | else if (arg == 2) 27 | ft_putstr(" lorem\nipsum\rdolor\tsit amet "); 28 | else if (arg == 3) 29 | ft_putstr(""); 30 | else if (arg == 4) 31 | ft_putstr("lorem ipsum do\0lor sit amet"); 32 | return (0); 33 | } 34 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putendl/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:26:09 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:51:09 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putendl("lorem ipsum dolor sit amet"); 26 | else if (arg == 2) 27 | ft_putendl(" lorem\nipsum\rdolor\tsit amet "); 28 | else if (arg == 3) 29 | ft_putendl(""); 30 | else if (arg == 4) 31 | ft_putendl("lorem ipsum do\0lor sit amet"); 32 | return (0); 33 | } 34 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putstr_fd/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:31:21 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:27 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putstr_fd("lorem ipsum dolor sit amet", 2); 26 | else if (arg == 2) 27 | ft_putstr_fd(" lorem\nipsum\rdolor\tsit amet ", 1); 28 | else if (arg == 3) 29 | ft_putstr_fd("", 2); 30 | else if (arg == 4) 31 | ft_putstr_fd("lorem ipsum do\0lor sit amet", 1); 32 | return (0); 33 | } 34 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putendl_fd/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:26:23 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:51:21 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putendl_fd("lorem ipsum dolor sit amet", 2); 26 | else if (arg == 2) 27 | ft_putendl_fd(" lorem\nipsum\rdolor\tsit amet ", 1); 28 | else if (arg == 3) 29 | ft_putendl_fd("", 2); 30 | else if (arg == 4) 31 | ft_putendl_fd("lorem ipsum do\0lor sit amet", 1); 32 | return (0); 33 | } 34 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strnew/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:34:47 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:54:12 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void check_strnew(int len) 18 | { 19 | char *str; 20 | 21 | if (!(str = ft_strnew(len))) 22 | write(1, "NULL", 4); 23 | else 24 | write(1, str, len + 1); 25 | free(str); 26 | } 27 | 28 | int main(int argc, const char *argv[]) 29 | { 30 | int arg; 31 | 32 | alarm(5); 33 | if (argc == 1) 34 | return (0); 35 | else if ((arg = atoi(argv[1])) == 1) 36 | check_strnew(30); 37 | else if (arg == 2) 38 | check_strnew(0); 39 | return (0); 40 | } 41 | -------------------------------------------------------------------------------- /srcs/config_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################### 4 | # Mandatory configuration # 5 | ################################### 6 | 7 | #Edit the next line with the path of your libft project. 8 | PATH_LIBFT=~/libft 9 | 10 | #If you use a relative path, don't put double quotes. 11 | #For example : 12 | #PATH_LIBFT=~/libft ==> Right 13 | #PATH_LIBFT="~/libft" ==> Wrong 14 | 15 | #If you encounter some problems with a relative path, use an absolute path. 16 | #You can put double quotes with the absolute path. 17 | #For example : 18 | #PATH_LIBFT=/home/user/libft ==> Right 19 | #PATH_LIBFT="/home/user/libft" ==> Right 20 | 21 | ################################### 22 | # Optionnal configuration # 23 | ################################### 24 | 25 | #By default, the deepthought file will be generated in the grademe directory. 26 | #Edit the next line with an absolute path if you want to change it. 27 | PATH_DEEPTHOUGHT=${PATH_TEST} 28 | 29 | #You can chose color and text effect. 30 | #Colors available : 31 | # - BLACK 32 | # - CYAN 33 | # - GREEN 34 | # - YELLOW 35 | # - RED 36 | # - BLUE 37 | # - PURPLE 38 | # - WHITE 39 | 40 | #Effects available : 41 | # - BOLD 42 | # - UNDERLINE 43 | 44 | #For example : 45 | #COLOR_EXAMPLE="${UNDERLINE}${BOLD}${PURPLE} 46 | 47 | COLOR_OK="${GREEN}" 48 | COLOR_FAIL="${RED}" 49 | COLOR_WARNING="${YELLOW}" 50 | COLOR_TITLE="${BOLD}${BLUE}" 51 | COLOR_FUNC="${CYAN}" 52 | COLOR_PART="${UNDERLINE}${PURPLE}" 53 | COLOR_TOTAL="${BOLD}${YELLOW}" 54 | COLOR_DEEPTHOUGHT_PATH="${BOLD}${PURPLE}" 55 | -------------------------------------------------------------------------------- /srcs/variables/options.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # options.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2019/11/19 17:26:32 by jtoty #+# #+# # 11 | # Updated: 2019/11/19 18:27:26 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | ################################################### 16 | # Options variables # 17 | ################################################### 18 | 19 | OPT_NO_LIBRARY=0 20 | OPT_FULL_MAKEFILE=0 21 | OPT_NO_SEARCH=0 22 | OPT_NO_COLOR=0 23 | OPT_NO_FORBIDDEN=0 24 | OPT_NO_NORMINETTE=0 25 | OPT_NO_UPDATE=0 26 | OPT_NO_PART1=0 27 | OPT_NO_PART2=0 28 | OPT_NO_BONUS=0 29 | OPT_NO_ADDITIONAL=0 30 | ACTIVATE_PART1=0 31 | ACTIVATE_PART2=0 32 | ACTIVATE_BONUS=0 33 | ACTIVATE_ADDITIONAL=0 34 | CHECK_IN_PART1=1 35 | CHECK_IN_PART2=1 36 | CHECK_IN_BONUS=1 37 | CHECK_IN_ADDITIONAL=1 38 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_bzero/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 11:58:52 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:38:29 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_bzero(void *mem, int c, int len, int n_bzero) 19 | { 20 | memset(mem, c, len); 21 | ft_bzero(mem, n_bzero); 22 | write(1, mem, len); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | void *mem; 28 | int len; 29 | int arg; 30 | 31 | alarm(5); 32 | len = 5; 33 | if (argc == 1 || !(mem = malloc(sizeof(*mem) * len))) 34 | return (0); 35 | if ((arg = atoi(argv[1])) == 1) 36 | check_bzero(mem, 'e', len, 5); 37 | else if (arg == 2) 38 | check_bzero(mem, 'e', len, 0); 39 | free(mem); 40 | return (0); 41 | } 42 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putnbr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:26:31 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:51:48 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putnbr(0); 26 | else if (arg == 2) 27 | ft_putnbr(5); 28 | else if (arg == 3) 29 | ft_putnbr(-5); 30 | else if (arg == 4) 31 | ft_putnbr(42); 32 | else if (arg == 5) 33 | ft_putnbr(-57); 34 | else if (arg == 6) 35 | ft_putnbr(164189); 36 | else if (arg == 7) 37 | ft_putnbr(-987441); 38 | else if (arg == 8) 39 | ft_putnbr(2147483647); 40 | else if (arg == 9) 41 | ft_putnbr(-2147483648LL); 42 | return (0); 43 | } 44 | -------------------------------------------------------------------------------- /srcs/variables/functions/bonus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # bonus.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2019/11/19 12:27:13 by jtoty #+# #+# # 11 | # Updated: 2019/11/19 13:29:44 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | ################################################### 16 | # Bonus functions # 17 | ################################################### 18 | 19 | Bonus_func=( 20 | 'ft_lstadd_back' \ 21 | 'ft_lstadd_front' \ 22 | 'ft_lstclear' \ 23 | 'ft_lstdelone' \ 24 | 'ft_lstiter' \ 25 | 'ft_lstlast' \ 26 | 'ft_lstmap' \ 27 | 'ft_lstnew' \ 28 | 'ft_lstsize' \ 29 | ) 30 | 31 | Bonus_func_authorized=( 32 | '0' \ 33 | '0' \ 34 | '2' \ 35 | '2' \ 36 | '0' \ 37 | '0' \ 38 | '3' \ 39 | '1' \ 40 | '0' \ 41 | ) 42 | 43 | Bonus_func_activation=( 44 | '0' \ 45 | '0' \ 46 | '0' \ 47 | '0' \ 48 | '0' \ 49 | '0' \ 50 | '0' \ 51 | '0' \ 52 | '0' \ 53 | ) 54 | -------------------------------------------------------------------------------- /srcs/variables/colors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # colors.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2017/01/23 18:26:32 by jtoty #+# #+# # 11 | # Updated: 2017/01/23 18:27:26 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | ################################################### 16 | # Colors variables # 17 | ################################################### 18 | 19 | DEFAULT="\033[0m" 20 | 21 | if [ ${OPT_NO_COLOR} -eq 1 ] 22 | then 23 | BOLD=${DEFAULT} 24 | UNDERLINE=${DEFAULT} 25 | 26 | BLACK=${DEFAULT} 27 | RED=${DEFAULT} 28 | GREEN=${DEFAULT} 29 | YELLOW=${DEFAULT} 30 | BLUE=${DEFAULT} 31 | PURPLE=${DEFAULT} 32 | CYAN=${DEFAULT} 33 | WHITE=${DEFAULT} 34 | else 35 | BOLD="\033[1m" 36 | UNDERLINE="\033[4m" 37 | 38 | BLACK="\033[30m" 39 | RED="\033[31m" 40 | GREEN="\033[32m" 41 | YELLOW="\033[33m" 42 | BLUE="\033[34m" 43 | PURPLE="\033[35m" 44 | CYAN="\033[36m" 45 | WHITE="\033[37m" 46 | fi 47 | -------------------------------------------------------------------------------- /srcs/variables/core.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # core.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2017/01/23 11:27:13 by jtoty #+# #+# # 11 | # Updated: 2019/11/19 13:28:44 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | source ${PATH_TEST}/srcs/variables/functions/part_1.sh 16 | source ${PATH_TEST}/srcs/variables/functions/part_2.sh 17 | source ${PATH_TEST}/srcs/variables/functions/bonus.sh 18 | source ${PATH_TEST}/srcs/variables/functions/additional.sh 19 | source ${PATH_TEST}/srcs/variables/options.sh 20 | source ${PATH_TEST}/srcs/variables/display.sh 21 | 22 | 23 | ################################################### 24 | # Core variables # 25 | ################################################### 26 | 27 | tab_all_part=('Part1_func' 'Part2_func' 'Bonus_func' 'Additional_func') 28 | 29 | num_sys_func=('1' '2' '4') 30 | system_func=('void' 'malloc' 'free' 'printf' 'write') 31 | 32 | TMP_TESTS_DIR="tmp_tests_dir" 33 | -------------------------------------------------------------------------------- /srcs/variables/functions/part_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # part_2.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2019/11/19 12:27:13 by jtoty #+# #+# # 11 | # Updated: 2019/11/19 22:30:45 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | ################################################### 16 | # Part2 functions # 17 | ################################################### 18 | 19 | Part2_func=( 20 | 'ft_itoa' \ 21 | 'ft_putchar_fd' \ 22 | 'ft_putendl_fd' \ 23 | 'ft_putnbr_fd' \ 24 | 'ft_putstr_fd' \ 25 | 'ft_split' \ 26 | 'ft_strjoin' \ 27 | 'ft_strmapi' \ 28 | 'ft_strtrim' \ 29 | 'ft_substr' \ 30 | ) 31 | 32 | Part2_func_authorized=( 33 | '1' \ 34 | '4' \ 35 | '4' \ 36 | '4' \ 37 | '4' \ 38 | '3' \ 39 | '1' \ 40 | '1' \ 41 | '1' \ 42 | '1' \ 43 | ) 44 | 45 | Part2_func_activation=( 46 | '0' \ 47 | '0' \ 48 | '0' \ 49 | '0' \ 50 | '0' \ 51 | '0' \ 52 | '0' \ 53 | '0' \ 54 | '0' \ 55 | '0' \ 56 | ) 57 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_putnbr_fd/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:30:55 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:10 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | int arg; 20 | 21 | alarm(5); 22 | if (argc == 1) 23 | return (0); 24 | else if ((arg = atoi(argv[1])) == 1) 25 | ft_putnbr_fd(0, 2); 26 | else if (arg == 2) 27 | ft_putnbr_fd(5, 1); 28 | else if (arg == 3) 29 | ft_putnbr_fd(-5, 2); 30 | else if (arg == 4) 31 | ft_putnbr_fd(42, 1); 32 | else if (arg == 5) 33 | ft_putnbr_fd(-57, 2); 34 | else if (arg == 6) 35 | ft_putnbr_fd(164189, 1); 36 | else if (arg == 7) 37 | ft_putnbr_fd(-987441, 2); 38 | else if (arg == 8) 39 | ft_putnbr_fd(2147483647, 1); 40 | else if (arg == 9) 41 | ft_putnbr_fd(-2147483648LL, 2); 42 | return (0); 43 | } 44 | -------------------------------------------------------------------------------- /supported_functions.md: -------------------------------------------------------------------------------- 1 | # Supported functions 2 | ## Mandatory part 3 | ### Part I 4 | 5 | - ft_atoi 6 | - ft_bzero 7 | - ft_calloc 8 | - ft_isalnum 9 | - ft_isalpha 10 | - ft_isascii 11 | - ft_isdigit 12 | - ft_isprint 13 | - ft_memccpy 14 | - ft_memchr 15 | - ft_memcmp 16 | - ft_memcpy 17 | - ft_memmove 18 | - ft_memset 19 | - ft_strchr 20 | - ft_strdup 21 | - ft_strlcat 22 | - ft_strlcpy 23 | - ft_strlen 24 | - ft_strncmp 25 | - ft_strnstr 26 | - ft_strrchr 27 | - ft_tolower 28 | - ft_toupper 29 | 30 | ### Part II 31 | 32 | - ft_itoa 33 | - ft_putchar_fd 34 | - ft_putendl_fd 35 | - ft_putnbr_fd 36 | - ft_putstr_fd 37 | - ft_split 38 | - ft_strjoin 39 | - ft_strmapi 40 | - ft_strtrim 41 | - ft_substr 42 | 43 | ## Bonus part 44 | 45 | - ft_lstadd_back 46 | - ft_lstadd_front 47 | - ft_lstclear 48 | - ft_lstdelone 49 | - ft_lstiter 50 | - ft_lstlast 51 | - ft_lstmap 52 | - ft_lstnew 53 | - ft_lstsize 54 | 55 | ## Addtional part 56 | 57 | - ft_isblank 58 | - ft_iscntrl 59 | - ft_isgraph 60 | - ft_islower 61 | - ft_isspace 62 | - ft_isupper 63 | - ft_isxdigit 64 | - ft_itoa_base 65 | - ft_memalloc 66 | - ft_memdel 67 | - ft_putchar 68 | - ft_putendl 69 | - ft_putnbr 70 | - ft_putstr 71 | - ft_str_is_alpha 72 | - ft_str_is_lowercase 73 | - ft_str_is_numeric 74 | - ft_str_is_printable 75 | - ft_str_is_uppercase 76 | - ft_strcapitalize 77 | - ft_strcasecmp 78 | - ft_strcasestr 79 | - ft_strcat 80 | - ft_strclr 81 | - ft_strcmp 82 | - ft_strcpy 83 | - ft_strdel 84 | - ft_strequ 85 | - ft_striter 86 | - ft_striteri 87 | - ft_strlowcase 88 | - ft_strmap 89 | - ft_strncasecmp 90 | - ft_strncat 91 | - ft_strncpy 92 | - ft_strndup 93 | - ft_strnequ 94 | - ft_strnew 95 | - ft_strstr 96 | - ft_strtok 97 | - ft_strupcase 98 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strdup/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:04:55 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:44:42 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | int main(int argc, const char *argv[]) 29 | { 30 | char str[] = "lorem ipsum dolor sit amet"; 31 | char *str_dup; 32 | 33 | alarm(5); 34 | if (argc == 1) 35 | return (0); 36 | if (atoi(argv[1]) == 1) 37 | { 38 | if (!(str_dup = ft_strdup(str))) 39 | ft_print_result("NULL"); 40 | else 41 | ft_print_result(str_dup); 42 | if (str_dup == str) 43 | ft_print_result("\nstr_dup's adress == str's adress"); 44 | else 45 | free(str_dup); 46 | } 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /srcs/check_compilation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # check_compilation.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2017/01/23 18:26:19 by jtoty #+# #+# # 11 | # Updated: 2017/01/23 18:26:20 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | compilation() 16 | { 17 | if [ -e ${PATH_TEST}/user_exe ] 18 | then 19 | rm -f ${PATH_TEST}/user_exe 20 | fi 21 | 22 | COMPIL_FLAGS="-Wextra -Wall -Werror" 23 | MAIN_FILE="${PATH_TEST}/tests/$(echo ${part}tions)/$1/main.c" 24 | COMPIL_ARGS="${COMPIL_FLAGS} ${MAIN_FILE} -L${PATH_LIBFT} -lft -I${PATH_LIBFT}" 25 | 26 | printf "$> clang ${COMPIL_ARGS}\n\n" >> ${PATH_DEEPTHOUGHT}/deepthought 27 | clang ${COMPIL_ARGS} 2>>${PATH_DEEPTHOUGHT}/deepthought -o user_exe 28 | } 29 | 30 | check_compilation() 31 | { 32 | printf "\033[${COMPIL_COL}G" 33 | if [ -e ${PATH_TEST}/user_exe ] 34 | then 35 | printf "${COLOR_OK}success${DEFAULT}" 36 | retvalue=1 37 | else 38 | printf "${COLOR_FAIL}failure${DEFAULT}" 39 | retvalue=0 40 | fi 41 | return $retvalue 42 | } 43 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_putchar/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:45:24 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:50:43 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void check_putchar(int start, int end) 18 | { 19 | while (start <= end) 20 | { 21 | ft_putchar(start); 22 | start++; 23 | } 24 | } 25 | 26 | int main(int argc, const char *argv[]) 27 | { 28 | int arg; 29 | 30 | alarm(5); 31 | if (argc == 1) 32 | return (0); 33 | else if ((arg = atoi(argv[1])) == 1) 34 | check_putchar(0, 47); 35 | else if (arg == 2) 36 | check_putchar('0', '9'); 37 | else if (arg == 3) 38 | check_putchar(58, 64); 39 | else if (arg == 4) 40 | check_putchar('A', 'Z'); 41 | else if (arg == 5) 42 | check_putchar(91, 96); 43 | else if (arg == 6) 44 | check_putchar('a', 'z'); 45 | else if (arg == 7) 46 | check_putchar(123, 127); 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcpy/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:02:06 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:43:04 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_memcpy(void *dest, void *src, int n) 19 | { 20 | if (dest != ft_memcpy(dest, src, n)) 21 | write(1, "dest's adress was not returned\n", 31); 22 | write(1, dest, 30); 23 | free(dest); 24 | } 25 | 26 | int main(int argc, const char *argv[]) 27 | { 28 | void *mem; 29 | int arg; 30 | 31 | alarm(5); 32 | if (!(mem = malloc(sizeof(*mem) * 30)) || argc == 1) 33 | return (0); 34 | memset(mem, 'j', 30); 35 | if ((arg = atoi(argv[1])) == 1) 36 | check_memcpy(mem, "zyxwvutsrqponmlkjihgfedcba", 14); 37 | else if (arg == 2) 38 | check_memcpy(mem, "zyxwvutst", 0); 39 | else if (arg == 3) 40 | check_memcpy(mem, "zy\0xw\0vu\0\0tsr", 11); 41 | return (0); 42 | } 43 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_striter/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:33:23 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:53:04 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | static void iter(char *c) 29 | { 30 | if (*c >= 'a' && *c <= 'z') 31 | *c = *c - 32; 32 | else if (*c >= 'A' && *c <= 'Z') 33 | *c = *c + 32; 34 | } 35 | 36 | int main(int argc, const char *argv[]) 37 | { 38 | char *str; 39 | 40 | alarm(5); 41 | str = (char *)malloc(sizeof(*str) * 12); 42 | if (argc == 1 || !str) 43 | return (0); 44 | else if (atoi(argv[1]) == 1) 45 | { 46 | strcpy(str, "LoReM iPsUm"); 47 | ft_striter(str, &iter); 48 | ft_print_result(str); 49 | } 50 | free(str); 51 | return (0); 52 | } 53 | -------------------------------------------------------------------------------- /srcs/check_norme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **************************************************************************** # 4 | # # 5 | # ::: :::::::: # 6 | # check_norme.sh :+: :+: :+: # 7 | # +:+ +:+ +:+ # 8 | # By: jtoty +#+ +:+ +#+ # 9 | # +#+#+#+#+#+ +#+ # 10 | # Created: 2017/01/23 18:26:23 by jtoty #+# #+# # 11 | # Updated: 2017/01/23 18:26:24 by jtoty ### ########.fr # 12 | # # 13 | # **************************************************************************** # 14 | 15 | check_norme() 16 | { 17 | printf "$> norminette ${1}.c | grep -E '(Error|Warning)'\n" >>${PATH_DEEPTHOUGHT}/deepthought 18 | printf "\033[${NORME_COL}G" 19 | NORME_VAR=$(norminette ${PATH_LIBFT}/$1.c 2>&1) 20 | if echo "$NORME_VAR" | grep -q command 21 | then 22 | printf "${COLOR_WARNING}not found${DEFAULT}" 23 | printf "\nnorminette : command not found\n\n" >>${PATH_DEEPTHOUGHT}/deepthought 24 | retvalue=1 25 | elif echo "$NORME_VAR" | grep -qE '(Error|Warning)' 26 | then 27 | printf "${COLOR_FAIL}check failed${DEFAULT}" 28 | echo "$NORME_VAR" | grep -E '(Error|Warning)' >> ${PATH_DEEPTHOUGHT}/deepthought 2>&1 29 | printf "Norme check failed\n" >> ${PATH_DEEPTHOUGHT}/deepthought 30 | retvalue=0 31 | else 32 | printf "${COLOR_OK}ok${DEFAULT}" 33 | retvalue=1 34 | fi 35 | return $retvalue 36 | } 37 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcpy/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:04:46 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:44:13 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_strcpy(char *dest, char *src, int len) 19 | { 20 | if (dest != ft_strcpy(dest, src)) 21 | write(1, "dest's adress was not returned\n", 31); 22 | write(1, dest, len); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | char *dest; 28 | int arg; 29 | int len; 30 | 31 | alarm(5); 32 | len = 15; 33 | if (!(dest = (char *)malloc(sizeof(*dest) * len)) || argc == 1) 34 | return (0); 35 | memset(dest, 0, len); 36 | memset(dest, 'f', 9); 37 | if ((arg = atoi(argv[1])) == 1) 38 | check_strcpy(dest, "lorem", len); 39 | else if (arg == 2) 40 | check_strcpy(dest, "lorem ipsum", len); 41 | else if (arg == 3) 42 | check_strcpy(dest, "", len); 43 | free(dest); 44 | return (0); 45 | } 46 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strlowcase/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:28:20 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:01:45 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | int main(int argc, const char *argv[]) 28 | { 29 | int arg; 30 | 31 | alarm(5); 32 | if (argc == 1) 33 | return (0); 34 | else if ((arg = atoi(argv[1])) == 1) 35 | { 36 | char str[] ="LOREM IPSUM DOLOR SIT AMET"; 37 | ft_print_result(ft_strlowcase(str)); 38 | } 39 | else if (arg == 2) 40 | { 41 | char str[] =" \n\tlorem 4ipSum DOLOR s\nit aMeT "; 42 | ft_print_result(ft_strlowcase(str)); 43 | } 44 | else if (arg == 3) 45 | { 46 | char str[] ="HeY ! 42mots quArAnte-deux; cinquante+et+un"; 47 | ft_print_result(ft_strlowcase(str)); 48 | } 49 | return (0); 50 | } 51 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strupcase/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:28:58 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:02:05 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | int main(int argc, const char *argv[]) 28 | { 29 | int arg; 30 | 31 | alarm(5); 32 | if (argc == 1) 33 | return (0); 34 | else if ((arg = atoi(argv[1])) == 1) 35 | { 36 | char str[] ="lorem ipsum dolor sit amet"; 37 | ft_print_result(ft_strupcase(str)); 38 | } 39 | else if (arg == 2) 40 | { 41 | char str[] =" \n\tlorem 4ipSum DOLOR s\nit aMeT "; 42 | ft_print_result(ft_strupcase(str)); 43 | } 44 | else if (arg == 3) 45 | { 46 | char str[] ="HeY ! 42mots quArAnte-deux; cinquante+et+un"; 47 | ft_print_result(ft_strupcase(str)); 48 | } 49 | return (0); 50 | } 51 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_toupper/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:09:27 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:49:20 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | static void check_toupper(int start, int end) 18 | { 19 | int c; 20 | 21 | while (start <= end) 22 | { 23 | c = ft_toupper(start); 24 | write(1, &c, 1); 25 | start++; 26 | } 27 | } 28 | 29 | int main(int argc, const char *argv[]) 30 | { 31 | int arg; 32 | 33 | alarm(5); 34 | if (argc == 1) 35 | return (0); 36 | else if ((arg = atoi(argv[1])) == 1) 37 | check_toupper(0, 47); 38 | else if (arg == 2) 39 | check_toupper('0', '9'); 40 | else if (arg == 3) 41 | check_toupper(58, 64); 42 | else if (arg == 4) 43 | check_toupper('A', 'Z'); 44 | else if (arg == 5) 45 | check_toupper(91, 96); 46 | else if (arg == 6) 47 | check_toupper('a', 'z'); 48 | else if (arg == 7) 49 | check_toupper(123, 127); 50 | return (0); 51 | } 52 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_tolower/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:09:16 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:49:02 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_tolower(int start, int end) 19 | { 20 | int c; 21 | 22 | while (start <= end) 23 | { 24 | c = ft_tolower(start); 25 | write(1, &c, 1); 26 | start++; 27 | } 28 | } 29 | 30 | int main(int argc, const char *argv[]) 31 | { 32 | int arg; 33 | 34 | alarm(5); 35 | if (argc == 1) 36 | return (0); 37 | else if ((arg = atoi(argv[1])) == 1) 38 | check_tolower(0, 47); 39 | else if (arg == 2) 40 | check_tolower('0', '9'); 41 | else if (arg == 3) 42 | check_tolower(58, 64); 43 | else if (arg == 4) 44 | check_tolower('A', 'Z'); 45 | else if (arg == 5) 46 | check_tolower(91, 96); 47 | else if (arg == 6) 48 | check_tolower('a', 'z'); 49 | else if (arg == 7) 50 | check_tolower(123, 127); 51 | return (0); 52 | } 53 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcapitalize/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:27:43 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:01:09 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | int main(int argc, const char *argv[]) 28 | { 29 | int arg; 30 | 31 | alarm(5); 32 | if (argc == 1) 33 | return (0); 34 | else if ((arg = atoi(argv[1])) == 1) 35 | { 36 | char str[] = " lorem IPsuM dOlor sit amet "; 37 | ft_print_result(ft_strcapitalize(str)); 38 | } 39 | else if (arg == 2) 40 | { 41 | char str[] = " \n\tlorem 4ipsum DOLOR s\nit aMeT "; 42 | ft_print_result(ft_strcapitalize(str)); 43 | } 44 | else if (arg == 3) 45 | { 46 | char str[] = "salut, comment tu vas ? 42mots trente-deux; vingt+et+un"; 47 | ft_print_result(ft_strcapitalize(str)); 48 | } 49 | return (0); 50 | } 51 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strlen/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 11:58:17 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/08 18:32:39 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | char c; 21 | 22 | if (n >= 10) 23 | ft_print_result(n / 10); 24 | c = n % 10 + '0'; 25 | write (1, &c, 1); 26 | } 27 | 28 | int main(int argc, const char *argv[]) 29 | { 30 | int arg; 31 | 32 | alarm(5); 33 | if (argc == 1) 34 | return (0); 35 | else if ((arg = atoi(argv[1])) == 1) 36 | ft_print_result(ft_strlen("Hello !")); 37 | else if (arg == 2) 38 | ft_print_result(ft_strlen("1")); 39 | else if (arg == 3) 40 | ft_print_result(ft_strlen("lorem\tipsum\tdolor\nsit\namet\n")); 41 | else if (arg == 4) 42 | ft_print_result(ft_strlen("")); 43 | else if (arg == 5) 44 | ft_print_result(ft_strlen("\n\n\f\r\t")); 45 | else if (arg == 6) 46 | ft_print_result(ft_strlen(" ")); 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strtok/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:04:46 by jtoty #+# #+# */ 9 | /* Updated: 2018/06/29 12:34:21 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | static void check_strtok(char *delim) 28 | { 29 | char str[] = "abc,def;ghi,jkl.mno,pqr"; 30 | char *token; 31 | 32 | if ((token = ft_strtok(str, delim))) 33 | { 34 | ft_print_result(token); 35 | while ((token = ft_strtok(NULL, delim))) 36 | ft_print_result(token); 37 | } 38 | else 39 | ft_print_result("NULL"); 40 | } 41 | 42 | int main(int argc, const char *argv[]) 43 | { 44 | int arg; 45 | 46 | if (argc == 1) 47 | return (0); 48 | if ((arg = atoi(argv[1])) == 1) 49 | check_strtok(","); 50 | else if (arg == 2) 51 | check_strtok("y"); 52 | else if (arg == 3) 53 | check_strtok(",;."); 54 | return (0); 55 | } 56 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memmove/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:02:17 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:43:18 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_memmove(void *dest, void *src, int n) 19 | { 20 | if (dest != ft_memmove(dest, src, n)) 21 | write(1, "dest's adress was not returned\n", 31); 22 | write(1, dest, 22); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | char src[] = "lorem ipsum dolor sit amet"; 28 | char *dest; 29 | int arg; 30 | 31 | dest = src + 1; 32 | alarm(5); 33 | if (argc == 1) 34 | return (0); 35 | else if ((arg = atoi(argv[1])) == 1) 36 | check_memmove(dest, "consectetur", 5); 37 | else if (arg == 2) 38 | check_memmove(dest, "con\0sec\0\0te\0tur", 10); 39 | else if (arg == 3) 40 | check_memmove(dest, src, 8); 41 | else if (arg == 4) 42 | check_memmove(src, dest, 8); 43 | else if (arg == 5) 44 | check_memmove(src, dest, 0); 45 | return (0); 46 | } 47 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strequ/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:32:07 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:52:56 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n == 0) 20 | write(1, "0", 1); 21 | else 22 | write(1, "1", 1); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | int arg; 28 | 29 | alarm(5); 30 | if (argc == 1) 31 | return (0); 32 | else if ((arg = atoi(argv[1])) == 1) 33 | ft_print_result(ft_strequ("salut", "salut")); 34 | else if (arg == 2) 35 | ft_print_result(ft_strequ("test", "tests")); 36 | else if (arg == 3) 37 | ft_print_result(ft_strequ("tests", "test")); 38 | else if (arg == 4) 39 | ft_print_result(ft_strequ("test", "tEst")); 40 | else if (arg == 5) 41 | ft_print_result(ft_strequ("", "test")); 42 | else if (arg == 6) 43 | ft_print_result(ft_strequ("test", "")); 44 | else if (arg == 7) 45 | ft_print_result(ft_strequ("", "")); 46 | return (0); 47 | } 48 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memset/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:02:51 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:43:26 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_memset(void *mem, int c, int n, int mem_size) 19 | { 20 | if (mem != ft_memset(mem, c, n)) 21 | write(1, "mem's adress was not returned\n", 30); 22 | write(1, mem, mem_size); 23 | free(mem); 24 | } 25 | 26 | int main(int argc, const char *argv[]) 27 | { 28 | void *mem; 29 | int arg; 30 | int mem_size; 31 | 32 | alarm(5); 33 | mem_size = 15; 34 | if (!(mem = malloc(sizeof(*mem) * mem_size)) || argc == 1) 35 | return (0); 36 | memset(mem, 'j', mem_size); 37 | if ((arg = atoi(argv[1])) == 1) 38 | check_memset(mem, 'c', 5, mem_size); 39 | else if (arg == 2) 40 | check_memset(mem, 'c', 14, mem_size); 41 | else if (arg == 3) 42 | check_memset(mem, '\n', 6, mem_size); 43 | else if (arg == 4) 44 | check_memset(mem, '\0', 1, mem_size); 45 | return (0); 46 | } 47 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcat/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:03:07 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:43:38 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_strcat(char *dest, char *src, int len) 19 | { 20 | if (dest != ft_strcat(dest, src)) 21 | write(1, "dest's adress was not returned\n", 31); 22 | write(1, dest, len); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | char *dest; 28 | int arg; 29 | int len; 30 | 31 | alarm(5); 32 | len = 15; 33 | if (!(dest = (char *)malloc(sizeof(*dest) * len)) || argc == 1) 34 | return (0); 35 | memset(dest, 0, len); 36 | memset(dest, 'r', 6); 37 | if ((arg = atoi(argv[1])) == 1) 38 | { 39 | dest[11] = 'a'; 40 | check_strcat(dest, "lorem", 15); 41 | } 42 | else if (arg == 2) 43 | check_strcat(dest, "", 15); 44 | else if (arg == 3) 45 | { 46 | dest[0] = '\0'; 47 | dest[11] = 'a'; 48 | check_strcat(dest, "lorem ipsum", 15); 49 | } 50 | free(dest); 51 | return (0); 52 | } 53 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isblank/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:24:40 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:58:21 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_isblank(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_isblank(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_isblank(0, 47); 43 | else if (arg == 2) 44 | check_isblank('0', '9'); 45 | else if (arg == 3) 46 | check_isblank(58, 64); 47 | else if (arg == 4) 48 | check_isblank('A', 'Z'); 49 | else if (arg == 5) 50 | check_isblank(91, 96); 51 | else if (arg == 6) 52 | check_isblank('a', 'z'); 53 | else if (arg == 7) 54 | check_isblank(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_iscntrl/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:24:59 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:58:29 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_iscntrl(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_iscntrl(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_iscntrl(0, 47); 43 | else if (arg == 2) 44 | check_iscntrl('0', '9'); 45 | else if (arg == 3) 46 | check_iscntrl(58, 64); 47 | else if (arg == 4) 48 | check_iscntrl('A', 'Z'); 49 | else if (arg == 5) 50 | check_iscntrl(91, 96); 51 | else if (arg == 6) 52 | check_iscntrl('a', 'z'); 53 | else if (arg == 7) 54 | check_iscntrl(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isgraph/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:25:06 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:58:38 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_isgraph(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_isgraph(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_isgraph(0, 47); 43 | else if (arg == 2) 44 | check_isgraph('0', '9'); 45 | else if (arg == 3) 46 | check_isgraph(58, 64); 47 | else if (arg == 4) 48 | check_isgraph('A', 'Z'); 49 | else if (arg == 5) 50 | check_isgraph(91, 96); 51 | else if (arg == 6) 52 | check_isgraph('a', 'z'); 53 | else if (arg == 7) 54 | check_isgraph(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_islower/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:25:22 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:58:48 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_islower(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_islower(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_islower(0, 47); 43 | else if (arg == 2) 44 | check_islower('0', '9'); 45 | else if (arg == 3) 46 | check_islower(58, 64); 47 | else if (arg == 4) 48 | check_islower('A', 'Z'); 49 | else if (arg == 5) 50 | check_islower(91, 96); 51 | else if (arg == 6) 52 | check_islower('a', 'z'); 53 | else if (arg == 7) 54 | check_islower(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isspace/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:25:33 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:58:57 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_isspace(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_isspace(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_isspace(0, 47); 43 | else if (arg == 2) 44 | check_isspace('0', '9'); 45 | else if (arg == 3) 46 | check_isspace(58, 64); 47 | else if (arg == 4) 48 | check_isspace('A', 'Z'); 49 | else if (arg == 5) 50 | check_isspace(91, 96); 51 | else if (arg == 6) 52 | check_isspace('a', 'z'); 53 | else if (arg == 7) 54 | check_isspace(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isupper/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:25:45 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:59:06 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_isupper(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_isupper(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_isupper(0, 47); 43 | else if (arg == 2) 44 | check_isupper('0', '9'); 45 | else if (arg == 3) 46 | check_isupper(58, 64); 47 | else if (arg == 4) 48 | check_isupper('A', 'Z'); 49 | else if (arg == 5) 50 | check_isupper(91, 96); 51 | else if (arg == 6) 52 | check_isupper('a', 'z'); 53 | else if (arg == 7) 54 | check_isupper(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_isxdigit/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:26:05 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:59:23 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_isxdigit(int start, int end) 26 | { 27 | while (start <= end) 28 | { 29 | ft_print_result(ft_isxdigit(start)); 30 | start++; 31 | } 32 | } 33 | 34 | int main(int argc, const char *argv[]) 35 | { 36 | int arg; 37 | 38 | alarm(5); 39 | if (argc == 1) 40 | return (0); 41 | else if ((arg = atoi(argv[1])) == 1) 42 | check_isxdigit(0, 47); 43 | else if (arg == 2) 44 | check_isxdigit('0', '9'); 45 | else if (arg == 3) 46 | check_isxdigit(58, 64); 47 | else if (arg == 4) 48 | check_isxdigit('A', 'Z'); 49 | else if (arg == 5) 50 | check_isxdigit(91, 96); 51 | else if (arg == 6) 52 | check_isxdigit('a', 'z'); 53 | else if (arg == 7) 54 | check_isxdigit(123, 127); 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strndup/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:28:32 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:01:56 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | static void check_strndup(int n) 29 | { 30 | char str[] = "lorem ipsum dolor sit amet"; 31 | char *str_dup; 32 | 33 | if (!(str_dup = ft_strndup(str, n))) 34 | ft_print_result("NULL"); 35 | else 36 | ft_print_result(str_dup); 37 | if (str_dup == str) 38 | ft_print_result("\nstr_dup's adress == str's adress"); 39 | else 40 | free(str_dup); 41 | } 42 | 43 | int main(int argc, const char *argv[]) 44 | { 45 | int arg; 46 | 47 | alarm(5); 48 | if (argc == 1) 49 | return (0); 50 | else if ((arg = atoi(argv[1])) == 1) 51 | check_strndup(11); 52 | else if (arg == 2) 53 | check_strndup(0); 54 | else if (arg == 3) 55 | check_strndup(30); 56 | return (0); 57 | } 58 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalnum/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 11:59:07 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:38:38 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n) 21 | write(1, "1", 1); 22 | else 23 | write(1, "0", 1); 24 | } 25 | 26 | static void check_isalnum(int start, int end) 27 | { 28 | while (start <= end) 29 | { 30 | ft_print_result(ft_isalnum(start)); 31 | start++; 32 | } 33 | } 34 | 35 | int main(int argc, const char *argv[]) 36 | { 37 | int arg; 38 | 39 | alarm(5); 40 | if (argc == 1) 41 | return (0); 42 | else if ((arg = atoi(argv[1])) == 1) 43 | check_isalnum(0, 47); 44 | else if (arg == 2) 45 | check_isalnum('0', '9'); 46 | else if (arg == 3) 47 | check_isalnum(58, 64); 48 | else if (arg == 4) 49 | check_isalnum('A', 'Z'); 50 | else if (arg == 5) 51 | check_isalnum(91, 96); 52 | else if (arg == 6) 53 | check_isalnum('a', 'z'); 54 | else if (arg == 7) 55 | check_isalnum(123, 127); 56 | return (0); 57 | } 58 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isalpha/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 11:59:49 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:38:50 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n) 21 | write(1, "1", 1); 22 | else 23 | write(1, "0", 1); 24 | } 25 | 26 | static void check_isalpha(int start, int end) 27 | { 28 | while (start <= end) 29 | { 30 | ft_print_result(ft_isalpha(start)); 31 | start++; 32 | } 33 | } 34 | 35 | int main(int argc, const char *argv[]) 36 | { 37 | int arg; 38 | 39 | alarm(5); 40 | if (argc == 1) 41 | return (0); 42 | else if ((arg = atoi(argv[1])) == 1) 43 | check_isalpha(0, 47); 44 | else if (arg == 2) 45 | check_isalpha('0', '9'); 46 | else if (arg == 3) 47 | check_isalpha(58, 64); 48 | else if (arg == 4) 49 | check_isalpha('A', 'Z'); 50 | else if (arg == 5) 51 | check_isalpha(91, 96); 52 | else if (arg == 6) 53 | check_isalpha('a', 'z'); 54 | else if (arg == 7) 55 | check_isalpha(123, 127); 56 | return (0); 57 | } 58 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isdigit/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:00:21 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:39:15 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n) 21 | write(1, "1", 1); 22 | else 23 | write(1, "0", 1); 24 | } 25 | 26 | static void check_isdigit(int start, int end) 27 | { 28 | while (start <= end) 29 | { 30 | ft_print_result(ft_isdigit(start)); 31 | start++; 32 | } 33 | } 34 | 35 | int main(int argc, const char *argv[]) 36 | { 37 | int arg; 38 | 39 | alarm(5); 40 | if (argc == 1) 41 | return (0); 42 | else if ((arg = atoi(argv[1])) == 1) 43 | check_isdigit(0, 47); 44 | else if (arg == 2) 45 | check_isdigit('0', '9'); 46 | else if (arg == 3) 47 | check_isdigit(58, 64); 48 | else if (arg == 4) 49 | check_isdigit('A', 'Z'); 50 | else if (arg == 5) 51 | check_isdigit(91, 96); 52 | else if (arg == 6) 53 | check_isdigit('a', 'z'); 54 | else if (arg == 7) 55 | check_isdigit(123, 127); 56 | return (0); 57 | } 58 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isprint/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:00:57 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:39:25 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n) 21 | write(1, "1", 1); 22 | else 23 | write(1, "0", 1); 24 | } 25 | 26 | static void check_isprint(int start, int end) 27 | { 28 | while (start <= end) 29 | { 30 | ft_print_result(ft_isprint(start)); 31 | start++; 32 | } 33 | } 34 | 35 | int main(int argc, const char *argv[]) 36 | { 37 | int arg; 38 | 39 | alarm(5); 40 | if (argc == 1) 41 | return (0); 42 | else if ((arg = atoi(argv[1])) == 1) 43 | check_isprint(0, 47); 44 | else if (arg == 2) 45 | check_isprint('0', '9'); 46 | else if (arg == 3) 47 | check_isprint(58, 64); 48 | else if (arg == 4) 49 | check_isprint('A', 'Z'); 50 | else if (arg == 5) 51 | check_isprint(91, 96); 52 | else if (arg == 6) 53 | check_isprint('a', 'z'); 54 | else if (arg == 7) 55 | check_isprint(123, 127); 56 | return (0); 57 | } 58 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_striteri/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:33:44 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:53:13 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | static void iter(unsigned int i, char *c) 29 | { 30 | static int indexArray[11] = {0}; 31 | 32 | if (i > 10 || indexArray[i] == 1) 33 | write(1, "wrong index\n", 12); 34 | else 35 | indexArray[i] = 1; 36 | if (*c >= 'a' && *c <= 'z') 37 | *c = *c - 32; 38 | else if (*c >= 'A' && *c <= 'Z') 39 | *c = *c + 32; 40 | } 41 | 42 | int main(int argc, const char *argv[]) 43 | { 44 | char *str; 45 | 46 | alarm(5); 47 | str = (char *)malloc(sizeof(*str) * 12); 48 | if (argc == 1 || !str) 49 | return (0); 50 | else if (atoi(argv[1]) == 1) 51 | { 52 | strcpy(str, "LoReM iPsUm"); 53 | ft_striteri(str, &iter); 54 | ft_print_result(str); 55 | } 56 | free(str); 57 | return (0); 58 | } 59 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcmp/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:04:21 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:44:01 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n > 0) 21 | write(1, "1", 1); 22 | else if (n < 0) 23 | write(1, "-1", 2); 24 | else 25 | write(1, "0", 1); 26 | } 27 | 28 | int main(int argc, const char *argv[]) 29 | { 30 | int arg; 31 | 32 | alarm(5); 33 | if (argc == 1) 34 | return (0); 35 | else if ((arg = atoi(argv[1])) == 1) 36 | ft_print_result(ft_strcmp("salut", "salut")); 37 | else if (arg == 2) 38 | ft_print_result(ft_strcmp("test", "testss")); 39 | else if (arg == 3) 40 | ft_print_result(ft_strcmp("testss", "test")); 41 | else if (arg == 4) 42 | ft_print_result(ft_strcmp("test", "tEst")); 43 | else if (arg == 5) 44 | ft_print_result(ft_strcmp("", "test")); 45 | else if (arg == 6) 46 | ft_print_result(ft_strcmp("test", "")); 47 | else if (arg == 7) 48 | ft_print_result(ft_strcmp("test\200", "test\0")); 49 | return (0); 50 | } 51 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strcasecmp/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:27:54 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:01:22 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n > 0) 20 | write(1, "1", 1); 21 | else if (n < 0) 22 | write(1, "-1", 2); 23 | else 24 | write(1, "0", 1); 25 | } 26 | 27 | int main(int argc, const char *argv[]) 28 | { 29 | int arg; 30 | 31 | alarm(5); 32 | if (argc == 1) 33 | return (0); 34 | else if ((arg = atoi(argv[1])) == 1) 35 | ft_print_result(ft_strcasecmp("salut", "salut")); 36 | else if (arg == 2) 37 | ft_print_result(ft_strcasecmp("test", "testss")); 38 | else if (arg == 3) 39 | ft_print_result(ft_strcasecmp("testss", "test")); 40 | else if (arg == 4) 41 | ft_print_result(ft_strcasecmp("test", "tEst")); 42 | else if (arg == 5) 43 | ft_print_result(ft_strcasecmp("", "test")); 44 | else if (arg == 6) 45 | ft_print_result(ft_strcasecmp("test", "")); 46 | else if (arg == 7) 47 | ft_print_result(ft_strcasecmp("test\200", "test\0")); 48 | return (0); 49 | } 50 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_isascii/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:00:10 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:39:02 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n) 21 | write(1, "1", 1); 22 | else 23 | write(1, "0", 1); 24 | } 25 | 26 | static void check_isascii(int start, int end) 27 | { 28 | while (start <= end) 29 | { 30 | ft_print_result(ft_isascii(start)); 31 | start++; 32 | } 33 | } 34 | 35 | int main(int argc, const char *argv[]) 36 | { 37 | int arg; 38 | 39 | alarm(5); 40 | if (argc == 1) 41 | return (0); 42 | else if ((arg = atoi(argv[1])) == 1) 43 | check_isascii(0, 47); 44 | else if (arg == 2) 45 | check_isascii('0', '9'); 46 | else if (arg == 3) 47 | check_isascii(58, 64); 48 | else if (arg == 4) 49 | check_isascii('A', 'Z'); 50 | else if (arg == 5) 51 | check_isascii(91, 96); 52 | else if (arg == 6) 53 | check_isascii('a', 'z'); 54 | else if (arg == 7) 55 | check_isascii(123, 127); 56 | else if (arg == 7) 57 | check_isascii(128, 138); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_substr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:35:18 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:54:34 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | static void check_substr(char *str, int start, int len) 28 | { 29 | char *substr; 30 | 31 | if (!(substr = ft_substr(str, start, len))) 32 | ft_print_result("NULL"); 33 | else 34 | ft_print_result(substr); 35 | if (str == substr) 36 | ft_print_result("\nA new string was not returned"); 37 | else 38 | free(substr); 39 | } 40 | 41 | int main(int argc, const char *argv[]) 42 | { 43 | char str[] = "lorem ipsum dolor sit amet"; 44 | int arg; 45 | 46 | alarm(5); 47 | if (argc == 1) 48 | return (0); 49 | else if ((arg = atoi(argv[1])) == 1) 50 | check_substr(str, 0, 10); 51 | else if (arg == 2) 52 | check_substr(str, 7, 10); 53 | else if (arg == 3) 54 | check_substr(str, 7, 0); 55 | else if (arg == 4) 56 | check_substr(str, 0, 0); 57 | return (0); 58 | } 59 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_alpha/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:26:47 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:59:51 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_str_is_alpha(int start, int end) 26 | { 27 | char str[] = "loremipsumdolorsitamet"; 28 | 29 | while (start <= end) 30 | { 31 | str[0] = start; 32 | ft_print_result(ft_str_is_alpha(str)); 33 | start++; 34 | } 35 | } 36 | 37 | int main(int argc, const char *argv[]) 38 | { 39 | int arg; 40 | 41 | alarm(5); 42 | if (argc == 1) 43 | return (0); 44 | else if ((arg = atoi(argv[1])) == 1) 45 | check_str_is_alpha(0, 47); 46 | else if (arg == 2) 47 | check_str_is_alpha('0', '9'); 48 | else if (arg == 3) 49 | check_str_is_alpha(58, 64); 50 | else if (arg == 4) 51 | check_str_is_alpha('A', 'Z'); 52 | else if (arg == 5) 53 | check_str_is_alpha(91, 96); 54 | else if (arg == 6) 55 | check_str_is_alpha('a', 'z'); 56 | else if (arg == 7) 57 | check_str_is_alpha(123, 127); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_numeric/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:27:11 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:00:16 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_str_is_numeric(int start, int end) 26 | { 27 | char str[] = "0123456789012345678901"; 28 | 29 | while (start <= end) 30 | { 31 | str[0] = start; 32 | ft_print_result(ft_str_is_numeric(str)); 33 | start++; 34 | } 35 | } 36 | 37 | int main(int argc, const char *argv[]) 38 | { 39 | int arg; 40 | 41 | alarm(5); 42 | if (argc == 1) 43 | return (0); 44 | else if ((arg = atoi(argv[1])) == 1) 45 | check_str_is_numeric(0, 47); 46 | else if (arg == 2) 47 | check_str_is_numeric('0', '9'); 48 | else if (arg == 3) 49 | check_str_is_numeric(58, 64); 50 | else if (arg == 4) 51 | check_str_is_numeric('A', 'Z'); 52 | else if (arg == 5) 53 | check_str_is_numeric(91, 96); 54 | else if (arg == 6) 55 | check_str_is_numeric('a', 'z'); 56 | else if (arg == 7) 57 | check_str_is_numeric(123, 127); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_printable/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:27:20 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:00:26 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_str_is_printable(int start, int end) 26 | { 27 | char str[] = "loremipsumdolorsitamet"; 28 | 29 | while (start <= end) 30 | { 31 | str[0] = start; 32 | ft_print_result(ft_str_is_printable(str)); 33 | start++; 34 | } 35 | } 36 | 37 | int main(int argc, const char *argv[]) 38 | { 39 | int arg; 40 | 41 | alarm(5); 42 | if (argc == 1) 43 | return (0); 44 | else if ((arg = atoi(argv[1])) == 1) 45 | check_str_is_printable(0, 47); 46 | else if (arg == 2) 47 | check_str_is_printable('0', '9'); 48 | else if (arg == 3) 49 | check_str_is_printable(58, 64); 50 | else if (arg == 4) 51 | check_str_is_printable('A', 'Z'); 52 | else if (arg == 5) 53 | check_str_is_printable(91, 96); 54 | else if (arg == 6) 55 | check_str_is_printable('a', 'z'); 56 | else if (arg == 7) 57 | check_str_is_printable(123, 127); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_uppercase/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:27:33 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:00:59 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_str_is_uppercase(int start, int end) 26 | { 27 | char str[] = "LOREMIPSUMDOLORSITAMET"; 28 | 29 | while (start <= end) 30 | { 31 | str[0] = start; 32 | ft_print_result(ft_str_is_uppercase(str)); 33 | start++; 34 | } 35 | } 36 | 37 | int main(int argc, const char *argv[]) 38 | { 39 | int arg; 40 | 41 | alarm(5); 42 | if (argc == 1) 43 | return (0); 44 | else if ((arg = atoi(argv[1])) == 1) 45 | check_str_is_uppercase(0, 47); 46 | else if (arg == 2) 47 | check_str_is_uppercase('0', '9'); 48 | else if (arg == 3) 49 | check_str_is_uppercase(58, 64); 50 | else if (arg == 4) 51 | check_str_is_uppercase('A', 'Z'); 52 | else if (arg == 5) 53 | check_str_is_uppercase(91, 96); 54 | else if (arg == 6) 55 | check_str_is_uppercase('a', 'z'); 56 | else if (arg == 7) 57 | check_str_is_uppercase(123, 127); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_str_is_lowercase/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 15:26:59 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 16:00:07 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(int n) 18 | { 19 | if (n) 20 | write(1, "1", 1); 21 | else 22 | write(1, "0", 1); 23 | } 24 | 25 | static void check_str_is_lowercase(int start, int end) 26 | { 27 | char str[] = "loremipsumdolorsitamet"; 28 | 29 | while (start <= end) 30 | { 31 | str[0] = start; 32 | ft_print_result(ft_str_is_lowercase(str)); 33 | start++; 34 | } 35 | } 36 | 37 | int main(int argc, const char *argv[]) 38 | { 39 | int arg; 40 | 41 | alarm(5); 42 | if (argc == 1) 43 | return (0); 44 | else if ((arg = atoi(argv[1])) == 1) 45 | check_str_is_lowercase(0, 47); 46 | else if (arg == 2) 47 | check_str_is_lowercase('0', '9'); 48 | else if (arg == 3) 49 | check_str_is_lowercase(58, 64); 50 | else if (arg == 4) 51 | check_str_is_lowercase('A', 'Z'); 52 | else if (arg == 5) 53 | check_str_is_lowercase(91, 96); 54 | else if (arg == 6) 55 | check_str_is_lowercase('a', 'z'); 56 | else if (arg == 7) 57 | check_str_is_lowercase(123, 127); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_itoa/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:19:22 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:50:09 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char *s) 18 | { 19 | int len; 20 | 21 | if (!s) 22 | write(1, "NULL", 4); 23 | else 24 | { 25 | len = 0; 26 | while (s[len]) 27 | len++; 28 | write(1, s, len); 29 | free(s); 30 | } 31 | } 32 | 33 | int main(int argc, const char *argv[]) 34 | { 35 | int arg; 36 | 37 | alarm(5); 38 | if (argc == 1) 39 | return (0); 40 | else if ((arg = atoi(argv[1])) == 1) 41 | ft_print_result(ft_itoa(0)); 42 | else if (arg == 2) 43 | ft_print_result(ft_itoa(9)); 44 | else if (arg == 3) 45 | ft_print_result(ft_itoa(-9)); 46 | else if (arg == 4) 47 | ft_print_result(ft_itoa(10)); 48 | else if (arg == 5) 49 | ft_print_result(ft_itoa(-10)); 50 | else if (arg == 6) 51 | ft_print_result(ft_itoa(8124)); 52 | else if (arg == 7) 53 | ft_print_result(ft_itoa(-9874)); 54 | else if (arg == 8) 55 | ft_print_result(ft_itoa(543000)); 56 | else if (arg == 9) 57 | ft_print_result(ft_itoa(-2147483648LL)); 58 | else if (arg == 10) 59 | ft_print_result(ft_itoa(2147483647)); 60 | return (0); 61 | } 62 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strncat/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:06:58 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:45:04 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void check_strncat(char *dest, char *src, int n, int len) 19 | { 20 | if (dest != ft_strncat(dest, src, n)) 21 | write(1, "dest's adress was not returned\n", 31); 22 | write(1, dest, len); 23 | } 24 | 25 | int main(int argc, const char *argv[]) 26 | { 27 | char *dest; 28 | int arg; 29 | int len; 30 | 31 | alarm(5); 32 | len = 15; 33 | if (!(dest = (char *)malloc(sizeof(*dest) * len)) || argc == 1) 34 | return (0); 35 | memset(dest, 0, len); 36 | memset(dest, 'r', 6); 37 | if ((arg = atoi(argv[1])) == 1) 38 | { 39 | dest[8] = 'a'; 40 | check_strncat(dest, "lorem", 2, len); 41 | } 42 | else if (arg == 2) 43 | { 44 | dest[11] = 'a'; 45 | check_strncat(dest, "lorem", 9, len); 46 | } 47 | else if (arg == 3) 48 | check_strncat(dest, "", 3, len); 49 | else if (arg == 4) 50 | check_strncat(dest, "lorem ipsum", 0, len); 51 | else if (arg == 5) 52 | { 53 | dest[0] = '\0'; 54 | dest[10] = 'a'; 55 | check_strncat(dest, "lorem ipsum", 10, len); 56 | } 57 | free(dest); 58 | return (0); 59 | } 60 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memchr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:01:40 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:39:41 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | #include 18 | 19 | static void ft_print_result(const char *s) 20 | { 21 | int len; 22 | 23 | len = 0; 24 | while (s[len]) 25 | len++; 26 | write(1, s, len); 27 | } 28 | 29 | static void check_memchr(void *s, char c, int n) 30 | { 31 | const char *str; 32 | 33 | str = ft_memchr(s, c, n); 34 | if (!str) 35 | ft_print_result("NULL"); 36 | else 37 | ft_print_result(str); 38 | } 39 | 40 | int main(int argc, const char *argv[]) 41 | { 42 | int arg; 43 | 44 | alarm(5); 45 | if (argc == 1) 46 | return (0); 47 | else if ((arg = atoi(argv[1])) == 1) 48 | check_memchr("bonjour", 'b', 4); 49 | else if (arg == 2) 50 | check_memchr("bonjour", 'o', 7); 51 | else if (arg == 3) 52 | check_memchr("bonjourno", 'n', 2); 53 | else if (arg == 4) 54 | check_memchr("bonjour", 'j', 6); 55 | else if (arg == 5) 56 | check_memchr("bonjour", 's', 7); 57 | else if (arg == 6) 58 | { 59 | int tab[7] = {-49, 49, 1, -1, 0, -2, 2}; 60 | 61 | printf("%s", (char *)ft_memchr(tab, -1, 7)); 62 | } 63 | return (0); 64 | } 65 | -------------------------------------------------------------------------------- /tests/Additional_functions/ft_strmap/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:34:12 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:53:35 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | static char map(char c) 29 | { 30 | if (c >= 'a' && c <= 'z') 31 | return (c - 32); 32 | else if (c >= 'A' && c <= 'Z') 33 | return (c + 32); 34 | else 35 | return (c); 36 | } 37 | 38 | int main(int argc, const char *argv[]) 39 | { 40 | char *str; 41 | char *strmap; 42 | 43 | alarm(5); 44 | str = (char *)malloc(sizeof(*str) * 12); 45 | if (argc == 1 || !str) 46 | return (0); 47 | else if (atoi(argv[1]) == 1) 48 | { 49 | strcpy(str, "LoReM iPsUm"); 50 | if (!(strmap = ft_strmap(str, &map))) 51 | { 52 | free(str); 53 | ft_print_result("NULL\n"); 54 | return (0); 55 | } 56 | ft_print_result(strmap); 57 | if (strmap == str) 58 | ft_print_result("\nA new string was not returned"); 59 | if (strmap[11] != '\0') { 60 | ft_print_result("\nString is not null terminated"); 61 | free(strmap); 62 | } 63 | } 64 | free(str); 65 | return (0); 66 | } 67 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_strchr/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:03:23 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:43:48 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(char const *s) 19 | { 20 | int len; 21 | 22 | len = 0; 23 | while (s[len]) 24 | len++; 25 | write(1, s, len); 26 | } 27 | 28 | static void check_strchr(char *s, int c, int offset) 29 | { 30 | char *str; 31 | 32 | if (!(str = ft_strchr(s, c))) 33 | ft_print_result("NULL"); 34 | else 35 | { 36 | ft_print_result(str); 37 | if (str != (s + offset)) 38 | ft_print_result("\nReturn value is false"); 39 | } 40 | } 41 | 42 | int main(int argc, const char *argv[]) 43 | { 44 | char str2[] = "bonjour"; 45 | int arg; 46 | 47 | alarm(5); 48 | if (argc == 1) 49 | return (0); 50 | else if ((arg = atoi(argv[1])) == 1) 51 | check_strchr(str2, 'b', 0); 52 | else if (arg == 2) 53 | check_strchr(str2, 'o', 1); 54 | else if (arg == 3) 55 | check_strchr(str2, 'j', 3); 56 | else if (arg == 4) 57 | check_strchr(str2, 's', 0); 58 | else if (arg == 5) 59 | check_strchr(str2, '\0', 7); 60 | else if (arg == 6) 61 | { 62 | char str3[] = ""; 63 | 64 | check_strchr(str3, '\0', 0); 65 | } 66 | return (0); 67 | } 68 | -------------------------------------------------------------------------------- /tests/Part1_functions/ft_memcmp/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:01:52 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:41:45 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include "libft.h" 17 | 18 | static void ft_print_result(int n) 19 | { 20 | if (n > 0) 21 | write(1, "1", 1); 22 | else if (n < 0) 23 | write(1, "-1", 2); 24 | else 25 | write(1, "0", 1); 26 | } 27 | 28 | int main(int argc, const char *argv[]) 29 | { 30 | int arg; 31 | 32 | alarm(5); 33 | if (argc == 1) 34 | return (0); 35 | else if ((arg = atoi(argv[1])) == 1) 36 | ft_print_result(ft_memcmp("salut", "salut", 5)); 37 | else if (arg == 2) 38 | ft_print_result(ft_memcmp("t\200", "t\0", 2)); 39 | else if (arg == 3) 40 | ft_print_result(ft_memcmp("testss", "test", 5)); 41 | else if (arg == 4) 42 | ft_print_result(ft_memcmp("test", "tEst", 4)); 43 | else if (arg == 5) 44 | ft_print_result(ft_memcmp("", "test", 4)); 45 | else if (arg == 6) 46 | ft_print_result(ft_memcmp("test", "", 4)); 47 | else if (arg == 7) 48 | ft_print_result(ft_memcmp("abcdefghij", "abcdefgxyz", 7)); 49 | else if (arg == 8) 50 | ft_print_result(ft_memcmp("abcdefgh", "abcdwxyz", 6)); 51 | else if (arg == 9) 52 | ft_print_result(ft_memcmp("zyxbcdefgh", "abcdefgxyz", 0)); 53 | return (0); 54 | } 55 | -------------------------------------------------------------------------------- /tests/Part2_functions/ft_strjoin/main.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* main.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jtoty +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2017/02/28 12:33:59 by jtoty #+# #+# */ 9 | /* Updated: 2017/03/09 15:53:29 by jtoty ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | #include 15 | #include "libft.h" 16 | 17 | static void ft_print_result(char const *s) 18 | { 19 | int len; 20 | 21 | len = 0; 22 | while (s[len]) 23 | len++; 24 | write(1, s, len); 25 | } 26 | 27 | static void check_strjoin(char *s1, char *s2) 28 | { 29 | char *strjoin; 30 | 31 | if (!(strjoin = ft_strjoin(s1, s2))) 32 | ft_print_result("NULL"); 33 | else 34 | ft_print_result(strjoin); 35 | if (strjoin == s1 || strjoin == s2) 36 | ft_print_result("\nA new string was not returned"); 37 | else 38 | free(strjoin); 39 | } 40 | 41 | int main(int argc, const char *argv[]) 42 | { 43 | char s1[] = "lorem ipsum"; 44 | char s2[] = "dolor sit amet"; 45 | int arg; 46 | 47 | alarm(5); 48 | if (argc == 1) 49 | return (0); 50 | else if ((arg = atoi(argv[1])) == 1) 51 | { 52 | check_strjoin(s1, s2); 53 | } 54 | else if (arg == 2) 55 | { 56 | s1[0] = '\0'; 57 | check_strjoin(s1, s2); 58 | } 59 | else if (arg == 3) 60 | { 61 | s2[0] = '\0'; 62 | check_strjoin(s1, s2); 63 | } 64 | else if (arg == 4) 65 | { 66 | s1[0] = '\0'; 67 | s2[0] = '\0'; 68 | check_strjoin(s1, s2); 69 | } 70 | return (0); 71 | } 72 | --------------------------------------------------------------------------------