GCC Code Coverage Report


Directory: ./
File: tasks/maslova_u_char_frequency_count/seq/src/ops_seq.cpp
Date: 2025-12-13 04:24:21
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 5 5 100.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 #include "maslova_u_char_frequency_count/seq/include/ops_seq.hpp"
2
3 #include <climits>
4 #include <cstddef>
5 #include <string>
6
7 #include "maslova_u_char_frequency_count/common/include/common.hpp"
8
9 namespace maslova_u_char_frequency_count {
10
11
1/2
✓ Branch 1 taken 108 times.
✗ Branch 2 not taken.
108 MaslovaUCharFrequencyCountSEQ::MaslovaUCharFrequencyCountSEQ(const InType &in) {
12 SetTypeOfTask(GetStaticTypeOfTask());
13 GetInput() = in;
14 108 GetOutput() = 0;
15 108 }
16
17 108 bool MaslovaUCharFrequencyCountSEQ::ValidationImpl() {
18 108 return GetInput().first.size() <= static_cast<size_t>(INT_MAX);
19 }
20
21 108 bool MaslovaUCharFrequencyCountSEQ::PreProcessingImpl() {
22 108 return true;
23 }
24
25 108 bool MaslovaUCharFrequencyCountSEQ::RunImpl() {
26 std::string &input_string = GetInput().first;
27 108 char input_char = GetInput().second; // получили данные
28 size_t frequency_count = 0;
29
30
2/2
✓ Branch 0 taken 2096 times.
✓ Branch 1 taken 108 times.
2204 for (const char c : input_string) {
31
2/2
✓ Branch 0 taken 984 times.
✓ Branch 1 taken 1112 times.
2096 if (c == input_char) {
32 984 frequency_count++;
33 }
34 }
35
36 108 GetOutput() = frequency_count; // отправили данные
37 108 return true;
38 }
39
40 108 bool MaslovaUCharFrequencyCountSEQ::PostProcessingImpl() {
41 108 return true;
42 }
43
44 } // namespace maslova_u_char_frequency_count
45