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,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tests_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/25 12:23:35 by bgoulard #+# #+# */
/* Updated: 2024/06/25 21:40:19 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_string.h"
#include <stdint.h>
// str[x] = 'a' is to test that we can write in the memory we asked for
int test_calloc(void)
{
char *str;
str = ft_calloc(10, sizeof(char));
str[9] = 'a';
free(str);
str = ft_calloc(10, sizeof(char *));
str[9 * sizeof(char *)] = 'a';
free(str);
str = ft_calloc(0, sizeof(char));
free(str);
str = ft_calloc(SIZE_MAX, SIZE_MAX);
if (str)
return (1);
return (0);
}