GCC Code Coverage Report


Directory: ./
File: tasks/shkrebko_m_count_char_freq/seq/src/ops_seq.cpp
Date: 2025-12-13 04:24:21
Exec Total Coverage
Lines: 13 13 100.0%
Functions: 5 5 100.0%
Branches: 4 8 50.0%

Line Branch Exec Source
1 #include "shkrebko_m_count_char_freq/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <string>
5
6 #include "shkrebko_m_count_char_freq/common/include/common.hpp"
7
8 namespace shkrebko_m_count_char_freq {
9
10
1/2
✓ Branch 1 taken 32 times.
✗ Branch 2 not taken.
32 ShkrebkoMCountCharFreqSEQ::ShkrebkoMCountCharFreqSEQ(const InType &in) {
11 SetTypeOfTask(GetStaticTypeOfTask());
12 GetInput() = in;
13 32 GetOutput() = 0;
14 32 }
15
16
1/2
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
32 bool ShkrebkoMCountCharFreqSEQ::ValidationImpl() {
17
2/4
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 32 times.
32 return (!std::get<0>(GetInput()).empty()) && (std::get<1>(GetInput()).length() == 1);
18 }
19
20 32 bool ShkrebkoMCountCharFreqSEQ::PreProcessingImpl() {
21 32 return true;
22 }
23
24 32 bool ShkrebkoMCountCharFreqSEQ::RunImpl() {
25 std::string str = std::get<0>(GetInput());
26 std::string symbol_str = std::get<1>(GetInput());
27 32 char symbol = symbol_str[0];
28 auto result = std::count(str.begin(), str.end(), symbol);
29 32 GetOutput() = static_cast<int>(result);
30 32 return true;
31 }
32
33 32 bool ShkrebkoMCountCharFreqSEQ::PostProcessingImpl() {
34 32 return true;
35 }
36
37 } // namespace shkrebko_m_count_char_freq
38