GCC Code Coverage Report


Directory: ./
File: lib/my/my_sort_int_array.c
Date: 2024-06-05 00:29:21
Exec Total Coverage
Lines: 12 12 100.0%
Functions: 2 2 100.0%
Branches: 6 6 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_sort_int_array
4 ** File description:
5 ** sorting array
6 */
7
8 #include "my.h"
9
10 10 static void sort_tab(int *array, int temp, int i, int j)
11 {
12
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 7 times.
10 if (array[j] < array[i]) {
13 3 temp = array[i];
14 3 array[i] = array[j];
15 3 array[j] = temp;
16 }
17 10 }
18
19 1 void my_sort_int_array(int *array, int size)
20 {
21 1 int temp = 0;
22
23
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 times.
7 for (int i = 0; i <= size; i++) {
24
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 6 times.
16 for (int j = i + 1; j < size; j++) {
25 10 sort_tab(array, temp, i, j);
26 }
27 }
28 1 }
29