GCC Code Coverage Report


Directory: ./
File: lib/my/my_str_is.c
Date: 2024-06-05 00:36:48
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 1 1 100.0%
Branches: 4 4 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** my_str_is
4 ** File description:
5 ** Returns 1 if the string (str) is composed of characters
6 ** in the characters list (char_list) or 0 if not
7 */
8 /**
9 * @file my_str_is.c
10 * @brief The file containing the my_str_is function
11 * @author Nicolas TORO
12 */
13
14 #include "my.h"
15
16 221 int my_str_is(char *str, const char *char_list)
17 {
18
2/2
✓ Branch 0 taken 349 times.
✓ Branch 1 taken 7 times.
356 for (int i = 0; str[i]; i++)
19
2/2
✓ Branch 1 taken 214 times.
✓ Branch 2 taken 135 times.
349 if (!my_char_is(str[i], char_list))
20 214 return 0;
21 7 return 1;
22 }
23