Prettier output and some fixes (#4)
* feat: tab results * feat: more colors * style: norm * fix: patch a spacing bug * fix: patch a small issue * fix: patch some leaks * style: norm
This commit is contained in:
2
Makefile
2
Makefile
@@ -32,11 +32,13 @@ clean:
|
||||
$(RM) $(OBJ) $(SRC:.c=.d)
|
||||
@$(MAKE) -C $(TESTD) clean
|
||||
@$(MAKE) -C $(RTESTD) clean
|
||||
@$(MAKE) -C $(LIBFT_DIR) clean
|
||||
|
||||
fclean: clean
|
||||
$(RM) $(NAME)
|
||||
@$(MAKE) -C $(TESTD) fclean
|
||||
@$(MAKE) -C $(RTESTD) fclean
|
||||
@$(MAKE) -C $(LIBFT_DIR) fclean
|
||||
|
||||
re: fclean all
|
||||
@$(MAKE)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: dgaillet <dgaillet@student.42lyon.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/01/24 12:43:35 by dgaillet #+# #+# */
|
||||
/* Updated: 2026/01/25 15:15:05 by elagouch ### ########.fr */
|
||||
/* Updated: 2026/01/25 18:15:25 by elagouch ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,20 +16,28 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int parent_helper(int ffd, struct s_helper *h, const char *fn_name,
|
||||
static int parent_helper(int ffd, struct s_helper *h, const char *fn_name,
|
||||
t_unit_test *test_list)
|
||||
{
|
||||
int status;
|
||||
int ffdst[2];
|
||||
pid_t caught_pid;
|
||||
|
||||
h->wpid = waitpid(h->wpid, &status, WCONTINUED);
|
||||
if (h->wpid < 0)
|
||||
caught_pid = 0;
|
||||
while (caught_pid != h->wpid)
|
||||
{
|
||||
caught_pid = wait(&status);
|
||||
if (caught_pid < 0)
|
||||
return (-1);
|
||||
h->ok_tests += interpret_status(ffd, status, fn_name, get_test_at(test_list,
|
||||
h->i)->title);
|
||||
}
|
||||
ffdst[0] = ffd;
|
||||
ffdst[1] = status;
|
||||
h->ok_tests += interpret_status(ffdst, fn_name, get_test_at(test_list,
|
||||
h->i)->title, test_list->max_len);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int child_helper(t_unit_test *test_list, t_h h)
|
||||
static int child_helper(t_unit_test *test_list, t_h h, int ffd)
|
||||
{
|
||||
int fd;
|
||||
int res;
|
||||
@@ -45,10 +53,12 @@ int child_helper(t_unit_test *test_list, t_h h)
|
||||
alarm(test->timeout);
|
||||
res = test->func();
|
||||
close(fd);
|
||||
close(ffd);
|
||||
clear_tests(&test_list);
|
||||
exit(res);
|
||||
}
|
||||
|
||||
int handle_out(const char *fn_name)
|
||||
static int handle_out(const char *fn_name)
|
||||
{
|
||||
char *tmp;
|
||||
int fd;
|
||||
@@ -70,18 +80,20 @@ int launch_tests(t_unit_test *test_list, const char *fn_name)
|
||||
h.i = -1;
|
||||
ffd = handle_out(fn_name);
|
||||
if (ffd < 0)
|
||||
return (1);
|
||||
return (-1);
|
||||
while (++h.i < (int)count_tests(test_list))
|
||||
{
|
||||
h.wpid = fork();
|
||||
if (h.wpid < 0)
|
||||
return (1);
|
||||
else if (h.wpid == 0 && child_helper(test_list, h) < 0)
|
||||
return (1);
|
||||
return (-1);
|
||||
else if (h.wpid == 0 && child_helper(test_list, h, ffd) < 0)
|
||||
return (-1);
|
||||
else if (parent_helper(ffd, &h, fn_name, test_list))
|
||||
return (1);
|
||||
return (-1);
|
||||
}
|
||||
print_passed_test(ffd, h.ok_tests, test_list);
|
||||
close(ffd);
|
||||
if (h.ok_tests != count_tests(test_list))
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/01/24 14:38:40 by elagouch #+# #+# */
|
||||
/* Updated: 2026/01/25 15:09:41 by elagouch ### ########.fr */
|
||||
/* Updated: 2026/01/25 17:33:21 by elagouch ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -26,6 +26,7 @@ typedef struct s_unit_test
|
||||
int (*func)(void);
|
||||
struct s_unit_test *next;
|
||||
unsigned int timeout;
|
||||
size_t max_len;
|
||||
} t_unit_test;
|
||||
|
||||
/**
|
||||
@@ -74,8 +75,8 @@ typedef struct s_helper
|
||||
int i;
|
||||
} t_h;
|
||||
|
||||
size_t interpret_status(int ffd, int status,
|
||||
const char *fn_name, char *test_name);
|
||||
size_t interpret_status(int ffdst[2], const char *fn_name,
|
||||
char *test_name, size_t spaces);
|
||||
|
||||
void print_passed_test(int ffd, size_t ok_tests,
|
||||
t_unit_test *test_list);
|
||||
|
||||
@@ -6,27 +6,46 @@
|
||||
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/01/25 14:26:54 by elagouch #+# #+# */
|
||||
/* Updated: 2026/01/25 14:56:06 by elagouch ### ########.fr */
|
||||
/* Updated: 2026/01/25 17:35:53 by elagouch ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libunit.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void print_tabbed(int fd1, int fd2, char *s, size_t expected_len)
|
||||
{
|
||||
size_t i;
|
||||
size_t l;
|
||||
|
||||
l = ft_strlen(s);
|
||||
ft_putstr_fd(s, fd1);
|
||||
ft_putstr_fd(s, fd2);
|
||||
i = 0;
|
||||
while (l <= expected_len && i < (expected_len - l))
|
||||
{
|
||||
ft_putchar_fd(' ', fd1);
|
||||
ft_putchar_fd(' ', fd2);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
static void print_wtermsig(int ffd, int signal)
|
||||
{
|
||||
static char *sigs[15];
|
||||
char *msg;
|
||||
|
||||
sigs[4] = "SIGKILL";
|
||||
sigs[6] = "SIGABRT";
|
||||
sigs[7] = "SIGBUS";
|
||||
sigs[8] = "SIGFPE";
|
||||
sigs[9] = "SIGKILL";
|
||||
sigs[11] = "SIGSEGV";
|
||||
sigs[13] = "SIGPIPE";
|
||||
sigs[14] = "TIMEOUT";
|
||||
ft_putstr_fd("[\x1B[33m", 1);
|
||||
ft_putstr_fd("[", ffd);
|
||||
if ((signal >= 6 && signal <=8) || signal == 4 || signal == 11 || (signal >= 13 && signal <= 14))
|
||||
if ((signal >= 6 && signal <= 9) || signal == 11 || (signal >= 13
|
||||
&& signal <= 14))
|
||||
msg = sigs[signal];
|
||||
else
|
||||
msg = "UNKNOWN";
|
||||
@@ -36,33 +55,39 @@ static void print_wtermsig(int ffd, int signal)
|
||||
ft_putstr_fd("]\n", ffd);
|
||||
}
|
||||
|
||||
size_t interpret_status(int ffd, int status, const char *fn_name,
|
||||
char *test_name)
|
||||
static void interpret_status_print(const char *fn_name, int ffd,
|
||||
char *test_name, size_t max_len)
|
||||
{
|
||||
ft_putstr_fd("\x1B[94m", 1);
|
||||
ft_putstr_fd((char *)fn_name, 1);
|
||||
ft_putstr_fd((char *)fn_name, ffd);
|
||||
ft_putstr_fd(" : ", 1);
|
||||
ft_putstr_fd("\x1B[90m : \x1B[0m", 1);
|
||||
ft_putstr_fd(" : ", ffd);
|
||||
ft_putstr_fd(test_name, 1);
|
||||
ft_putstr_fd(test_name, ffd);
|
||||
ft_putstr_fd(" : ", 1);
|
||||
ft_putstr_fd(" : ", ffd);
|
||||
if (WIFEXITED(status))
|
||||
print_tabbed(1, ffd, test_name, max_len);
|
||||
ft_putstr_fd("\x1B[90m : \x1B[0m", 1);
|
||||
ft_putstr_fd(": ", ffd);
|
||||
}
|
||||
|
||||
size_t interpret_status(int ffdst[2], const char *fn_name, char *test_name,
|
||||
size_t max_len)
|
||||
{
|
||||
interpret_status_print(fn_name, ffdst[0], test_name, max_len);
|
||||
if (WIFEXITED(ffdst[1]))
|
||||
{
|
||||
if (WEXITSTATUS(status))
|
||||
if (WEXITSTATUS(ffdst[1]))
|
||||
{
|
||||
ft_putstr_fd("[\x1B[31m\x1B[1mKO\x1B[0m]\n", 1);
|
||||
ft_putstr_fd("[KO]\n", ffd);
|
||||
ft_putstr_fd("[KO]\n", ffdst[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft_putstr_fd("[\x1B[32mOK\x1B[0m]\n", 1);
|
||||
ft_putstr_fd("[OK]\n", ffd);
|
||||
ft_putstr_fd("[OK]\n", ffdst[0]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else if (WIFSIGNALED(status))
|
||||
print_wtermsig(ffd, WTERMSIG(status));
|
||||
else if (WIFSIGNALED(ffdst[1]))
|
||||
print_wtermsig(ffdst[0], WTERMSIG(ffdst[1]));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -81,6 +106,6 @@ void print_passed_test(int ffd, size_t ok_tests, t_unit_test *test_list)
|
||||
ft_putchar_fd('/', ffd);
|
||||
ft_putnbr_fd((int)total, 1);
|
||||
ft_putnbr_fd((int)total, ffd);
|
||||
ft_putstr_fd("\x1B[0m tests succeeded\n\n", 1);
|
||||
ft_putstr_fd(" tests succeeded\n\n", ffd);
|
||||
ft_putstr_fd("\x1B[0m tests passed\n\n", 1);
|
||||
ft_putstr_fd(" tests passed\n\n", ffd);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/01/24 14:35:57 by elagouch #+# #+# */
|
||||
/* Updated: 2026/01/25 15:11:24 by elagouch ### ########.fr */
|
||||
/* Updated: 2026/01/25 18:03:11 by elagouch ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -39,7 +39,8 @@ t_unit_test *get_last(t_unit_test *head)
|
||||
/**
|
||||
* @brief util function to allocate a new test
|
||||
*/
|
||||
static t_unit_test *alloc_test(const char *title, int (*test_func)(void), unsigned int timeout)
|
||||
static t_unit_test *alloc_test(const char *title, int (*test_func)(void),
|
||||
unsigned int timeout)
|
||||
{
|
||||
t_unit_test *p;
|
||||
|
||||
@@ -48,48 +49,51 @@ static t_unit_test *alloc_test(const char *title, int (*test_func)(void), unsign
|
||||
p->func = test_func;
|
||||
p->next = NULL;
|
||||
p->timeout = timeout;
|
||||
p->max_len = 0;
|
||||
return (p);
|
||||
}
|
||||
|
||||
size_t load_test(t_unit_test **head_ptr, const char *title,
|
||||
int (*test_func)(void), unsigned int timeout)
|
||||
{
|
||||
t_unit_test *p;
|
||||
t_unit_test *last;
|
||||
size_t tlen;
|
||||
|
||||
if (!head_ptr)
|
||||
return (-1);
|
||||
tlen = ft_strlen(title);
|
||||
if (!*head_ptr)
|
||||
{
|
||||
p = alloc_test(title, test_func, timeout);
|
||||
if (!p)
|
||||
*head_ptr = alloc_test(title, test_func, timeout);
|
||||
if (!*head_ptr)
|
||||
return (-1);
|
||||
*head_ptr = p;
|
||||
(*head_ptr)->max_len = ft_strlen(title);
|
||||
return (0);
|
||||
}
|
||||
last = get_last(*head_ptr);
|
||||
last->next = alloc_test(title, test_func, timeout);
|
||||
if (!last->next)
|
||||
return (-1);
|
||||
if ((*head_ptr)->max_len < tlen)
|
||||
(*head_ptr)->max_len = tlen;
|
||||
return (0);
|
||||
}
|
||||
|
||||
void clear_tests(t_unit_test **head_ptr)
|
||||
{
|
||||
t_unit_test *head;
|
||||
t_unit_test *current;
|
||||
t_unit_test *next;
|
||||
|
||||
next = *head_ptr;
|
||||
head = NULL;
|
||||
while (head)
|
||||
if (!head_ptr)
|
||||
return ;
|
||||
current = *head_ptr;
|
||||
while (current)
|
||||
{
|
||||
head = *head_ptr;
|
||||
next = head->next;
|
||||
head->next = NULL;
|
||||
free(head->title);
|
||||
head->title = NULL;
|
||||
head->func = NULL;
|
||||
head = next;
|
||||
next = current->next;
|
||||
if (current->title)
|
||||
free(current->title);
|
||||
free(current);
|
||||
current = next;
|
||||
}
|
||||
*head_ptr = NULL;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ static long long int ft_atoll(const char *nptr)
|
||||
if (nptr[i] == '-' && ft_isdigit(nptr[i + 1]))
|
||||
{
|
||||
res = -1 * ft_atoll(&nptr[i] + 1);
|
||||
if ((nptr[i + 1] != '1' && res == 1)
|
||||
|| (nptr[i + 1] == '1' && ft_isdigit(nptr[i + 2]) && res == 1))
|
||||
if ((nptr[i + 1] != '1' && res == 1) || (nptr[i + 1] == '1'
|
||||
&& ft_isdigit(nptr[i + 2]) && res == 1))
|
||||
return (0);
|
||||
return (res);
|
||||
}
|
||||
@@ -57,6 +57,6 @@ int ft_atoi(const char *nptr)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = (int) ft_atoll(nptr);
|
||||
res = (int)ft_atoll(nptr);
|
||||
return (res);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void ft_bzero(void *s, size_t n)
|
||||
{
|
||||
while (n > 0)
|
||||
{
|
||||
*((unsigned char *) s) = '\0';
|
||||
*((unsigned char *)s) = '\0';
|
||||
s++;
|
||||
n--;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ void *ft_memchr(const void *s, int c, size_t n)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = (void *) s;
|
||||
ptr = (void *)s;
|
||||
while (n > 0)
|
||||
{
|
||||
if (*((unsigned char *) ptr) == (unsigned char) c)
|
||||
if (*((unsigned char *)ptr) == (unsigned char)c)
|
||||
return (ptr);
|
||||
ptr++;
|
||||
n--;
|
||||
|
||||
@@ -19,9 +19,9 @@ int ft_memcmp(const void *s1, const void *s2, size_t n)
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
if (((unsigned char *) s1)[i] > ((unsigned char *) s2)[i])
|
||||
if (((unsigned char *)s1)[i] > ((unsigned char *)s2)[i])
|
||||
return (1);
|
||||
if (((unsigned char *) s1)[i] < ((unsigned char *) s2)[i])
|
||||
if (((unsigned char *)s1)[i] < ((unsigned char *)s2)[i])
|
||||
return (-1);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ void *ft_memcpy(void *dest, const void *src, size_t n)
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
((unsigned char *) dest)[i] = ((unsigned char *) src)[i];
|
||||
((unsigned char *)dest)[i] = ((unsigned char *)src)[i];
|
||||
i++;
|
||||
}
|
||||
return (dest);
|
||||
|
||||
@@ -19,10 +19,10 @@ static void *ft_rev_memcpy(void *dest, const void *src, size_t n)
|
||||
n--;
|
||||
while (n > 0)
|
||||
{
|
||||
((unsigned char *) dest)[n] = ((unsigned char *) src)[n];
|
||||
((unsigned char *)dest)[n] = ((unsigned char *)src)[n];
|
||||
n--;
|
||||
}
|
||||
((unsigned char *) dest)[n] = ((unsigned char *) src)[n];
|
||||
((unsigned char *)dest)[n] = ((unsigned char *)src)[n];
|
||||
return (dest);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void *ft_memset(void *s, int c, size_t n)
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
((unsigned char *) s)[i] = c;
|
||||
((unsigned char *)s)[i] = c;
|
||||
i++;
|
||||
}
|
||||
return (s);
|
||||
|
||||
@@ -68,7 +68,7 @@ char **ft_split(char const *s, char c)
|
||||
{
|
||||
if ((s[j] != c && j == 0) || (s[j] != c && s[j - 1] == c))
|
||||
{
|
||||
strs[i] = ft_substr(&s[j], 0, next_match((char *) &s[j], c));
|
||||
strs[i] = ft_substr(&s[j], 0, next_match((char *)&s[j], c));
|
||||
if (!strs[i++])
|
||||
{
|
||||
clear_strs(strs);
|
||||
|
||||
@@ -19,11 +19,11 @@ char *ft_strchr(const char *s, int c)
|
||||
i = 0;
|
||||
while (s[i])
|
||||
{
|
||||
if ((unsigned char) s[i] == (unsigned char) c)
|
||||
return ((char *) s + i);
|
||||
if ((unsigned char)s[i] == (unsigned char)c)
|
||||
return ((char *)s + i);
|
||||
i++;
|
||||
}
|
||||
if ((unsigned char) s[i] == (unsigned char) c)
|
||||
return ((char *) s + i);
|
||||
if ((unsigned char)s[i] == (unsigned char)c)
|
||||
return ((char *)s + i);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ char *ft_strdup(const char *s)
|
||||
char *dest;
|
||||
int i;
|
||||
|
||||
dest = malloc(sizeof(char) *(ft_strlen(s) + 1));
|
||||
dest = malloc(sizeof(char) * (ft_strlen(s) + 1));
|
||||
if (!dest)
|
||||
return (NULL);
|
||||
i = 0;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char*))
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char *))
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ int ft_strncmp(const char *s1, const char *s2, size_t n)
|
||||
i = 0;
|
||||
while ((s1[i] || s2[i]) && i < n)
|
||||
{
|
||||
if ((unsigned char) s1[i] > (unsigned char) s2[i])
|
||||
if ((unsigned char)s1[i] > (unsigned char)s2[i])
|
||||
return (1);
|
||||
if ((unsigned char) s1[i] < (unsigned char) s2[i])
|
||||
if ((unsigned char)s1[i] < (unsigned char)s2[i])
|
||||
return (-1);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ char *ft_strnstr(const char *big, const char *little, size_t len)
|
||||
little_len = ft_strlen(little);
|
||||
big_len = ft_strlen(big);
|
||||
if (!little[0])
|
||||
return ((char *) big);
|
||||
return ((char *)big);
|
||||
while ((little_len + i) <= len && (little_len + i) <= big_len)
|
||||
{
|
||||
if (!ft_strncmp(&big[i], little, little_len))
|
||||
return ((char *) &big[i]);
|
||||
return ((char *)&big[i]);
|
||||
i++;
|
||||
}
|
||||
return (NULL);
|
||||
|
||||
@@ -21,8 +21,8 @@ char *ft_strrchr(const char *s, int c)
|
||||
i++;
|
||||
while (i >= 0)
|
||||
{
|
||||
if ((unsigned char) s[i] == (unsigned char) c)
|
||||
return ((char *) &s[i]);
|
||||
if ((unsigned char)s[i] == (unsigned char)c)
|
||||
return ((char *)&s[i]);
|
||||
i--;
|
||||
}
|
||||
return (NULL);
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
#ifndef LIBFT_H
|
||||
# define LIBFT_H
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include <limits.h>
|
||||
# include <stdint.h>
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
|
||||
typedef struct s_list
|
||||
{
|
||||
@@ -43,7 +43,8 @@ char *ft_strrchr(const char *s, int c);
|
||||
int ft_strncmp(const char *s1, const char *s2, size_t n);
|
||||
int ft_memcmp(const void *s1, const void *s2, size_t n);
|
||||
void *ft_memchr(const void *s, int c, size_t n);
|
||||
char *ft_strnstr(const char *big, const char *little, size_t len);
|
||||
char *ft_strnstr(const char *big, const char *little,
|
||||
size_t len);
|
||||
int ft_atoi(const char *nptr);
|
||||
void *ft_calloc(size_t nmemb, size_t size);
|
||||
char *ft_strdup(const char *s);
|
||||
@@ -53,7 +54,7 @@ char *ft_strtrim(char const *s1, char const *set);
|
||||
char **ft_split(char const *s, char c);
|
||||
char *ft_itoa(int n);
|
||||
char *ft_strmapi(char const *s, char (*f)(unsigned int, char));
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char*));
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char *));
|
||||
void ft_putchar_fd(char c, int fd);
|
||||
void ft_putstr_fd(char *s, int fd);
|
||||
void ft_putendl_fd(char *s, int fd);
|
||||
@@ -66,7 +67,8 @@ void ft_lstadd_back(t_list **lst, t_list *new_);
|
||||
void ft_lstdelone(t_list *lst, void (*del)(void *));
|
||||
void ft_lstclear(t_list **lst, void (*del)(void *));
|
||||
void ft_lstiter(t_list *lst, void (*f)(void *));
|
||||
t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *));
|
||||
t_list *ft_lstmap(t_list *lst, void *(*f)(void *),
|
||||
void (*del)(void *));
|
||||
char *ft_lltoa(long long n);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 04_null.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/01/25 17:33:31 by elagouch #+# #+# */
|
||||
/* Updated: 2026/01/25 17:33:32 by elagouch ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../tests.h"
|
||||
|
||||
int atoi_null_test(void)
|
||||
|
||||
@@ -33,7 +33,7 @@ int atoi_int_max_test(void);
|
||||
int atoi_int_min_test(void);
|
||||
int atoi_null_test(void);
|
||||
|
||||
//strncmp
|
||||
// strncmp
|
||||
int strncmp_basic_test(void);
|
||||
int strncmp_len_test(void);
|
||||
int strncmp_high_len_test(void);
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
int test_timeout(void)
|
||||
{
|
||||
while(1)
|
||||
{}
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user