MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / IsSubstringImpl

Function IsSubstringImpl

rtpose_wrapper/src/gtest/gtest-all.cpp:2560–2575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2558// or ::std::wstring.
2559template <typename StringType>
2560AssertionResult IsSubstringImpl(
2561 bool expected_to_be_substring,
2562 const char* needle_expr, const char* haystack_expr,
2563 const StringType& needle, const StringType& haystack) {
2564 if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
2565 return AssertionSuccess();
2566
2567 const bool is_wide_string = sizeof(needle[0]) > 1;
2568 const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
2569 return AssertionFailure()
2570 << "Value of: " << needle_expr << "\n"
2571 << " Actual: " << begin_string_quote << needle << "\"\n"
2572 << "Expected: " << (expected_to_be_substring ? "" : "not ")
2573 << "a substring of " << haystack_expr << "\n"
2574 << "Which is: " << begin_string_quote << haystack << "\"";
2575}
2576
2577} // namespace
2578

Callers 2

IsSubstringFunction · 0.85
IsNotSubstringFunction · 0.85

Calls 3

IsSubstringPredFunction · 0.85
AssertionSuccessFunction · 0.85
AssertionFailureFunction · 0.85

Tested by

no test coverage detected