summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-07-06 17:26:26 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-07-06 23:29:04 +0200
commit77fca616e0bd79e0b405fd0b3543cf8e94e15df3 (patch)
tree6e756202c532b45a419f9522a6ae182724879efc
parent06c552cf45a01bca6eff68033c59308c41dd79e8 (diff)
Don't modify configuration / Windows registry in CppunitTest_sw_a11y
After commit 889c12e98e04edb4bc25b86bf16b8cf1d9b68420 (tdf#155794 vcl: handle WM_GETOBJECT without SolarMutex, 2023-06-13), running CppunitTest_sw_a11y resulted in a failed assertion in VCL cleanup on some Windows systems: Assertion failed: !IsModified(), file C:/lo/src/core/vcl/source/gdi/configsettings.cxx, line 56 abort() has been calledwarn:sal.cppunittester:16572:26632:sal/cppunittester/cppunittester.cxx:598: CAUGHT SIGABRT: 25: sal::backtrace_get - 0x7fffcca3162a 24: AbortSignalHandler - 0x7ff7ee9eaf4f 23: raise - 0x7fffc37c90ed 22: abort - 0x7fffc37cae49 21: get_wide_winmain_command_line - 0x7fffc37d0c6f 20: get_wide_winmain_command_line - 0x7fffc37cebc8 19: wassert - 0x7fffc37d18af 18: vcl::SettingsConfigItem::~SettingsConfigItem - 0x7fff2bbfd3cd 17: vcl::SettingsConfigItem::`scalar deleting destructor' - 0x7fff2b861dc0 16: std::default_delete<vcl::SettingsConfigItem>::operator() - 0x7fff2bbfdc38 15: std::unique_ptr<vcl::SettingsConfigItem,std::default_delete<vcl::SettingsConfigItem> >::reset - 0x7fff2bbfeae7 14: DeInitVCL - 0x7fff2bfacd68 13: `anonymous namespace'::Protector::~Protector - 0x7ffffa341357 12: `anonymous namespace'::Protector::`scalar deleting destructor' - 0x7ffffa341520 11: CppUnit::ProtectorChain::pop - 0x7fffcc55dedf 10: CppUnit::TestResult::popProtector - 0x7fffcc52e4e8 9: `anonymous namespace'::ProtectedFixtureFunctor::run - 0x7ff7ee9f0e18 8: main2 - 0x7ff7ee9ef5f9 7: sal_main - 0x7ff7ee9f0e69 6: main - 0x7ff7ee9f1bca 5: invoke_main - 0x7ff7ee9f25e9 4: __scrt_common_main_seh - 0x7ff7ee9f250e 3: __scrt_common_main - 0x7ff7ee9f23ce 2: mainCRTStartup - 0x7ff7ee9f265e 1: BaseThreadInitThunk - 0x7ff8039d7614 0: RtlUserThreadStart - 0x7ff8059826f1 because it called MiscSettings::SetEnableATToolSupport at some point. It seems reasonable to avoid such configuration changes for unit test anyway. Change-Id: I00edc4f6e1183dad66e0504f7d702ad90d7edcd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154134 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--vcl/source/app/settings.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 9921b0b774bc..6a3b2b34cb51 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2721,6 +2721,11 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable )
if( bEnable && !ImplInitAccessBridge() )
return;
+ mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
+
+ if (getenv("LO_TESTNAME") != nullptr)
+ return; // No registry changing; no SettingsConfigItem modification
+
HKEY hkey;
// If the accessibility key in the Windows registry exists, change it synchronously
@@ -2761,7 +2766,6 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable )
setValue( "Accessibility",
"EnableATToolSupport",
bEnable ? OUString("true") : OUString("false" ) );
- mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
}
}
#endif