GCC Code Coverage Report


Directory: ./
File: tasks/alekseev_a_custom_reduce/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 16 17 94.1%
Functions: 5 5 100.0%
Branches: 5 8 62.5%

Line Branch Exec Source
1 #include "alekseev_a_custom_reduce/seq/include/ops_seq.hpp"
2
3 #include "alekseev_a_custom_reduce/common/include/common.hpp"
4
5 namespace alekseev_a_custom_reduce {
6
7
1/2
✓ Branch 1 taken 166 times.
✗ Branch 2 not taken.
166 AlekseevACustomReduceSEQ::AlekseevACustomReduceSEQ(const InType &in) {
8 SetTypeOfTask(GetStaticTypeOfTask());
9 GetInput() = in;
10 166 GetOutput() = 0.0;
11 166 }
12
13 166 bool AlekseevACustomReduceSEQ::ValidationImpl() {
14 const auto &input = GetInput();
15
16
1/2
✓ Branch 0 taken 166 times.
✗ Branch 1 not taken.
166 if (input.root < 0) {
17 return false;
18 }
19
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 166 times.
166 if (input.data.empty()) {
20 return false;
21 }
22 return true;
23 }
24
25 166 bool AlekseevACustomReduceSEQ::PreProcessingImpl() {
26 166 return true;
27 }
28
29 166 bool AlekseevACustomReduceSEQ::RunImpl() {
30 const auto &input = GetInput().data;
31 double result = 0.0;
32 166 int sz = static_cast<int>(input.size());
33
2/2
✓ Branch 0 taken 1022 times.
✓ Branch 1 taken 166 times.
1188 for (auto i = 0; i < sz; i++) {
34 1022 result += input[i];
35 }
36 166 GetOutput() = result;
37 166 return true;
38 }
39
40 166 bool AlekseevACustomReduceSEQ::PostProcessingImpl() {
41 166 return true;
42 }
43
44 } // namespace alekseev_a_custom_reduce
45