GCC Code Coverage Report


Directory: ./
File: lib/my/flags/specifier_int.c
Date: 2024-06-05 00:29:21
Exec Total Coverage
Lines: 13 13 100.0%
Functions: 5 5 100.0%
Branches: 2 2 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** specifier int
4 ** File description:
5 ** specifier int
6 */
7
8 #include "my.h"
9 #include "myformats.h"
10
11 5 static char *select_long_long(size_t temp)
12 {
13 5 return my_str_nbr_long_long(temp);
14 }
15
16 1 static char *select_short(size_t temp)
17 {
18 1 return my_str_nbr_short((short int)temp);
19 }
20
21 1 static char *select_short_short(size_t temp)
22 {
23 1 return my_str_nbr_short_short((signed char)temp);
24 }
25
26 1 static char *select_size_t(size_t temp)
27 {
28 1 return my_str_nbr_size_t(temp);
29 }
30
31 39 char *specify_it_int(formating_t *formating, size_t temp)
32 {
33 39 char *(*specify[])(size_t) = {&select_long_long, &select_long_long,
34 &select_short, &select_short_short, &select_size_t,
35 &select_size_t, &select_size_t, &select_size_t};
36
37
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 31 times.
39 if (formating->id_sp != -1) {
38 8 return specify[formating->id_sp](temp);
39 } else {
40 31 return my_str_nbr(temp);
41 }
42 }
43