From ed3ccdbde9ace7d2e3d67a9cc83a189cfaf1cad9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 4 Aug 2020 21:05:54 +0200 Subject: 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 --- sw/qa/core/uwriter.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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 #include +#include #include #include @@ -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, -- cgit