| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "sakharov_a_num_of_letters/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cctype> | ||
| 4 | #include <string> | ||
| 5 | #include <utility> | ||
| 6 | |||
| 7 | #include "sakharov_a_num_of_letters/common/include/common.hpp" | ||
| 8 | |||
| 9 | namespace sakharov_a_num_of_letters { | ||
| 10 | |||
| 11 |
1/2✓ Branch 1 taken 42 times.
✗ Branch 2 not taken.
|
42 | SakharovANumberOfLettersSEQ::SakharovANumberOfLettersSEQ(const InType &in) { |
| 12 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 13 | GetInput() = in; | ||
| 14 | 42 | GetOutput() = 0; | |
| 15 | 42 | } | |
| 16 | |||
| 17 | 42 | bool SakharovANumberOfLettersSEQ::ValidationImpl() { | |
| 18 |
1/2✓ Branch 0 taken 42 times.
✗ Branch 1 not taken.
|
42 | return std::cmp_equal(std::get<1>(GetInput()).size(), std::get<0>(GetInput())); |
| 19 | } | ||
| 20 | |||
| 21 | 42 | bool SakharovANumberOfLettersSEQ::PreProcessingImpl() { | |
| 22 | 42 | GetOutput() = 0; | |
| 23 | 42 | return true; | |
| 24 | } | ||
| 25 | |||
| 26 | 42 | bool SakharovANumberOfLettersSEQ::RunImpl() { | |
| 27 | const std::string &string_of_letters = std::get<1>(GetInput()); | ||
| 28 | int number_of_letter = 0; | ||
| 29 |
2/2✓ Branch 0 taken 208 times.
✓ Branch 1 taken 42 times.
|
250 | for (char c : string_of_letters) { |
| 30 |
2/2✓ Branch 0 taken 96 times.
✓ Branch 1 taken 112 times.
|
208 | if (std::isalpha(static_cast<unsigned char>(c)) != 0) { |
| 31 | 96 | number_of_letter++; | |
| 32 | } | ||
| 33 | } | ||
| 34 | 42 | GetOutput() = number_of_letter; | |
| 35 | 42 | return true; | |
| 36 | } | ||
| 37 | |||
| 38 | 42 | bool SakharovANumberOfLettersSEQ::PostProcessingImpl() { | |
| 39 | 42 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | } // namespace sakharov_a_num_of_letters | ||
| 43 |