added bgoulard lib + made lib sources in their own directory in build/ for readability

This commit is contained in:
B.Goulard 2024-11-01 00:00:14 +01:00
parent 83cc8419a0
commit 0a390934d6
457 changed files with 21807 additions and 61 deletions

View file

@ -0,0 +1,32 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_itoa.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/26 11:13:01 by bgoulard #+# #+# */
/* Updated: 2024/05/31 14:26:38 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_string.h"
#include "ft_string.h"
int test_itoa(void)
{
char *res;
size_t i;
const int t_cases[] = {0, 123, -456, 7890, -12345};
const char *expected_results[] = {"0", "123", "-456", "7890", "-12345"};
i = 0;
while (i < sizeof(t_cases) / sizeof(t_cases[0]))
{
res = ft_itoa(t_cases[i]);
if (ft_strcmp(res, expected_results[i++]) != 0)
return (i);
free(res);
}
return (0);
}