summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-08-04 21:05:54 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-05 10:45:08 +0200
commited3ccdbde9ace7d2e3d67a9cc83a189cfaf1cad9 (patch)
treeb1f344beb69e85dd6f2762fdb5ef60b3a57c43c8
parent8324dfb50b1762a8a5b941da9d62bf6bab683364 (diff)
CppunitTest_sw_uwriter: make rng used in this test repeatable
So in case the test fails, it's possible to see the same failure multiple times. Change-Id: Ic573807967b004bb7650ffb3614f5006db34080e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100137 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/qa/core/uwriter.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 079f7e311245..a2b5e99e079b 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -43,6 +43,7 @@
#include <sfx2/docfile.hxx>
#include <xmloff/odffields.hxx>
+#include <osl/process.h>
#include <breakit.hxx>
#include <doc.hxx>
@@ -1075,6 +1076,10 @@ getRandomPosition(SwDoc *pDoc, int /* nOffset */)
void SwDocTest::randomTest()
{
+ OUString aEnvKey("SAL_RAND_REPEATABLE");
+ OUString aEnvValue("1");
+ osl_setEnvironment(aEnvKey.pData, aEnvValue.pData);
+
CPPUNIT_ASSERT_MESSAGE("SwDoc::IsRedlineOn()", !m_pDoc->getIDocumentRedlineAccess().IsRedlineOn());
RedlineFlags modes[] = {
RedlineFlags::On,