GCC Code Coverage Report


Directory: ./
File: lib/mylist/my_push_front.c
Date: 2024-06-05 02:24:39
Exec Total Coverage
Lines: 10 10 100.0%
Functions: 1 1 100.0%
Branches: 2 2 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_push_front
4 ** File description:
5 ** Adds a node at the beginning of a linked list
6 */
7
8 #include "mylist.h"
9
10 8 void my_push_front(linked_list_t **begin, void *data, type_t type)
11 {
12 8 linked_list_t *new = malloc(sizeof(linked_list_t));
13
14 8 new->prev = NULL;
15 8 new->data = data;
16 8 new->type = type;
17 8 new->next = *begin;
18
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 5 times.
8 if (*begin != NULL)
19 3 (*begin)->prev = new;
20 8 *begin = new;
21 8 }
22