diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-09-29 12:54:38 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-09-29 12:54:38 +0200 |
commit | 050af5600043bf5af0e3d5b2f1f3b7ec25321a2f (patch) | |
tree | 7789c9a869e9d12a5f7e7a8ea533856ace79fe6d /tests | |
parent | 958ce4f308e69eaf53c63a0f7d5ad3033f1c216d (diff) | |
parent | ba672d1334a308b82cd0047a7d5d4ad96ab5388a (diff) |
Merge remote-tracking branch 'origin/6.0'
Change-Id: If773f217a9708ce0ad0b8adeefe3266ba0371a32
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/debugger/tst_offsets.cpp | 27 | ||||
-rw-r--r-- | tests/auto/ssh/tst_ssh.cpp | 16 | ||||
-rw-r--r-- | tests/auto/utils/qtcprocess/tst_qtcprocess.cpp | 9 | ||||
-rw-r--r-- | tests/unit/unittest/unittests-main.cpp | 9 |
4 files changed, 34 insertions, 27 deletions
diff --git a/tests/auto/debugger/tst_offsets.cpp b/tests/auto/debugger/tst_offsets.cpp index 2309b5296a..36beacd8e6 100644 --- a/tests/auto/debugger/tst_offsets.cpp +++ b/tests/auto/debugger/tst_offsets.cpp @@ -157,7 +157,17 @@ void tst_offsets::offsets_data() const int qtVersion = QT_VERSION; const quintptr qtTypeVersion = qtHookData[6]; - if (qtVersion > 0x50600 && qtTypeVersion >= 17) + if (qtTypeVersion >= 20) +#ifdef Q_OS_WIN +# ifdef Q_CC_MSVC + OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; +# else // MinGW + OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; +# endif +#else + OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; +#endif + else if (qtVersion > 0x50600 && qtTypeVersion >= 17) #ifdef Q_OS_WIN # ifdef Q_CC_MSVC OFFSET_TEST(QFilePrivate, fileName) << 164 << 224; @@ -229,13 +239,20 @@ void tst_offsets::offsets_data() OFFSET_TEST(QFileSystemEntry, m_filePath) << 0 << 0; OFFSET_TEST(QFileInfoPrivate, fileEntry) << 4 << 8; - QTest::newRow("sizeof(QObjectData)") << int(sizeof(QObjectData)) - << 28 << 48; // vptr + 3 ptr + 2 int + ptr + // Qt5: vptr + 3 ptr + 2 int + ptr + // Qt6: vptr + objectlist + 8 unit:1 + uint:24 + int + ptr + bindingstorage (+ ptr) + int size32 = qtVersion >= 0x60000 ? 56 : 28; + int size64 = qtVersion >= 0x60000 ? 72 : 48; + if (qtTypeVersion >= 21) { // the additional ptr was introduced with qtTypeVersion 21 + size32 += 4; + size64 += 8; + } + QTest::newRow("sizeof(QObjectData)") << int(sizeof(QObjectData)) << size32 << size64; if (qtVersion >= 0x50000) - OFFSET_TEST(QObjectPrivate, extraData) << 28 << 48; // sizeof(QObjectData) + OFFSET_TEST(QObjectPrivate, extraData) << size32 << size64; // sizeof(QObjectData) else - OFFSET_TEST(QObjectPrivate, extraData) << 32 << 56; // sizeof(QObjectData) + 1 ptr + OFFSET_TEST(QObjectPrivate, extraData) << size32 + 4 << size64 + 8; // sizeof(QObjectData) + 1 ptr #if QT_VERSION < 0x50000 OFFSET_TEST(QObjectPrivate, objectName) << 28 << 48; // sizeof(QObjectData) diff --git a/tests/auto/ssh/tst_ssh.cpp b/tests/auto/ssh/tst_ssh.cpp index d1d53adf7d..a6039f05c1 100644 --- a/tests/auto/ssh/tst_ssh.cpp +++ b/tests/auto/ssh/tst_ssh.cpp @@ -26,15 +26,14 @@ #include <ssh/sftpsession.h> #include <ssh/sftptransfer.h> #include <ssh/sshconnection.h> -#include <ssh/sshconnectionmanager.h> #include <ssh/sshremoteprocessrunner.h> #include <ssh/sshsettings.h> #include <utils/algorithm.h> #include <utils/environment.h> #include <utils/launcherinterface.h> -#include <utils/processreaper.h> #include <utils/qtcprocess.h> +#include <utils/singleton.h> #include <utils/temporarydirectory.h> #include <QDateTime> @@ -134,17 +133,12 @@ private slots: void cleanupTestCase(); private: bool waitForConnection(SshConnection &connection); - - Utils::ProcessReaper *processReaper = nullptr; - SshConnectionManager *sshConnectionManager = nullptr; }; void tst_Ssh::initTestCase() { - processReaper = new Utils::ProcessReaper(); - Utils::LauncherInterface::startLauncher(qApp->applicationDirPath() + '/' - + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); - sshConnectionManager = new SshConnectionManager(); + Utils::LauncherInterface::setPathToLauncher(qApp->applicationDirPath() + '/' + + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); Utils::TemporaryDirectory::setMasterTemporaryDirectory(QDir::tempPath() + "/qtc-ssh-autotest-XXXXXX"); } @@ -647,9 +641,7 @@ void tst_Ssh::sftp() void tst_Ssh::cleanupTestCase() { - delete sshConnectionManager; - Utils::LauncherInterface::stopLauncher(); - delete processReaper; + Utils::Singleton::deleteAll(); } bool tst_Ssh::waitForConnection(SshConnection &connection) diff --git a/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp b/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp index a247e4f963..2ad9eba89d 100644 --- a/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp +++ b/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp @@ -27,8 +27,8 @@ #include <utils/hostosinfo.h> #include <utils/launcherinterface.h> #include <utils/porting.h> -#include <utils/processreaper.h> #include <utils/qtcprocess.h> +#include <utils/singleton.h> #include <utils/stringutils.h> #include <QElapsedTimer> @@ -213,7 +213,6 @@ private slots: private: void iteratorEditsHelper(OsType osType); - Utils::ProcessReaper processReaper; Environment envWindows; Environment envLinux; @@ -225,8 +224,8 @@ private: void tst_QtcProcess::initTestCase() { - Utils::LauncherInterface::startLauncher(qApp->applicationDirPath() + '/' - + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); + Utils::LauncherInterface::setPathToLauncher(qApp->applicationDirPath() + '/' + + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); if (qEnvironmentVariableIsSet(kExitCodeSubProcessCode)) exitCodeSubProcessMain(); if (qEnvironmentVariableIsSet(kRunBlockingStdOutSubProcessWithEndl)) @@ -285,7 +284,7 @@ void tst_QtcProcess::initTestCase() void tst_QtcProcess::cleanupTestCase() { - Utils::LauncherInterface::stopLauncher(); + Utils::Singleton::deleteAll(); } Q_DECLARE_METATYPE(ProcessArgs::SplitError) diff --git a/tests/unit/unittest/unittests-main.cpp b/tests/unit/unittest/unittests-main.cpp index 4d48f2c1dc..a308b2a6a7 100644 --- a/tests/unit/unittest/unittests-main.cpp +++ b/tests/unit/unittest/unittests-main.cpp @@ -30,7 +30,7 @@ #include <sqliteglobal.h> #include <utils/launcherinterface.h> -#include <utils/processreaper.h> +#include <utils/singleton.h> #include <utils/temporarydirectory.h> #include <QGuiApplication> @@ -61,10 +61,8 @@ int main(int argc, char *argv[]) Sqlite::Database::activateLogging(); QGuiApplication application(argc, argv); - Utils::ProcessReaper processReaper; - Utils::LauncherInterface::startLauncher(qApp->applicationDirPath() + '/' - + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); - auto cleanup = qScopeGuard([] { Utils::LauncherInterface::stopLauncher(); }); + Utils::LauncherInterface::setPathToLauncher(qApp->applicationDirPath() + '/' + + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); testing::InitGoogleTest(&argc, argv); #ifdef WITH_BENCHMARKS benchmark::Initialize(&argc, argv); @@ -75,6 +73,7 @@ int main(int argc, char *argv[]) int testsHaveErrors = RUN_ALL_TESTS(); + Utils::Singleton::deleteAll(); #ifdef WITH_BENCHMARKS if (testsHaveErrors == 0 && application.arguments().contains(QStringLiteral("--with-benchmarks"))) benchmark::RunSpecifiedBenchmarks(); |