libft_testing/ft_strlen_test.c
2025-10-05 13:48:30 +02:00

34 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen_test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/10/03 18:27:44 by lalgarra #+# #+# */
/* Updated: 2025/10/05 13:35:06 by lalgarra ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdio.h>
#include <string.h>
void do_test(const char *buff)
{
printf("ft_strlen(\"%s\"): %lu; strlen(): %lu; are equal: %i\r\n",
buff, ft_strlen(buff), strlen(buff), ft_strlen(buff) == strlen(buff));
}
int main(void)
{
char buff[255];
strcpy(buff, "");
do_test(buff);
strcpy(buff, "Iorem ipsum dolor");
do_test(buff);
strcpy(buff, "Iorem ip\0sum dolor");
do_test(buff);
return (0);
}