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

28
libunit_util2.c Normal file
View File

@@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libunit_util2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:46:43 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:15:43 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
#include "libunit.h"
/* we loop over instead of shifting the pointer to make sure we don't skip
unexisting tests and end up in unallocated/invalid memory */
t_unit_test *get_test_at(t_unit_test *head, size_t target_idx)
{
size_t j;
j = 0;
while ((j < target_idx) && head)
{
head = head->next;
j++;
}
return (head);
}