diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-06-27 12:32:13 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-08-17 23:48:00 +0200 |
commit | 371214dea7f92b3170d0239b3d9944275adf951a (patch) | |
tree | ddaf5695c0c2340004ff098f97705fcf232f7030 /tests/auto/widgets/dialogs | |
parent | 1ee75e47401d0ed4646d4fef7ce8e09eb90f4d5e (diff) |
Remove network dependency for tests with UNC paths
Windows VMs are provisioned with shared folders that are available as
\\${COMPUTERNAME}\testshare(writable)
so we don't need to access a remote SMB server over network anymore just
to test whether our string-parsing code handles UNC paths correctly.
Add a QTest::uncServerName() helper function to the shared filesystem.h
header and use that instead of QtNetworkSettings::winServerName. The
latter is now only used in tst_NetworkSelfTest::smbServer().
Pick-to: 6.4
Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r-- | tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index 6e98eb06ac..f8dc03ac22 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -35,9 +35,7 @@ #include <qpa/qplatformdialoghelper.h> #include <qpa/qplatformintegration.h> -#if defined(Q_OS_WIN) -#include "../../../network-settings.h" -#endif +#include "../../../../shared/filesystem.h" #if defined QT_BUILD_INTERNAL QT_BEGIN_NAMESPACE @@ -256,7 +254,7 @@ void tst_QFileDialog2::unc() { #if defined(Q_OS_WIN) // Only test UNC on Windows./ - QString dir("\\\\" + QtNetworkSettings::winServerName() + "\\testsharewritable"); + QString dir("\\\\" + QTest::uncServerName() + "\\testsharewritable"); #else QString dir(QDir::currentPath()); #endif |