GCC Code Coverage Report


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

Line Branch Exec Source
1 #include "afanasyev_a_elem_vec_avg/seq/include/ops_seq.hpp"
2
3 #include <cstdint>
4 #include <numeric>
5 #include <vector>
6
7 #include "afanasyev_a_elem_vec_avg/common/include/common.hpp"
8
9 namespace afanasyev_a_elem_vec_avg {
10
11
1/2
✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
40 AfanasyevAElemVecAvgSEQ::AfanasyevAElemVecAvgSEQ(const InType &in) {
12 SetTypeOfTask(GetStaticTypeOfTask());
13
1/2
✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
40 GetInput() = in;
14 40 GetOutput() = 0.0;
15 40 }
16
17 40 bool AfanasyevAElemVecAvgSEQ::ValidationImpl() {
18 40 return true;
19 }
20
21 40 bool AfanasyevAElemVecAvgSEQ::PreProcessingImpl() {
22 40 return true;
23 }
24
25
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 32 times.
40 bool AfanasyevAElemVecAvgSEQ::RunImpl() {
26 const InType &vec = GetInput();
27 40 int n = static_cast<int>(vec.size());
28
29
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 32 times.
40 if (n == 0) {
30 8 GetOutput() = 0.0;
31 8 return true;
32 }
33
34 int64_t sum = std::accumulate(vec.begin(), vec.end(), static_cast<int64_t>(0));
35
36 32 GetOutput() = static_cast<OutType>(sum) / static_cast<double>(n);
37
38 32 return true;
39 }
40
41 40 bool AfanasyevAElemVecAvgSEQ::PostProcessingImpl() {
42 40 return true;
43 }
44
45 } // namespace afanasyev_a_elem_vec_avg
46