Skip to content

Commit

Permalink
Fix: xicodomingues#67, Errors that were happening in fsoares's tests,…
Browse files Browse the repository at this point in the history
… 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 (#3)

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

Co-authored-by: Lis Costa <[email protected]>
  • Loading branch information
Desoroxxx and solismesmo authored Oct 19, 2024
1 parent 85c3827 commit d88cf33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/libft/fsoares/test_putendl_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/libft/fsoares/test_putnbr_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/libft/fsoares/test_putstr_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d88cf33

Please sign in to comment.