style: norm

This commit is contained in:
airone01
2026-01-24 15:47:00 +01:00
parent 760c91c949
commit e8c88da02d
7 changed files with 34 additions and 21 deletions

View File

@@ -13,16 +13,15 @@
#include "../../util_unit.h" #include "../../util_unit.h"
#include "../tests.h" #include "../tests.h"
int strlen_launcher(void) { int strlen_launcher(void)
t_unit_test *testlist; {
size_t res; t_unit_test *testlist;
size_t res;
testlist = NULL; testlist = NULL;
load_test(&testlist, "null test", &test_null); load_test(&testlist, "null test", &test_null);
load_test(&testlist, "basic test", &test_basic); load_test(&testlist, "basic test", &test_basic);
res = launch_tests(testlist, "strlen");
res = launch_tests(testlist, "strlen"); clear_tests(&testlist);
clear_tests(&testlist); return (res);
return (res);
} }

View File

@@ -12,6 +12,7 @@
#include "libft.h" #include "libft.h"
int test_basic(void) { int test_basic(void)
return (ft_strlen("hello, world") == 12); {
return (ft_strlen("hello, world") == 12);
} }

View File

@@ -12,6 +12,7 @@
#include "libft.h" #include "libft.h"
int test_null(void) { int test_null(void)
return (ft_strlen(NULL) == 0); {
return (ft_strlen(NULL) == 0);
} }

View File

@@ -12,7 +12,7 @@
#include "tests.h" #include "tests.h"
int main(void) int main(void)
{ {
strlen_launcher(); strlen_launcher();
} }

View File

@@ -14,10 +14,10 @@
# define TESTS_H # define TESTS_H
// LAUNCHERS // LAUNCHERS
int strlen_launcher(void); int strlen_launcher(void);
// strlen // strlen
int test_basic(void); int test_basic(void);
int test_null(void); int test_null(void);
#endif // !TESTS_H #endif // !TESTS_H

View File

@@ -90,5 +90,5 @@ void clear_tests(t_unit_test **head_ptr)
head->func = NULL; head->func = NULL;
head = next; head = next;
} }
*head_ptr = NULL; *head_ptr = NULL;
} }

View File

@@ -1,3 +1,15 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* util_unit2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:46:43 by elagouch #+# #+# */
/* Updated: 2026/01/24 15:46:44 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#include "util_unit.h" #include "util_unit.h"
/* we loop over instead of shifting the pointer to make sure we don't skip /* we loop over instead of shifting the pointer to make sure we don't skip