removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
39
libft/tests/ft_vector/tests_vec_pop.c
Normal file
39
libft/tests/ft_vector/tests_vec_pop.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* tests_vec_pop.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/01 13:47:14 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/01 13:56:27 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
#include "ft_vector.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int test_vec_pop(void)
|
||||
{
|
||||
t_vector *vec;
|
||||
const char *str;
|
||||
|
||||
vec = ft_vec_new();
|
||||
ft_vec_add(&vec, "value1");
|
||||
ft_vec_add(&vec, "value2");
|
||||
ft_vec_add(&vec, "value3");
|
||||
str = ft_vec_pop(vec);
|
||||
if (!str || ft_strcmp(str, "value3") != 0 || vec->count != 2)
|
||||
return (1);
|
||||
str = ft_vec_pop(vec);
|
||||
if (!str || ft_strcmp(str, "value2") != 0 || vec->count != 1)
|
||||
return (2);
|
||||
str = ft_vec_pop(vec);
|
||||
if (!str || ft_strcmp(str, "value1") != 0 || vec->count != 0)
|
||||
return (3);
|
||||
str = ft_vec_pop(vec);
|
||||
if (str)
|
||||
return (4);
|
||||
return (ft_vec_destroy(&vec), 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue