removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
|
|
@ -1,46 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_puchar.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/23 16:01:41 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/05/23 16:18:25 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_char.h"
|
||||
#include "tests/tests.h"
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int test_ft_putchar(void)
|
||||
{
|
||||
const char *file;
|
||||
char buf[256];
|
||||
char c;
|
||||
int fd;
|
||||
int ret;
|
||||
|
||||
file = "ft_putchar";
|
||||
c = 0;
|
||||
fd = open_test_file((char **)&file);
|
||||
if (fd < 0)
|
||||
return (1);
|
||||
while ((unsigned char)c < 255)
|
||||
ft_putchar_fd(c++, fd);
|
||||
close(fd);
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return (2);
|
||||
ret = read(fd, buf, 256);
|
||||
if (ret != 255)
|
||||
return (3);
|
||||
buf[255] = 0;
|
||||
while (ret--)
|
||||
if (buf[ret] != --c)
|
||||
return (4);
|
||||
return (destroy_test_file(fd, (char *)file), free((char *)file), 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue