On 02/12/2021 12.53, Alex Bennée wrote:
It's often useful to introduce some sort of random variation when testing several racing CPU conditions. Instead of each test implementing some half-arsed PRNG bring in a a decent one which has good statistical randomness. Obviously it is deterministic for a given seed value which is likely the behaviour you want.I've pulled in the ISAAC library from CCAN: http://ccodearchive.net/info/isaac.html I shaved off the float related stuff which is less useful for unit testing and re-indented to fit the style. The original license was CC0 (Public Domain) which is compatible with the LGPL v2 of kvm-unit-tests. Signed-off-by: Alex Bennée <[email protected]> CC: Timothy B. Terriberry <[email protected]> Acked-by: Andrew Jones <[email protected]> Message-Id: <[email protected]> --- arm/Makefile.common | 1 + lib/prng.h | 82 ++++++++++++++++++++++ lib/prng.c | 162 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 lib/prng.h create mode 100644 lib/prng.c
Acked-by: Thomas Huth <[email protected]> _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
