GCC Code Coverage Report


Directory: ./
File: tasks/ovsyannikov_n_num_mistm_in_two_str/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 5 5 100.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 #include "ovsyannikov_n_num_mistm_in_two_str/seq/include/ops_seq.hpp"
2
3 #include <cstddef>
4
5 // Clang-Tidy требует явного подключения файла, где определен InType
6 #include "ovsyannikov_n_num_mistm_in_two_str/common/include/common.hpp"
7
8 namespace ovsyannikov_n_num_mistm_in_two_str {
9
10
1/2
✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
80 OvsyannikovNNumMistmInTwoStrSEQ::OvsyannikovNNumMistmInTwoStrSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 80 GetOutput() = 0;
14 80 }
15
16 80 bool OvsyannikovNNumMistmInTwoStrSEQ::ValidationImpl() {
17 80 return GetInput().first.size() == GetInput().second.size();
18 }
19
20 80 bool OvsyannikovNNumMistmInTwoStrSEQ::PreProcessingImpl() {
21 80 GetOutput() = 0;
22 80 return true;
23 }
24
25 80 bool OvsyannikovNNumMistmInTwoStrSEQ::RunImpl() {
26 const auto &seq_one = GetInput().first;
27 const auto &seq_two = GetInput().second;
28 int diff_cnt = 0;
29
30 size_t length = seq_one.size();
31
2/2
✓ Branch 0 taken 376 times.
✓ Branch 1 taken 80 times.
456 for (size_t i = 0; i < length; ++i) {
32
2/2
✓ Branch 0 taken 72 times.
✓ Branch 1 taken 304 times.
376 if (seq_one[i] != seq_two[i]) {
33 72 diff_cnt++;
34 }
35 }
36
37 80 GetOutput() = diff_cnt;
38 80 return true;
39 }
40
41 80 bool OvsyannikovNNumMistmInTwoStrSEQ::PostProcessingImpl() {
42 80 return true;
43 }
44
45 } // namespace ovsyannikov_n_num_mistm_in_two_str
46