fix makefile and tests
This commit is contained in:
6
test.c
6
test.c
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/29 19:53:58 by tomoron #+# #+# */
|
||||
/* Updated: 2025/04/12 19:30:05 by tomoron ### ########.fr */
|
||||
/* Updated: 2025/08/07 13:40:55 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -89,6 +89,7 @@ int test_write(void)
|
||||
int fail = 0;
|
||||
|
||||
TEST("writing hello and test return value", ft_write(1, "hello ", 6) == 6);
|
||||
TEST("writing nothing", ft_write(1, "hello", 0) == 0);
|
||||
errno = 0;
|
||||
TEST("failed write return value", ft_write(-1, "", 0) == (size_t)-1);
|
||||
TEST("failed write errno test", errno == 9);
|
||||
@ -111,6 +112,7 @@ int test_read(void)
|
||||
close(fd);
|
||||
|
||||
fd = open("test_file.tmp", O_RDONLY);
|
||||
TEST("read 0 char", ft_read(fd, buf, 0) == 0);
|
||||
TEST("read 1 char", ft_read(fd, buf, 1) == 1);
|
||||
TEST("check read char", memcmp(buf, "p", 1) == 0);
|
||||
TEST("read multiple char", ft_read(fd, buf, 5) == 5);
|
||||
@ -249,7 +251,7 @@ int test_list_sort()
|
||||
|
||||
int remove_if_compare(void *data, int *nb)
|
||||
{
|
||||
return((long)data == *nb);
|
||||
return((long)data != *nb);
|
||||
}
|
||||
|
||||
int test_list_remove_if()
|
||||
|
Reference in New Issue
Block a user