summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/random.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx
index 0c6e83edd20a..a70a73e3584b 100644
--- a/comphelper/source/misc/random.cxx
+++ b/comphelper/source/misc/random.cxx
@@ -39,6 +39,13 @@ struct RandomNumberGenerator
STD_RNG_ALGO global_rng;
RandomNumberGenerator()
{
+ bool bRepeatable = (getenv("SAL_RAND_REPEATABLE") != 0);
+ if (bRepeatable)
+ {
+ global_rng.seed(42);
+ return;
+ }
+
try
{
std::random_device rd;