added bgoulard lib + made lib sources in their own directory in build/ for readability

This commit is contained in:
B.Goulard 2024-11-01 00:00:14 +01:00
parent 83cc8419a0
commit 0a390934d6
457 changed files with 21807 additions and 61 deletions

View file

@ -0,0 +1,42 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tests_vec_reverse.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/24 11:30:26 by bgoulard #+# #+# */
/* Updated: 2024/05/24 11:30:33 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_vector.h"
#include "ft_vector_types.h"
int test_vec_reverse(void)
{
t_vector *vec;
int a;
int b;
int c;
a = 42;
b = 43;
c = 44;
vec = ft_vec_new();
ft_vec_add(&vec, &a);
ft_vec_add(&vec, &b);
ft_vec_add(&vec, &c);
ft_vec_shrink(vec);
ft_vec_reverse(vec);
if (vec->count != 3)
return (1);
else if (*(int *)ft_vec_at(vec, 0) != 44)
return (1);
else if (*(int *)ft_vec_at(vec, 1) != 43)
return (1);
else if (*(int *)ft_vec_at(vec, 2) != 42)
return (1);
ft_vec_destroy(&vec);
return (0);
}