mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +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
|
@ -1,10 +1,10 @@
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
^)kHV32-J_
|
1K@_(-PQ7S
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
(s[Q8J4Pu4
|
PS17T[f6s\
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
+3iDbOB}kq
|
39P|JR@F_C
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
tz9dFehHz)
|
#iHW2{G_22
|
||||||
Input::EVENT_NEW
|
Input::EVENT_NEW
|
||||||
d&@3g)NljG
|
#Ykb&UeAwg
|
||||||
|
|
|
@ -45,7 +45,10 @@ string Foo::RandomString(const int len)
|
||||||
"abcdefghijklmnopqrstuvwxyz";
|
"abcdefghijklmnopqrstuvwxyz";
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i)
|
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;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue