| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "sizov_d_string_mismatch_count/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <string> | ||
| 5 | |||
| 6 | #include "sizov_d_string_mismatch_count/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace sizov_d_string_mismatch_count { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 80 times.
✗ Branch 2 not taken.
|
80 | SizovDStringMismatchCountSEQ::SizovDStringMismatchCountSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 | GetInput() = in; | ||
| 13 | 80 | GetOutput() = 0; | |
| 14 | 80 | } | |
| 15 | |||
| 16 |
1/2✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
|
80 | bool SizovDStringMismatchCountSEQ::ValidationImpl() { |
| 17 | const auto &[a, b] = GetInput(); | ||
| 18 |
2/4✓ Branch 0 taken 80 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 80 times.
|
80 | return !a.empty() && (a.size() == b.size()); |
| 19 | } | ||
| 20 | |||
| 21 | 80 | bool SizovDStringMismatchCountSEQ::PreProcessingImpl() { | |
| 22 | const auto &[a, b] = GetInput(); | ||
| 23 | 80 | str_a_ = a; | |
| 24 | 80 | str_b_ = b; | |
| 25 | 80 | return true; | |
| 26 | } | ||
| 27 | |||
| 28 | 80 | bool SizovDStringMismatchCountSEQ::RunImpl() { | |
| 29 | 80 | result_ = 0; | |
| 30 | const std::size_t n = str_a_.size(); | ||
| 31 |
2/2✓ Branch 0 taken 736 times.
✓ Branch 1 taken 80 times.
|
816 | for (std::size_t i = 0; i < n; ++i) { |
| 32 |
2/2✓ Branch 0 taken 264 times.
✓ Branch 1 taken 472 times.
|
736 | if (str_a_[i] != str_b_[i]) { |
| 33 | 264 | ++result_; | |
| 34 | } | ||
| 35 | } | ||
| 36 | 80 | return true; | |
| 37 | } | ||
| 38 | |||
| 39 | 80 | bool SizovDStringMismatchCountSEQ::PostProcessingImpl() { | |
| 40 | 80 | GetOutput() = result_; | |
| 41 | 80 | return true; | |
| 42 | } | ||
| 43 | |||
| 44 | } // namespace sizov_d_string_mismatch_count | ||
| 45 |