Use a faster random number generator in unit tests
@@ -70,10 +70,7 @@ validate_random_buffer(void *buf, size_t len, unsigned int seed)
u32
generate_random_u32(u32 min, u32 max)
{
- const double r = (double)rand() / (double)RAND_MAX;
- const double tmp = (double)min + r * (double)(max - min);
-
- return (u32)tmp;
+ return (xrand64_tls() % (max - min + 1)) + min;
}
void
