GCC Code Coverage Report


Directory: ./
File: tasks/shkenev_i_constra_hull_for_binary_image/common/include/common.hpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 3 3 100.0%
Functions: 0 0 -%
Branches: 13 34 38.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 shkenev_i_constra_hull_for_binary_image {
11
12 struct Point {
13 int x{0};
14 int y{0};
15
16 Point() = default;
17
6/12
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 12 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 12 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 12 times.
✗ Branch 17 not taken.
816 Point(int px, int py) : x(px), y(py) {}
18
19 bool operator==(const Point &other) const {
20
4/12
✓ Branch 0 taken 684 times.
✓ Branch 1 taken 156 times.
✓ Branch 2 taken 684 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 168 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
1008 return x == other.x && y == other.y;
21 }
22
23 bool operator!=(const Point &other) const {
24 return !(*this == other);
25 }
26
27 bool operator<(const Point &other) const {
28
3/10
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 48 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 48 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
48 return (x < other.x) || (x == other.x && y < other.y);
29 }
30 };
31
32 struct BinaryImage {
33 int width{0};
34 int height{0};
35 std::vector<uint8_t> pixels;
36 std::vector<std::vector<Point>> components;
37 std::vector<std::vector<Point>> convex_hulls;
38 };
39
40 using InType = BinaryImage;
41 using OutType = BinaryImage;
42 using TestType = std::tuple<int, std::string>;
43 using BaseTask = ppc::task::Task<InType, OutType>;
44
45 } // namespace shkenev_i_constra_hull_for_binary_image
46