-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnl_vertical_test.c
More file actions
36 lines (33 loc) · 1.3 KB
/
gnl_vertical_test.c
File metadata and controls
36 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gnl_vertical_test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/13 22:00:43 by abenamar #+# #+# */
/* Updated: 2023/04/19 07:05:33 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line_test.h"
void gnl_vertical_test(void)
{
const char *filename = "files/vertical";
const int fd = open(filename, O_RDONLY);
char *s;
printf(RESET "\n%s \t\t", filename);
if (fd < 0)
exit(1);
s = get_next_line(fd);
ft_assert(1, !strcmp(s, "\n"));
while (s)
{
free(s);
s = get_next_line(fd);
}
ft_assert(2, s == NULL);
s = get_next_line(fd);
ft_assert(3, s == NULL);
if (close(fd) < 0)
exit(1);
}