GCC Code Coverage Report


Directory: ./
File: foo.c
Date: 2024-10-11 07:43:04
Exec Total Coverage
Lines: 6 7 85.7%
Functions: 1 1 100.0%
Branches: 3 4 75.0%

Line Branch Exec Source
1 #include <stdio.h>
2
3 2 void foo(int num) {
4
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (num == 1) {
5 1 printf("when num is equal to 1...\n");
6
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 } else if (num == 2) {
7 1 printf("when num is equal to 2...\n");
8 } else {
9 printf("when num is equal to %d...\n", num);
10 }
11 2 }
12