| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "yurkin_counting_number/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cctype> | ||
| 4 | #include <cstddef> | ||
| 5 | |||
| 6 | #include "yurkin_counting_number/common/include/common.hpp" | ||
| 7 | |||
| 8 | namespace yurkin_counting_number { | ||
| 9 | |||
| 10 |
1/2✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
|
64 | YurkinCountingNumberSEQ::YurkinCountingNumberSEQ(const InType &in) { |
| 11 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 12 |
1/2✓ Branch 1 taken 64 times.
✗ Branch 2 not taken.
|
64 | GetInput() = in; |
| 13 | 64 | GetOutput() = 0; | |
| 14 | 64 | } | |
| 15 | |||
| 16 | 64 | bool YurkinCountingNumberSEQ::ValidationImpl() { | |
| 17 | 64 | return GetOutput() == 0; | |
| 18 | } | ||
| 19 | |||
| 20 | 64 | bool YurkinCountingNumberSEQ::PreProcessingImpl() { | |
| 21 | 64 | GetOutput() = 0; | |
| 22 | 64 | return true; | |
| 23 | } | ||
| 24 | |||
| 25 | 64 | bool YurkinCountingNumberSEQ::RunImpl() { | |
| 26 | const InType &input = GetInput(); | ||
| 27 | std::size_t total_size = input.size(); | ||
| 28 | |||
| 29 | int local_count = 0; | ||
| 30 |
2/2✓ Branch 0 taken 936 times.
✓ Branch 1 taken 64 times.
|
1000 | for (std::size_t i = 0; i < total_size; ++i) { |
| 31 |
2/2✓ Branch 0 taken 640 times.
✓ Branch 1 taken 296 times.
|
936 | if (std::isalpha(static_cast<unsigned char>(input[i])) != 0) { |
| 32 | 640 | ++local_count; | |
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 36 | 64 | GetOutput() = local_count; | |
| 37 | 64 | return true; | |
| 38 | } | ||
| 39 | |||
| 40 | 64 | bool YurkinCountingNumberSEQ::PostProcessingImpl() { | |
| 41 | 64 | return GetOutput() >= 0; | |
| 42 | } | ||
| 43 | |||
| 44 | } // namespace yurkin_counting_number | ||
| 45 |