mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Use the deterministic bro_random in a test, instead of os random().
The previous test stopped working on FreeBSD 11.0, and I am actually not quite sure why this ever worked as stable as it did.
This commit is contained in:
parent
544317fc1e
commit
26d9517774
2 changed files with 9 additions and 6 deletions
|
@ -45,7 +45,10 @@ string Foo::RandomString(const int len)
|
|||
"abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
for (int i = 0; i < len; ++i)
|
||||
s[i] = values[random() / (RAND_MAX / sizeof(values))];
|
||||
// bro_random is not thread-safe; as we are only using one simultaneous thread
|
||||
// here, this should not matter in this case. If this test ever starts showing
|
||||
// random errors, this might be the culprit.
|
||||
s[i] = values[bro_random() / (RAND_MAX / sizeof(values))];
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue