Verifies that each 32-bit element modulo "mod" is between min and max.
| 189 | |
| 190 | // Verifies that each 32-bit element modulo "mod" is between min and max. |
| 191 | void 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. |
| 204 | void VerifyAllBetween(const Datum& d, int32_t min, int32_t max) { |
no test coverage detected