MCPcopy Create free account
hub / github.com/apache/impala / TestRSearch

Function TestRSearch

be/src/runtime/string-search-test.cc:47–53  ·  view source on GitHub ↗

Test reverse string search for haystack/needle, up to len for each. If the length is -1, use the full string length. Searching in a substring allows checking whether the search respects the length stored in the StringValue or also reads parts of the string which should be excluded.

Source from the content-addressed store, hash-verified

45// length stored in the StringValue or also reads parts of the string which
46// should be excluded.
47int TestRSearch(const char* haystack, const char* needle, int haystack_len = -1,
48 int needle_len = -1) {
49 StringValue needle_str_val = StrValFromCString(needle, needle_len);
50 StringValue haystack_str_val = StrValFromCString(haystack, haystack_len);
51 StringSearch search(&needle_str_val);
52 return search.RSearch(&haystack_str_val);
53}
54
55TEST(StringSearchTest, RegularSearch) {
56 // Basic Tests

Callers 1

TESTFunction · 0.85

Calls 2

StrValFromCStringFunction · 0.85
RSearchMethod · 0.80

Tested by

no test coverage detected