diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | Makefile | 35 | ||||
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | ft_read_test.c | 7 | ||||
| -rw-r--r-- | ft_strcmp_test.c | 7 | ||||
| -rw-r--r-- | ft_strcpy_test.c | 7 | ||||
| -rw-r--r-- | ft_strdup_test.c | 7 | ||||
| -rw-r--r-- | ft_strlen_test.c | 7 | ||||
| -rw-r--r-- | ft_write_test.c | 7 | ||||
| -rw-r--r-- | libasm_test.h | 58 | ||||
| -rw-r--r-- | main.c | 13 |
11 files changed, 163 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d35bc6f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +*.ghc +a.out +runtest diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1ab26f8 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +RM = rm -f + +LIBASM_PATH = ../libasm + +CC = gcc +CCFLAGS = -Wall -Wextra +LDFLAGS = -L$(LIBASM_PATH) -lasm + +NAME = runtest +SRC = main.c ft_strlen_test.c ft_strcpy_test.c ft_strcmp_test.c \ + ft_write_test.c ft_read_test.c ft_strdup_test.c +OBJ = $(SRC:.c=.o) + +all: $(NAME) + +$(NAME): $(OBJ) + $(CC) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CCFLAGS) -c -o $@ $< + +clean: + $(RM) $(OBJ) + +fclean: clean + $(RM) $(NAME) + +re: libasm_fclean libasm_all fclean all + + +libasm_all: + make -C $(LIBASM_PATH) all + +libasm_fclean: + make -C $(LIBASM_PATH) fclean diff --git a/README.md b/README.md new file mode 100644 index 0000000..dee1186 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# libasm test + +Unit tests for the libasm project. + +## Usage + +`> make run` + +## Configuration + +The default path to your libasm is `../libasm`. You can modify it in the Makefile. diff --git a/ft_read_test.c b/ft_read_test.c new file mode 100644 index 0000000..78246b6 --- /dev/null +++ b/ft_read_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_read_test(void) +{ + +} diff --git a/ft_strcmp_test.c b/ft_strcmp_test.c new file mode 100644 index 0000000..8ac0c2d --- /dev/null +++ b/ft_strcmp_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_strcmp_test(void) +{ + +} diff --git a/ft_strcpy_test.c b/ft_strcpy_test.c new file mode 100644 index 0000000..75eae86 --- /dev/null +++ b/ft_strcpy_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_strcpy_test(void) +{ + +} diff --git a/ft_strdup_test.c b/ft_strdup_test.c new file mode 100644 index 0000000..2d5f5d0 --- /dev/null +++ b/ft_strdup_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_strdup_test(void) +{ + +} diff --git a/ft_strlen_test.c b/ft_strlen_test.c new file mode 100644 index 0000000..8c5d982 --- /dev/null +++ b/ft_strlen_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_strlen_test(void) +{ + +} diff --git a/ft_write_test.c b/ft_write_test.c new file mode 100644 index 0000000..8b7d126 --- /dev/null +++ b/ft_write_test.c @@ -0,0 +1,7 @@ +#include "libasm_test.h" + +void +ft_write_test(void) +{ + +} diff --git a/libasm_test.h b/libasm_test.h new file mode 100644 index 0000000..37577e5 --- /dev/null +++ b/libasm_test.h @@ -0,0 +1,58 @@ +#ifndef LIBASM_TEST_H +# define LIBASM_TEST_H + +# include <stddef.h> + +/* + * mandatory + */ +int +ft_strlen(char *str); +char +*ft_strcpy(char *dst, const char *src); +int +ft_strcmp(const char *s1, const char *s2); +int +ft_write(int fildes, const void *buf, size_t buf_size); +int +ft_read(int fildes, void *buf, size_t buf_size); +char +*ft_strdup(const char *str); + +/* + * bonus + */ +int +ft_atoi_base(const char *str, const char *base); + +typedef struct s_list +{ + void *data; + struct s_list *next; +} t_list; + +void +ft_list_push_front(t_list **begin_list, void *data); +int +ft_list_size(t_list *begin_list); +void +ft_list_sort(t_list **begin_list, int (*cmp)()); +void +ft_list_remove_if(t_list **begin_list, void *data_ref, int (*cmp)(), void (*free_fct)(void *)); + + +void +ft_strlen_test(void); +void +ft_strcpy_test(void); +void +ft_strcmp_test(void); +void +ft_write_test(void); +void +ft_read_test(void); +void +ft_strdup_test(void); + + +#endif @@ -0,0 +1,13 @@ +#include "libasm_test.h" + +int +main(void) +{ + ft_strlen_test(); + ft_strcpy_test(); + ft_strcmp_test(); + ft_write_test(); + ft_read_test(); + ft_strdup_test(); + return 0; +} |
