| 98 | } |
| 99 | |
| 100 | void TestImpalaNonNullTerminated(int batch_size, void* d) { |
| 101 | TestData* data = reinterpret_cast<TestData*>(d); |
| 102 | for (int i = 0; i < batch_size; ++i) { |
| 103 | data->matches = 0; |
| 104 | for (int n = 0; n < data->needles.size(); ++n) { |
| 105 | // Exercise the non null-terminated path. |
| 106 | StringSearchSSE needle(&(data->needles[n])); |
| 107 | for (int iters = 0; iters < 10; ++iters) { |
| 108 | for (int h = 0; h < data->haystacks.size(); ++h) { |
| 109 | if (needle.Search(data->haystacks[h]) != -1) { |
| 110 | ++data->matches; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // This should be tailored to represent the data we expect. |
| 119 | // Some algos are better suited for longer vs shorter needles, finding the string vs. |