GCC Code Coverage Report


Directory: ./
File: tests/test_basic.cpp
Date: 2025-09-29 13:19:55
Exec Total Coverage
Lines: 10 14 71.4%
Functions: 2 2 100.0%
Branches: 6 20 30.0%

Line Branch Exec Source
1 #include <iostream>
2 #include <cassert>
3
4 // Basic test function to verify that basic functionality works
5 1 int test_basic_functionality() {
6 // Test 1: Basic arithmetic
7 1 int result = 2 + 2;
8
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 assert(result == 4);
9
10 // Test 2: String operations
11
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 std::string test_str = "Hello World";
12
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert(test_str.length() == 11);
13
14
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 std::cout << "All basic tests passed!" << std::endl;
15 1 return 0;
16 1 }
17
18 1 int main() {
19 try {
20
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 return test_basic_functionality();
21 } catch (const std::exception& e) {
22 std::cerr << "Test failed with exception: " << e.what() << std::endl;
23 return 1;
24 }
25 }
26