removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
34
libft/tests/ft_string/ft_string/test_chr.c
Normal file
34
libft/tests/ft_string/ft_string/test_chr.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_chr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/25 15:57:50 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/02 10:35:34 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
#include "ft_string_types.h"
|
||||
|
||||
int test_string_chr(void)
|
||||
{
|
||||
t_string *str;
|
||||
const char c[] = "z!H@\0";
|
||||
char *ptr_exp[sizeof(c) / sizeof(c[0])];
|
||||
size_t i;
|
||||
|
||||
str = ft_string_from("Hello world this is zod!");
|
||||
i = 0;
|
||||
while (i < sizeof(c) / sizeof(c[0]))
|
||||
{
|
||||
ptr_exp[i] = ft_strchr(str->str, c[i]);
|
||||
if (ft_string_chr(str, c[i]) != ptr_exp[i])
|
||||
return (i + 1);
|
||||
i++;
|
||||
}
|
||||
ft_string_destroy(&str);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue