style: norm
This commit is contained in:
@@ -13,16 +13,15 @@
|
||||
#include "../../util_unit.h"
|
||||
#include "../tests.h"
|
||||
|
||||
int strlen_launcher(void) {
|
||||
t_unit_test *testlist;
|
||||
size_t res;
|
||||
int strlen_launcher(void)
|
||||
{
|
||||
t_unit_test *testlist;
|
||||
size_t res;
|
||||
|
||||
testlist = NULL;
|
||||
load_test(&testlist, "null test", &test_null);
|
||||
load_test(&testlist, "basic test", &test_basic);
|
||||
|
||||
res = launch_tests(testlist, "strlen");
|
||||
clear_tests(&testlist);
|
||||
|
||||
return (res);
|
||||
testlist = NULL;
|
||||
load_test(&testlist, "null test", &test_null);
|
||||
load_test(&testlist, "basic test", &test_basic);
|
||||
res = launch_tests(testlist, "strlen");
|
||||
clear_tests(&testlist);
|
||||
return (res);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int test_basic(void) {
|
||||
return (ft_strlen("hello, world") == 12);
|
||||
int test_basic(void)
|
||||
{
|
||||
return (ft_strlen("hello, world") == 12);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int test_null(void) {
|
||||
return (ft_strlen(NULL) == 0);
|
||||
int test_null(void)
|
||||
{
|
||||
return (ft_strlen(NULL) == 0);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
int main(void)
|
||||
int main(void)
|
||||
{
|
||||
strlen_launcher();
|
||||
strlen_launcher();
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
# define TESTS_H
|
||||
|
||||
// LAUNCHERS
|
||||
int strlen_launcher(void);
|
||||
int strlen_launcher(void);
|
||||
|
||||
// strlen
|
||||
int test_basic(void);
|
||||
int test_null(void);
|
||||
int test_basic(void);
|
||||
int test_null(void);
|
||||
|
||||
#endif // !TESTS_H
|
||||
|
||||
@@ -90,5 +90,5 @@ void clear_tests(t_unit_test **head_ptr)
|
||||
head->func = NULL;
|
||||
head = next;
|
||||
}
|
||||
*head_ptr = NULL;
|
||||
*head_ptr = NULL;
|
||||
}
|
||||
|
||||
12
util_unit2.c
12
util_unit2.c
@@ -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"
|
||||
|
||||
/* we loop over instead of shifting the pointer to make sure we don't skip
|
||||
|
||||
Reference in New Issue
Block a user