GCC Code Coverage Report


Directory: ./
File: tasks/shkryleva_s_vec_min_val/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 20 20 100.0%
Functions: 5 5 100.0%
Branches: 8 10 80.0%

Line Branch Exec Source
1 #include "shkryleva_s_vec_min_val/seq/include/ops_seq.hpp"
2
3 #include <climits>
4 #include <cstddef>
5 #include <vector>
6
7 #include "shkryleva_s_vec_min_val/common/include/common.hpp"
8
9 namespace shkryleva_s_vec_min_val {
10
11
1/2
✓ Branch 1 taken 50 times.
✗ Branch 2 not taken.
50 ShkrylevaSVecMinValSEQ::ShkrylevaSVecMinValSEQ(const InType &in) {
12 SetTypeOfTask(GetStaticTypeOfTask());
13
1/2
✓ Branch 1 taken 50 times.
✗ Branch 2 not taken.
50 GetInput() = in;
14 50 GetOutput() = 0;
15 50 }
16
17 50 bool ShkrylevaSVecMinValSEQ::ValidationImpl() {
18 50 return true;
19 }
20
21 50 bool ShkrylevaSVecMinValSEQ::PreProcessingImpl() {
22 50 GetOutput() = INT_MAX;
23 50 return true;
24 }
25
26
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 42 times.
50 bool ShkrylevaSVecMinValSEQ::RunImpl() {
27
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 42 times.
50 if (GetInput().empty()) {
28 // Для пустого вектора возвращаем INT_MAX (как в MPI версии)
29 8 GetOutput() = INT_MAX;
30 8 return true;
31 }
32
33 42 int min_val = GetInput()[0];
34
2/2
✓ Branch 0 taken 114 times.
✓ Branch 1 taken 42 times.
156 for (size_t i = 1; i < GetInput().size(); i++) {
35 114 if (GetInput()[i] < min_val) { // NOLINT
36 min_val = GetInput()[i];
37 }
38 }
39
40 42 GetOutput() = min_val;
41 42 return true;
42 }
43
44 50 bool ShkrylevaSVecMinValSEQ::PostProcessingImpl() {
45 50 return true;
46 }
47
48 } // namespace shkryleva_s_vec_min_val
49