Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := a
UTILS = $(addprefix utils/, sigsegv.cpp color.cpp check.cpp leaks.cpp)
PARENT_DIR = $(shell dirname $(shell pwd))
LIBFT_PATH = $(PARENT_DIR)
LIBFT_PATH = $(PARENT_DIR)/libft
TESTS_PATH = tests/
MANDATORY = memset bzero memcpy memmove memchr memcmp strlen isalpha isdigit isalnum \
isascii isprint toupper tolower strchr strrchr strncmp strlcpy strlcat strnstr \
Expand All @@ -11,7 +11,7 @@ BONUS = lstnew lstadd_front lstsize lstlast lstadd_back lstdelone lstclear lst
VSOPEN = $(addprefix vs, $(MANDATORY)) $(addprefix vs, $(BONUS))

CC = clang++
CFLAGS = -g3 -ldl -gdwarf-4 -std=c++11 -I utils/ -I$(LIBFT_PATH)
CFLAGS = -g3 -ldl -gdwarf-4 -std=c++11 -I utils/ -I$(LIBFT_PATH) -Wno-unused-result
UNAME = $(shell uname -s)
ifeq ($(UNAME), Linux)
VALGRIND = valgrind -q --leak-check=full
Expand Down
2 changes: 1 addition & 1 deletion tests/ft_putchar_fd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(void)
signal(SIGSEGV, sigsegv);
title("ft_putchar_fd\t: ")

int fd = open("tripouille", O_RDWR | O_CREAT);
int fd = open("tripouille", O_RDWR | O_CREAT, 0600);
ft_putchar_fd('a', fd);
lseek(fd, SEEK_SET, 0);
char s[10] = {0}; read(fd, s, 2);
Expand Down
2 changes: 1 addition & 1 deletion tests/ft_putendl_fd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(void)
signal(SIGSEGV, sigsegv);
title("ft_putendl_fd\t: ")

int fd = open("tripouille", O_RDWR | O_CREAT);
int fd = open("tripouille", O_RDWR | O_CREAT, 0600);
ft_putendl_fd((char*)"42", fd);
lseek(fd, SEEK_SET, 0);
char s[10] = {0}; read(fd, s, 4);
Expand Down
2 changes: 1 addition & 1 deletion tests/ft_putstr_fd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(void)
signal(SIGSEGV, sigsegv);
title("ft_putstr_fd\t: ")

int fd = open("tripouille", O_RDWR | O_CREAT);
int fd = open("tripouille", O_RDWR | O_CREAT, 0600);
ft_putstr_fd((char*)"42", fd);
lseek(fd, SEEK_SET, 0);
char s[10] = {0}; read(fd, s, 3);
Expand Down
2 changes: 1 addition & 1 deletion tests/ft_striteri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ int main(void)
}
write(1, "\n", 1);
return (0);
}
}
6 changes: 5 additions & 1 deletion tests/ft_strtrim_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ int main(void)

s = ft_strtrim("abcdba", "acb");
/* opsec-infosec 15 */ check(!strcmp(s, "d"));
/* opsec-infosec 16 */ mcheck(s, 2); free(s); showLeaks();
/* opsec-infosec 16 */ mcheck(s, 2); free(s); showLeaks();

s = ft_strtrim("x xx[h oax],x,x x", "x, ");
/* opsec-infosec 17 */ check(!strcmp(s, "[h oax]"));
/* opsec-infosec 18 */ mcheck(s, 8); free(s); showLeaks();

write(1, "\n", 1);
return (0);
}