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

Function TestSearch

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

Test 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

32// length stored in the StringValue or also reads parts of the string which
33// should be excluded.
34int TestSearch(const char* haystack, const char* needle, int haystack_len = -1,
35 int needle_len = -1) {
36 StringValue needle_str_val = StrValFromCString(needle, needle_len);
37 StringValue haystack_str_val = StrValFromCString(haystack, haystack_len);
38 StringSearch search(&needle_str_val);
39 return search.Search(&haystack_str_val);
40}
41
42// Test reverse string search for haystack/needle, up to len for each.
43// If the length is -1, use the full string length.

Callers 1

TESTFunction · 0.70

Calls 2

StrValFromCStringFunction · 0.85
SearchMethod · 0.45

Tested by

no test coverage detected