MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / Compare

Function Compare

src/twtest/codeconvert_t.cpp:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74// x identifies the start of the second string
75// start identifies the original start of the lhs string
76template<class IterT> bool Compare(IterT first, IterT last, IterT x, IterT start)
77{
78 std::pair<IterT, IterT> p = std::mismatch(first, last, x);
79
80 if (p.first != last)
81 {
82 // success !!
83 std::cout << "*** mismatched value at: " << (int)(p.first - start)
84 << ". Values are: " << (size_t)tss::util::char_to_size(*p.first) << " and "
85 << (size_t)tss::util::char_to_size(*p.second) << std::endl;
86
87 return Compare(p.first + 1, last, p.second + 1, start);
88 }
89
90 return true;
91}
92
93void CompareStrings(const std::string& s1, const std::string& s2)
94{

Callers 1

CompareStringsFunction · 0.70

Calls 1

char_to_sizeFunction · 0.85

Tested by

no test coverage detected