removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
33
libft/tests/ft_optional/tests_optional_dup.c
Normal file
33
libft/tests/ft_optional/tests_optional_dup.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_optional_dup.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/23 22:30:28 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/05/23 22:32:45 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_optional.h"
|
||||
#include "ft_optional_types.h"
|
||||
|
||||
int test_optional_dup(void)
|
||||
{
|
||||
t_optional opt_a;
|
||||
t_optional *opt_b;
|
||||
|
||||
opt_a.pres = OPT_SOME;
|
||||
opt_a.val = (void *)42;
|
||||
opt_b = ft_optional_dup(&opt_a);
|
||||
if (!opt_b)
|
||||
return (1);
|
||||
if (opt_b->pres != OPT_SOME)
|
||||
return (2);
|
||||
if (opt_b->val != (void *)42)
|
||||
return (3);
|
||||
opt_b->pres = OPT_NONE;
|
||||
ft_optional_destroy(opt_b);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue