34 lines
1.3 KiB
C
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/04 12:15:34 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);
|
|
}
|