From 550e46e30225af28591cb000288e8103f6b5b46c Mon Sep 17 00:00:00 2001 From: Lis Costa Date: Wed, 9 Aug 2023 04:32:45 -0300 Subject: [PATCH] Fix: #67, Errors that were happening in fsoares's tests, at functions: ft_putstr_fd, ft_putnbr_fd and ft_putendl_fd. The file to be opened did not have the correct permissions (write and read). It was added 'S_IRWXU' flag to 'open' of 'fd' variable Changes to be committed: modified: tests/libft/fsoares/test_putendl_fd.c modified: tests/libft/fsoares/test_putnbr_fd.c modified: tests/libft/fsoares/test_putstr_fd.c --- tests/libft/fsoares/test_putendl_fd.c | 2 +- tests/libft/fsoares/test_putnbr_fd.c | 2 +- tests/libft/fsoares/test_putstr_fd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libft/fsoares/test_putendl_fd.c b/tests/libft/fsoares/test_putendl_fd.c index 2f80ae8c..2ce74994 100644 --- a/tests/libft/fsoares/test_putendl_fd.c +++ b/tests/libft/fsoares/test_putendl_fd.c @@ -11,7 +11,7 @@ int single_test_putendl(int test_number, char *str, int fd) int test_putendl_fd() { - int fd = open("fsoares", O_RDWR | O_CREAT); + int fd = open("fsoares", O_RDWR | O_CREAT, S_IRWXU); int res = single_test_putendl(1, "", fd); res = single_test_putendl(2, "abcdef", fd) && res; diff --git a/tests/libft/fsoares/test_putnbr_fd.c b/tests/libft/fsoares/test_putnbr_fd.c index 11908bd2..5c8eb91e 100644 --- a/tests/libft/fsoares/test_putnbr_fd.c +++ b/tests/libft/fsoares/test_putnbr_fd.c @@ -12,7 +12,7 @@ int single_test_putnbr(int test_number, int n, int fd) int test_putnbr_fd() { - int fd = open("fsoares", O_RDWR | O_CREAT); + int fd = open("fsoares", O_RDWR | O_CREAT, S_IRWXU); int res = single_test_putnbr(1, 0, fd); res = single_test_putnbr(2, 10000043, fd) && res; diff --git a/tests/libft/fsoares/test_putstr_fd.c b/tests/libft/fsoares/test_putstr_fd.c index f5607c46..df4b13e6 100644 --- a/tests/libft/fsoares/test_putstr_fd.c +++ b/tests/libft/fsoares/test_putstr_fd.c @@ -11,7 +11,7 @@ int single_test_putstr(int test_number, char *str, int fd) int test_putstr_fd() { - int fd = open("fsoares", O_RDWR | O_CREAT); + int fd = open("fsoares", O_RDWR | O_CREAT, S_IRWXU); int res = single_test_putstr(1, "abcdef", fd); res = single_test_putstr(2, "\n1234", fd) && res;