MCPcopy Create free account
hub / github.com/apache/arrow / VerifyModuloBetween

Function VerifyModuloBetween

cpp/src/arrow/acero/tpch_node_test.cc:191–201  ·  view source on GitHub ↗

Verifies that each 32-bit element modulo "mod" is between min and max.

Source from the content-addressed store, hash-verified

189
190// Verifies that each 32-bit element modulo "mod" is between min and max.
191void VerifyModuloBetween(const Datum& d, int32_t min, int32_t max, int32_t mod) {
192 int64_t length = d.length();
193 const int32_t* n = reinterpret_cast<const int32_t*>(d.array()->buffers[1]->data());
194 for (int64_t i = 0; i < length; i++) {
195 int32_t m = n[i] % mod;
196 ASSERT_GE(m, min) << "Value must be between " << min << " and " << max << " mod "
197 << mod << ", " << n[i] << " % " << mod << " = " << m;
198 ASSERT_LE(m, max) << "Value must be between " << min << " and " << max << " mod "
199 << mod << ", " << n[i] << " % " << mod << " = " << m;
200 }
201}
202
203// Verifies that each 32-bit element is between min and max.
204void VerifyAllBetween(const Datum& d, int32_t min, int32_t max) {

Callers 1

VerifyOrdersFunction · 0.85

Calls 3

lengthMethod · 0.45
dataMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected