MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / IsSubstringImpl

Function IsSubstringImpl

tests/external/gmock-1.7.0/gtest/src/gtest.cc:1260–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1258// or ::std::wstring.
1259template <typename StringType>
1260AssertionResult IsSubstringImpl(
1261 bool expected_to_be_substring,
1262 const char* needle_expr, const char* haystack_expr,
1263 const StringType& needle, const StringType& haystack) {
1264 if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
1265 return AssertionSuccess();
1266
1267 const bool is_wide_string = sizeof(needle[0]) > 1;
1268 const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
1269 return AssertionFailure()
1270 << "Value of: " << needle_expr << "\n"
1271 << " Actual: " << begin_string_quote << needle << "\"\n"
1272 << "Expected: " << (expected_to_be_substring ? "" : "not ")
1273 << "a substring of " << haystack_expr << "\n"
1274 << "Which is: " << begin_string_quote << haystack << "\"";
1275}
1276
1277} // namespace
1278

Callers 2

IsSubstringFunction · 0.70
IsNotSubstringFunction · 0.70

Calls 3

IsSubstringPredFunction · 0.70
AssertionSuccessFunction · 0.70
AssertionFailureFunction · 0.70

Tested by

no test coverage detected