-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnl_invalid_test.c
More file actions
31 lines (28 loc) · 1.28 KB
/
Copy pathgnl_invalid_test.c
File metadata and controls
31 lines (28 loc) · 1.28 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gnl_invalid_test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <abenamar@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/14 23:39:55 by abenamar #+# #+# */
/* Updated: 2023/04/19 07:04:45 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line_test.h"
void gnl_invalid_test(void)
{
const char *filename = "invalid";
int fd;
char *s;
printf(RESET "\n%s \t\t", filename);
fd = open("files/invalid_file_which_does_not_exist", O_RDONLY);
s = get_next_line(fd);
ft_assert(1, s == NULL);
fd = -256;
s = get_next_line(fd);
ft_assert(2, s == NULL);
fd = open("files/", O_RDONLY);
s = get_next_line(fd);
ft_assert(3, s == NULL);
}