GCC Code Coverage Report


Directory: ./
File: tasks/gasenin_l_image_smooth/common/include/common.hpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 1 1 100.0%
Branches: 12 23 52.2%

Line Branch Exec Source
1 #pragma once
2
3 #include <cstdint>
4 #include <string>
5 #include <tuple>
6 #include <vector>
7
8 #include "task/include/task.hpp"
9
10 namespace gasenin_l_image_smooth {
11
12
5/13
✓ Branch 0 taken 124 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 186 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 62 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 62 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 62 times.
✗ Branch 14 not taken.
552 struct TaskData {
13 std::vector<uint8_t> data;
14 int width = 0;
15 int height = 0;
16 int kernel_size = 0;
17
18 56 bool operator==(const TaskData &other) const {
19
3/6
✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 56 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 56 times.
56 return data == other.data && width == other.width && height == other.height && kernel_size == other.kernel_size;
20 }
21
22 bool operator!=(const TaskData &other) const {
23 return !(*this == other);
24 }
25 };
26
27 using InType = TaskData;
28 using OutType = TaskData;
29 using TestType = std::tuple<int, std::string>;
30 using BaseTask = ppc::task::Task<InType, OutType>;
31
32 inline int Clamp(int val, int min_val, int max_val) {
33
4/4
✓ Branch 0 taken 147860 times.
✓ Branch 1 taken 12465 times.
✓ Branch 2 taken 891496 times.
✓ Branch 3 taken 73143 times.
1124964 if (val < min_val) {
34 return min_val;
35 }
36 1039356 if (val > max_val) {
37 return max_val;
38 }
39 return val;
40 }
41
42 } // namespace gasenin_l_image_smooth
43