GCC Code Coverage Report


Directory: ./
File: lib/my/my_printf/format_it_str.c
Date: 2024-06-05 00:34:38
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 1 1 100.0%
Branches: 8 8 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_printf
4 ** File description:
5 ** The functions for apply format to a string
6 */
7 /**
8 * @file format_it_str.c
9 * @brief The file containing the format_it_str function
10 * @author Nicolas TORO
11 */
12
13 #include "myprintf.h"
14
15 14 void format_it_str(char *str_finale,
16 formating_t *formating)
17 {
18 14 void (*format[])(char *, formating_t *) =
19 {&format_moins_str, &format_plus_str,
20 &format_esp_str, &format_hash_str, &format_zero_str};
21
22
4/4
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 6 times.
14 if (formating->id_ft == -1 && formating->id_wd != -1)
23 1 format[2](str_finale, formating);
24
2/2
✓ Branch 0 taken 70 times.
✓ Branch 1 taken 14 times.
84 for (int i = 0; i < 5; i++) {
25
2/2
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 63 times.
70 if (formating->id_ft == i)
26 7 format[i](str_finale, formating);
27 }
28 14 return;
29 }
30