GCC Code Coverage Report


Directory: ./
File: tasks/belov_e_shell_batcher/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 5 5 100.0%
Branches: 11 14 78.6%

Line Branch Exec Source
1 #include "belov_e_shell_batcher/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4 #include <vector>
5
6 #include "belov_e_shell_batcher/common/include/common.hpp"
7
8 namespace belov_e_shell_batcher {
9
10
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 BelovEShellBatcherSEQ::BelovEShellBatcherSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 GetInput() = in;
13 24 }
14
15 24 bool BelovEShellBatcherSEQ::ValidationImpl() {
16 24 return !GetInput().empty();
17 }
18
19 24 bool BelovEShellBatcherSEQ::PreProcessingImpl() {
20 24 return true;
21 }
22
23 24 bool BelovEShellBatcherSEQ::RunImpl() {
24 24 std::vector<int> data = GetInput();
25 size_t n = data.size();
26
27
2/2
✓ Branch 0 taken 200 times.
✓ Branch 1 taken 24 times.
224 for (size_t gap = n / 2; gap > 0; gap /= 2) {
28
2/2
✓ Branch 0 taken 144000576 times.
✓ Branch 1 taken 200 times.
144000776 for (size_t i = gap; i < n; i++) {
29 144000576 int temp = data[i];
30 size_t j = i;
31
32
4/4
✓ Branch 0 taken 210860976 times.
✓ Branch 1 taken 8000016 times.
✓ Branch 2 taken 74860416 times.
✓ Branch 3 taken 136000560 times.
218860992 while (j >= gap && data[j - gap] > temp) {
33 74860416 data[j] = data[j - gap];
34 j -= gap;
35 }
36
37 144000576 data[j] = temp;
38 }
39 }
40
41
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 GetOutput() = data;
42 24 return true;
43 }
44
45 24 bool BelovEShellBatcherSEQ::PostProcessingImpl() {
46 24 return true;
47 }
48
49 } // namespace belov_e_shell_batcher
50