ca fait bcp la non

This commit is contained in:
airone01
2026-01-24 16:20:53 +01:00
parent 1b48b0bb13
commit 6e652d3b24
20 changed files with 232 additions and 40 deletions

View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 00_launcher.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:32:32 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:17:20 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#include "../tests.h"
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);
}

View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 01_basic.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:38:17 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:17:14 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#include "../tests.h"
int test_basic(void)
{
return (ft_strlen("hello, world") == 12);
}

View File

@@ -0,0 +1,17 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 02_null.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:38:17 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:17:04 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#include "../tests.h"
int test_null(void) {
return (ft_strlen(NULL) == 0);
}

22
real_tests/tests.h Normal file
View File

@@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tests.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:32:30 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:16:13 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef TESTS_H
# define TESTS_H
# include "libunit.h"
// strlen
int test_basic(void);
int test_null(void);
#endif // !TESTS_H