GCC Code Coverage Report


Directory: ./
File: tasks/ermakov_a_numb_viol_elem_vec/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: 10 12 83.3%

Line Branch Exec Source
1 #include "ermakov_a_numb_viol_elem_vec/seq/include/ops_seq.hpp"
2
3 #include <vector>
4
5 #include "ermakov_a_numb_viol_elem_vec/common/include/common.hpp"
6
7 namespace ermakov_a_numb_viol_elem_vec {
8
9
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 ErmakovANumbViolElemVecSEQ::ErmakovANumbViolElemVecSEQ(const InType &in) {
10 SetTypeOfTask(GetStaticTypeOfTask());
11
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 GetInput() = in;
12 72 GetOutput() = 0;
13 72 }
14
15 72 auto ErmakovANumbViolElemVecSEQ::ValidationImpl() -> bool {
16 72 return true;
17 }
18
19 72 auto ErmakovANumbViolElemVecSEQ::PreProcessingImpl() -> bool {
20 72 return true;
21 }
22
23
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 64 times.
72 auto ErmakovANumbViolElemVecSEQ::RunImpl() -> bool {
24 const auto &vec = GetInput();
25 72 const int n = static_cast<int>(vec.size());
26
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 64 times.
72 if (n <= 0) {
27 8 GetOutput() = 0;
28 8 return true;
29 }
30
31 int viol = 0;
32
2/2
✓ Branch 0 taken 312 times.
✓ Branch 1 taken 64 times.
376 for (int i = 0; i + 1 < n; ++i) {
33
2/2
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 168 times.
312 if (vec[i] > vec[i + 1]) {
34 144 ++viol;
35 }
36 }
37
38 64 GetOutput() = viol;
39 64 return true;
40 }
41
42 72 auto ErmakovANumbViolElemVecSEQ::PostProcessingImpl() -> bool {
43 72 return true;
44 }
45
46 } // namespace ermakov_a_numb_viol_elem_vec
47