MCPcopy Create free account
hub / github.com/CLIUtils/CLI11 / print_string_comparison

Function print_string_comparison

fuzz/fuzzApp.cpp:161–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void print_string_comparison(const std::string &s1,
162 const std::string &s2,
163 const std::string &prefix,
164 const std::string &s1name,
165 const std::string &s2name) {
166 for(size_t jj = 0; jj < (std::max)(s1.size(), s2.size()); ++jj) {
167 if(jj >= s1.size()) {
168 std::cout << prefix << ":" << s1name << "[" << jj << "] = [empty], " << s2name << "[" << jj
169 << "]=" << static_cast<int>(s2[jj]) << '\n';
170 } else if(jj >= s2.size()) {
171 std::cout << prefix << ":" << s1name << "[" << jj << "]=" << static_cast<int>(s1[jj]) << ", " << s2name
172 << "[" << jj << "]=[empty] \n";
173 } else if(s1[jj] != s2[jj]) {
174 std::cout << "-->" << prefix << ":" << s1name << "[" << jj << "]=" << static_cast<int>(s1[jj]) << ", "
175 << s2name << "[" << jj << "]=" << static_cast<int>(s2[jj]) << '\n';
176 } else {
177 std::cout << prefix << ":" << s1name << "[" << jj << "]=" << static_cast<int>(s1[jj]) << '\n';
178 }
179 }
180}
181
182static constexpr double keydub = 6262542.2622;
183bool FuzzApp::compare(const FuzzApp &other, bool print_error) const {

Callers 1

compareMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected