removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
40
libft/tests/ft_vector/tests_vec_to_array.c
Normal file
40
libft/tests/ft_vector/tests_vec_to_array.c
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* tests_vec_to_array.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/30 11:35:25 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/05/30 11:41:05 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
#include "ft_vector.h"
|
||||
|
||||
int test_vec_to_array(void)
|
||||
{
|
||||
t_vector *vector;
|
||||
const char **array;
|
||||
|
||||
vector = ft_vec_new();
|
||||
ft_vec_add(&vector, "Hello");
|
||||
ft_vec_add(&vector, "world");
|
||||
ft_vec_add(&vector, "this");
|
||||
ft_vec_add(&vector, "is");
|
||||
ft_vec_add(&vector, "Zod");
|
||||
array = (const char **)ft_vec_to_array(&vector);
|
||||
if (ft_strcmp(array[0], "Hello") != 0)
|
||||
return (1);
|
||||
if (ft_strcmp(array[1], "world") != 0)
|
||||
return (1);
|
||||
if (ft_strcmp(array[2], "this") != 0)
|
||||
return (1);
|
||||
if (ft_strcmp(array[3], "is") != 0)
|
||||
return (1);
|
||||
if (ft_strcmp(array[4], "Zod") != 0)
|
||||
return (1);
|
||||
free(array);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue