GCC Code Coverage Report


Directory: ./
File: tasks/badanov_a_max_vec_elem/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 17 19 89.5%
Functions: 5 5 100.0%
Branches: 6 10 60.0%

Line Branch Exec Source
1 #include "badanov_a_max_vec_elem/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <climits>
5 #include <cstddef>
6 #include <vector>
7
8 #include "badanov_a_max_vec_elem/common/include/common.hpp"
9
10 namespace badanov_a_max_vec_elem {
11
12
1/2
✓ Branch 1 taken 192 times.
✗ Branch 2 not taken.
192 BadanovAMaxVecElemSEQ::BadanovAMaxVecElemSEQ(const InType &in) {
13 SetTypeOfTask(GetStaticTypeOfTask());
14
1/2
✓ Branch 1 taken 192 times.
✗ Branch 2 not taken.
192 GetInput() = in;
15 192 GetOutput() = 0;
16 192 }
17
18 192 bool BadanovAMaxVecElemSEQ::ValidationImpl() {
19 192 return true;
20 }
21
22 192 bool BadanovAMaxVecElemSEQ::PreProcessingImpl() {
23 192 return true;
24 }
25
26
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 192 times.
192 bool BadanovAMaxVecElemSEQ::RunImpl() {
27
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 192 times.
192 if (GetInput().empty()) {
28 GetOutput() = INT_MIN;
29 return true;
30 }
31
32 192 int max_elem = GetInput()[0];
33
2/2
✓ Branch 0 taken 16704 times.
✓ Branch 1 taken 192 times.
16896 for (size_t i = 1; i < GetInput().size(); i++) {
34 16704 max_elem = std::max(GetInput()[i], max_elem);
35 }
36
37 192 GetOutput() = max_elem;
38 192 return true;
39 }
40
41 192 bool BadanovAMaxVecElemSEQ::PostProcessingImpl() {
42 192 return true;
43 }
44
45 } // namespace badanov_a_max_vec_elem
46