Verifies that each 32-bit element is between min and max.
| 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) { |
| 205 | int64_t length = d.length(); |
| 206 | const int32_t* n = reinterpret_cast<const int32_t*>(d.array()->buffers[1]->data()); |
| 207 | for (int64_t i = 0; i < length; i++) { |
| 208 | ASSERT_GE(n[i], min) << "Value must be between " << min << " and " << max << ", got " |
| 209 | << n[i]; |
| 210 | ASSERT_LE(n[i], max) << "Value must be between " << min << " and " << max << ", got " |
| 211 | << n[i]; |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | void VerifyNationKey(const Datum& d) { VerifyAllBetween(d, 0, 24); } |
| 216 |
no test coverage detected