GCC Code Coverage Report


Directory: src/
File: test_lib_c/test.cpp
Date: 2024-12-30 15:39:09
Exec Total Coverage
Lines: 10 11 90.9%
Functions: 1 1 100.0%
Branches: 6 12 50.0%

Line Branch Exec Source
1 #include "c_wrapper.h"
2 #include <cstdlib>
3 #include <string>
4 #include <vector>
5
6 1 int main()
7 {
8
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 const std::string input{"this is the headline"};
9
10 1 std::vector<char> data;
11
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 data.assign(input.begin(), input.end());
12
13
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 text_conversion_c(data.data(), data.size());
14
15
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 const std::string result(data.begin(), data.end());
16
17
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 const std::string expected{"This Is the Headline"};
18
19
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (expected == result)
20 1 return EXIT_SUCCESS;
21
22 return EXIT_FAILURE;
23 1 }
24