GCC Code Coverage Report


Directory: ./
File: tasks/shkrebko_m_hypercube/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 24 26 92.3%
Functions: 5 5 100.0%
Branches: 11 18 61.1%

Line Branch Exec Source
1 #include "shkrebko_m_hypercube/seq/include/ops_seq.hpp"
2
3 #include <cmath>
4 #include <vector>
5
6 #include "shkrebko_m_hypercube/common/include/common.hpp"
7
8 namespace shkrebko_m_hypercube {
9
10
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 ShkrebkoMHypercubeSEQ::ShkrebkoMHypercubeSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12
1/2
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
24 GetInput() = in;
13 24 GetOutput() = HypercubeData();
14 24 }
15
16
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 bool ShkrebkoMHypercubeSEQ::ValidationImpl() {
17
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (GetInput().size() < 2) {
18 return false;
19 }
20
21
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (GetInput()[0] <= 0) {
22 return false;
23 }
24
25 24 int destination = GetInput()[1];
26 24 return destination >= 0;
27 }
28
29
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 bool ShkrebkoMHypercubeSEQ::PreProcessingImpl() {
30
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (GetInput().size() >= 2) {
31 24 GetOutput().value = GetInput()[0];
32 24 GetOutput().destination = GetInput()[1];
33 } else {
34 GetOutput().value = GetInput()[0];
35 GetOutput().destination = 0;
36 }
37 24 return true;
38 }
39
40 24 bool ShkrebkoMHypercubeSEQ::RunImpl() {
41
2/2
✓ Branch 0 taken 120000 times.
✓ Branch 1 taken 24 times.
120024 for (int i = 0; i < 5000; i++) {
42 120000 volatile int dummy = 0;
43
2/2
✓ Branch 0 taken 600000000 times.
✓ Branch 1 taken 120000 times.
600120000 for (int j = 0; j < 5000; j++) {
44 600000000 dummy += i * j;
45 }
46 }
47 24 GetOutput().path.push_back(0);
48 24 GetOutput().finish = true;
49 24 return true;
50 }
51
52 24 bool ShkrebkoMHypercubeSEQ::PostProcessingImpl() {
53 24 return GetOutput().value > 0;
54 }
55
56 } // namespace shkrebko_m_hypercube
57