Added memorybook to parsing and cleaned most of the files

This commit is contained in:
Philippe BLAGOJEVIC
2022-05-04 14:38:34 +02:00
parent e564e7c8e9
commit 362668fe35
231 changed files with 11474 additions and 405 deletions

View File

@@ -0,0 +1,23 @@
#include "libftest.h"
void compare_abs(int i, int ans)
{
if (ft_abs(i) != ans)
{
RED ft_printf("error: "); COLOREND
ft_printf("ft_abs(%i)", i);
RED ft_printf(" gives "); COLOREND
ft_printf("%i", ft_abs(i));
RED ft_printf(" instead of "); COLOREND
ft_printf("%i\n", ans);
}
}
void test_abs(void)
{
compare_abs(-1, 1);
compare_abs(0, 0);
compare_abs(-0, 0);
compare_abs(-1000, 1000);
compare_abs(-2147483647, 2147483647);
}