summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-09-01 10:58:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-01 20:42:40 +0200
commite25ba7dc57229d1cb9794abd1ca23c0d87ebecb3 (patch)
tree8c95e0c81e003410526cb4ad8357eab3a2db0f44 /vcl/win
parent86576cef2c77c8dc78e374aadaadf018610ed6f4 (diff)
use a dummy clipboard when running unit tests
so the multiple unit tests don't stomp on each other. This fixes a couple of things in my earlier attempt (*) actually set the env variable on Windows (*) don't use a global variable to test the env var, because that variable might be initialised BEFORE the env var is actually set Change-Id: Id43a1dd2fbd324691e0b6578c9026b8a523012e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/dtrans/WinClipboard.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/win/dtrans/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx
index a2ecb7427d44..39094d9e5e0f 100644
--- a/vcl/win/dtrans/WinClipboard.cxx
+++ b/vcl/win/dtrans/WinClipboard.cxx
@@ -328,13 +328,13 @@ uno::Sequence<OUString> SAL_CALL CWinClipboard::getSupportedServiceNames()
}
// We run unit tests in parallel, which is a problem when touching a shared resource
-// the system clipboard, so rather use the dummy GenericClipboard.
-const bool bRunningUnitTest = getenv("LO_TESTNAME");
-
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
dtrans_CWinClipboard_get_implementation(css::uno::XComponentContext* context,
css::uno::Sequence<css::uno::Any> const& args)
{
+ // the system clipboard, so rather use the dummy GenericClipboard.
+ static const bool bRunningUnitTest = getenv("LO_TESTNAME");
+
if (bRunningUnitTest)
{
SolarMutexGuard aGuard;