aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/main.c27
-rw-r--r--test/src/mem/test_ft_bzero.c26
-rw-r--r--test/src/mem/test_ft_calloc.c14
-rw-r--r--test/src/mem/test_ft_memccpy.c26
-rw-r--r--test/src/mem/test_ft_memchr.c26
-rw-r--r--test/src/mem/test_ft_memcmp.c26
-rw-r--r--test/src/mem/test_ft_memcpy.c26
-rw-r--r--test/src/mem/test_ft_memmem.c26
-rw-r--r--test/src/mem/test_ft_memmove.c26
-rw-r--r--test/src/mem/test_ft_memset.c26
-rw-r--r--test/src/mem/test_ft_memset_pattern4.c26
-rw-r--r--test/src/mem/test_ft_memswap.c26
-rw-r--r--test/src/runner/test_runner_mem.c68
-rw-r--r--test/src/runner/test_runner_str.c2
-rw-r--r--test/src/str/test_ft_strlen.c14
15 files changed, 378 insertions, 7 deletions
diff --git a/test/src/main.c b/test/src/main.c
index 9ca4fe4..7c96e53 100644
--- a/test/src/main.c
+++ b/test/src/main.c
@@ -2,10 +2,7 @@
static void run_all_test(void)
{
- RUN_TEST_GROUP(ft_strlen);
- RUN_TEST_GROUP(ft_htnew);
- RUN_TEST_GROUP(ft_htget);
- RUN_TEST_GROUP(ft_htset);
+ // ctype
RUN_TEST_GROUP(ft_isalnum);
RUN_TEST_GROUP(ft_isalpha);
RUN_TEST_GROUP(ft_isascii);
@@ -16,6 +13,28 @@ static void run_all_test(void)
RUN_TEST_GROUP(ft_todigit);
RUN_TEST_GROUP(ft_tolower);
RUN_TEST_GROUP(ft_toupper);
+
+ // mem
+ RUN_TEST_GROUP(ft_bzero);
+ RUN_TEST_GROUP(ft_calloc);
+ RUN_TEST_GROUP(ft_memccpy);
+ RUN_TEST_GROUP(ft_memchr);
+ RUN_TEST_GROUP(ft_memcmp);
+ RUN_TEST_GROUP(ft_memcpy);
+ RUN_TEST_GROUP(ft_memmem);
+ RUN_TEST_GROUP(ft_memmove);
+ RUN_TEST_GROUP(ft_memset);
+ RUN_TEST_GROUP(ft_memset_pattern4);
+ RUN_TEST_GROUP(ft_memswap);
+
+ // str
+ RUN_TEST_GROUP(ft_strlen);
+
+ // ht
+ RUN_TEST_GROUP(ft_htnew);
+ RUN_TEST_GROUP(ft_htget);
+ RUN_TEST_GROUP(ft_htset);
+
}
int main(int argc, const char **argv)
diff --git a/test/src/mem/test_ft_bzero.c b/test/src/mem/test_ft_bzero.c
new file mode 100644
index 0000000..f425068
--- /dev/null
+++ b/test/src/mem/test_ft_bzero.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_bzero.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:32:20 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:39:57 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_bzero);
+
+TEST_SETUP(ft_bzero)
+{}
+
+TEST_TEAR_DOWN(ft_bzero)
+{}
+
+TEST(ft_bzero, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_calloc.c b/test/src/mem/test_ft_calloc.c
new file mode 100644
index 0000000..1497728
--- /dev/null
+++ b/test/src/mem/test_ft_calloc.c
@@ -0,0 +1,14 @@
+#include "libft_test.h"
+
+TEST_GROUP(ft_calloc);
+
+TEST_SETUP(ft_calloc)
+{}
+
+TEST_TEAR_DOWN(ft_calloc)
+{}
+
+TEST(ft_calloc, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memccpy.c b/test/src/mem/test_ft_memccpy.c
new file mode 100644
index 0000000..6b7a1a5
--- /dev/null
+++ b/test/src/mem/test_ft_memccpy.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memccpy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:34:13 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:40:18 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memccpy);
+
+TEST_SETUP(ft_memccpy)
+{}
+
+TEST_TEAR_DOWN(ft_memccpy)
+{}
+
+TEST(ft_memccpy, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memchr.c b/test/src/mem/test_ft_memchr.c
new file mode 100644
index 0000000..c0b2ae6
--- /dev/null
+++ b/test/src/mem/test_ft_memchr.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memchr.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:33:14 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:40:28 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memchr);
+
+TEST_SETUP(ft_memchr)
+{}
+
+TEST_TEAR_DOWN(ft_memchr)
+{}
+
+TEST(ft_memchr, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memcmp.c b/test/src/mem/test_ft_memcmp.c
new file mode 100644
index 0000000..363b06a
--- /dev/null
+++ b/test/src/mem/test_ft_memcmp.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memcmp.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:32:16 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:40:36 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memcmp);
+
+TEST_SETUP(ft_memcmp)
+{}
+
+TEST_TEAR_DOWN(ft_memcmp)
+{}
+
+TEST(ft_memcmp, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memcpy.c b/test/src/mem/test_ft_memcpy.c
new file mode 100644
index 0000000..a41ceee
--- /dev/null
+++ b/test/src/mem/test_ft_memcpy.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memcpy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:33:22 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:40:46 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memcpy);
+
+TEST_SETUP(ft_memcpy)
+{}
+
+TEST_TEAR_DOWN(ft_memcpy)
+{}
+
+TEST(ft_memcpy, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memmem.c b/test/src/mem/test_ft_memmem.c
new file mode 100644
index 0000000..6492657
--- /dev/null
+++ b/test/src/mem/test_ft_memmem.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memmem.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:33:50 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:41:09 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memmem);
+
+TEST_SETUP(ft_memmem)
+{}
+
+TEST_TEAR_DOWN(ft_memmem)
+{}
+
+TEST(ft_memmem, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memmove.c b/test/src/mem/test_ft_memmove.c
new file mode 100644
index 0000000..adbb3b0
--- /dev/null
+++ b/test/src/mem/test_ft_memmove.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memmove.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:34:21 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:41:18 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memmove);
+
+TEST_SETUP(ft_memmove)
+{}
+
+TEST_TEAR_DOWN(ft_memmove)
+{}
+
+TEST(ft_memmove, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memset.c b/test/src/mem/test_ft_memset.c
new file mode 100644
index 0000000..1816dba
--- /dev/null
+++ b/test/src/mem/test_ft_memset.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memset.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:32:28 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:41:27 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memset);
+
+TEST_SETUP(ft_memset)
+{}
+
+TEST_TEAR_DOWN(ft_memset)
+{}
+
+TEST(ft_memset, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memset_pattern4.c b/test/src/mem/test_ft_memset_pattern4.c
new file mode 100644
index 0000000..9a0f109
--- /dev/null
+++ b/test/src/mem/test_ft_memset_pattern4.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memset_pattern4.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:32:43 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:41:36 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memset_pattern4);
+
+TEST_SETUP(ft_memset_pattern4)
+{}
+
+TEST_TEAR_DOWN(ft_memset_pattern4)
+{}
+
+TEST(ft_memset_pattern4, basic)
+{
+
+}
diff --git a/test/src/mem/test_ft_memswap.c b/test/src/mem/test_ft_memswap.c
new file mode 100644
index 0000000..4be1637
--- /dev/null
+++ b/test/src/mem/test_ft_memswap.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_memswap.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:38:27 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:41:46 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_memswap);
+
+TEST_SETUP(ft_memswap)
+{}
+
+TEST_TEAR_DOWN(ft_memswap)
+{}
+
+TEST(ft_memswap, basic)
+{
+
+}
diff --git a/test/src/runner/test_runner_mem.c b/test/src/runner/test_runner_mem.c
new file mode 100644
index 0000000..155008b
--- /dev/null
+++ b/test/src/runner/test_runner_mem.c
@@ -0,0 +1,68 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_runner_mem.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/13 03:36:16 by cacharle #+# #+# */
+/* Updated: 2020/02/13 03:39:11 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP_RUNNER(ft_bzero)
+{
+ RUN_TEST_CASE(ft_bzero, basic);
+}
+
+TEST_GROUP_RUNNER(ft_calloc)
+{
+ RUN_TEST_CASE(ft_calloc, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memccpy)
+{
+ RUN_TEST_CASE(ft_memccpy, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memchr)
+{
+ RUN_TEST_CASE(ft_memchr, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memcmp)
+{
+ RUN_TEST_CASE(ft_memcmp, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memcpy)
+{
+ RUN_TEST_CASE(ft_memcpy, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memmem)
+{
+ RUN_TEST_CASE(ft_memmem, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memmove)
+{
+ RUN_TEST_CASE(ft_memmove, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memset)
+{
+ RUN_TEST_CASE(ft_memset, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memset_pattern4)
+{
+ RUN_TEST_CASE(ft_memset_pattern4, basic);
+}
+
+TEST_GROUP_RUNNER(ft_memswap)
+{
+ RUN_TEST_CASE(ft_memswap, basic);
+}
diff --git a/test/src/runner/test_runner_str.c b/test/src/runner/test_runner_str.c
index 368c033..3d829ad 100644
--- a/test/src/runner/test_runner_str.c
+++ b/test/src/runner/test_runner_str.c
@@ -2,5 +2,5 @@
TEST_GROUP_RUNNER(ft_strlen)
{
- RUN_TEST_CASE(ft_strlen, yo);
+ RUN_TEST_CASE(ft_strlen, basic);
}
diff --git a/test/src/str/test_ft_strlen.c b/test/src/str/test_ft_strlen.c
index 1e4e1c4..f251fc6 100644
--- a/test/src/str/test_ft_strlen.c
+++ b/test/src/str/test_ft_strlen.c
@@ -8,7 +8,17 @@ TEST_SETUP(ft_strlen)
TEST_TEAR_DOWN(ft_strlen)
{}
-TEST(ft_strlen, yo)
+#define TEST_ASSERT_FT_STRLEN(str) do { \
+ if (strlen(str) != ft_strlen(str)) \
+ TEST_FAIL(); \
+} while(0);
+
+TEST(ft_strlen, basic)
{
- TEST_ASSERT_EQUAL(0, 0);
+ TEST_ASSERT_FT_STRLEN("");
+ TEST_ASSERT_FT_STRLEN("bonjour");
+ TEST_ASSERT_FT_STRLEN("1");
+ TEST_ASSERT_FT_STRLEN("asodifuaosidjoiasjdfoijasklfqwkberkjqwerkjqwlkenrmnqwerjkqwehfakjs");
+ TEST_ASSERT_FT_STRLEN("im\0hidden");
+ TEST_ASSERT_FT_STRLEN("987987\xff\xee\xaasdfioxcv");
}