Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_str_islower | ||
4 | ** File description: | ||
5 | ** return 1 if str is only upper cases | ||
6 | */ | ||
7 | |||
8 | #include "my.h" | ||
9 | |||
10 | 5 | int my_str_isupper(char const *str) | |
11 | { | ||
12 | 5 | int isalpha = 0; | |
13 | |||
14 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
|
5 | if (my_strlen(str) == 0) |
15 | 1 | return 1; | |
16 | 4 | isalpha = my_str_isalpha(str); | |
17 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
|
8 | for (int i = 0; i < my_strlen(str); i++) { |
18 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 6 times.
|
7 | if (isalpha == 0) |
19 | 1 | return 0; | |
20 |
3/4✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 4 times.
|
6 | if (str[i] < 'A' || str[i] > 'Z') |
21 | 2 | return 0; | |
22 | } | ||
23 | 1 | return 1; | |
24 | } | ||
25 |