diff --git a/libft/ft_lltoa.c b/libft/ft_lltoa.c deleted file mode 100644 index 02e0200..0000000 --- a/libft/ft_lltoa.c +++ /dev/null @@ -1,62 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lltoa.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: dgaillet +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/11/07 13:06:35 by dgaillet #+# #+# */ -/* Updated: 2025/12/07 12:29:25 by dgaillet ### ########lyon.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -static size_t count_digits(long long n) -{ - size_t size; - - size = 0; - if (n <= 0) - size++; - while (n) - { - n /= 10; - size++; - } - return (size); -} - -static void insert_char(char *str, unsigned long long nbr, size_t index) -{ - while (nbr) - { - str[index--] = nbr % 10 + '0'; - nbr /= 10; - } -} - -char *ft_lltoa(long long n) -{ - unsigned long long nbr; - char *str; - size_t size; - - nbr = n; - if (n < 0) - nbr = n * -1; - size = count_digits(n); - str = malloc(sizeof(char) * (size + 1)); - if (!str) - return (NULL); - str[size] = '\0'; - if (nbr == 0) - str[0] = '0'; - else - { - if (n < 0) - str[0] = '-'; - insert_char(str, nbr, size - 1); - } - return (str); -} diff --git a/real_tests/ft_strncmp/00_launcher.c b/real_tests/ft_strncmp/00_launcher.c index 2b4798a..f17a575 100644 --- a/real_tests/ft_strncmp/00_launcher.c +++ b/real_tests/ft_strncmp/00_launcher.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* 00_launcher.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dgaillet +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2026/01/25 12:05:05 by dgaillet #+# #+# */ +/* Updated: 2026/01/25 12:05:17 by dgaillet ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + #include "../tests.h" int strncmp_launcher(void) @@ -11,5 +23,4 @@ int strncmp_launcher(void) res = launch_tests(testlist, "ft_strncmp"); clear_tests(&testlist); return (res); - } diff --git a/real_tests/ft_strncmp/01_ok.c b/real_tests/ft_strncmp/01_ok.c index 94f5547..abe8703 100644 --- a/real_tests/ft_strncmp/01_ok.c +++ b/real_tests/ft_strncmp/01_ok.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* 01_ok.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dgaillet +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2026/01/25 12:05:24 by dgaillet #+# #+# */ +/* Updated: 2026/01/25 12:05:25 by dgaillet ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + #include "../tests.h" int strncmp_ok_test(void) diff --git a/real_tests/ft_strncmp/02_ko.c b/real_tests/ft_strncmp/02_ko.c index d348569..da70f26 100644 --- a/real_tests/ft_strncmp/02_ko.c +++ b/real_tests/ft_strncmp/02_ko.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* 02_ko.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dgaillet +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2026/01/25 12:05:30 by dgaillet #+# #+# */ +/* Updated: 2026/01/25 12:05:32 by dgaillet ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + #include "../tests.h" int strncmp_ko_test(void) diff --git a/real_tests/main.c b/real_tests/main.c index a54be34..c398a7d 100644 --- a/real_tests/main.c +++ b/real_tests/main.c @@ -14,7 +14,7 @@ int main(void) { - strlen_launcher(); - atoi_launcher(); - strncmp_launcher(); + strlen_launcher(); + atoi_launcher(); + strncmp_launcher(); } diff --git a/real_tests/tests.h b/real_tests/tests.h index 3a5c58e..fac006d 100644 --- a/real_tests/tests.h +++ b/real_tests/tests.h @@ -32,8 +32,7 @@ int atoi_sigsegv_test(void); int atoi_sigbus_test(void); //strncmp -int strncmp_ok_test(void); -int strncmp_ko_test(void); - +int strncmp_ok_test(void); +int strncmp_ko_test(void); #endif // !TESTS_H