From 735417c859b088855d6246e4d26adf68ddf248b1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 Mar 2023 13:03:47 +0100 Subject: [PATCH] Tests: Enhance offset test Change-Id: I58bc51c4552ab58e303de0fdf3f89cd28b9ff62a Reviewed-by: Reviewed-by: hjk Reviewed-by: David Schulz --- tests/auto/debugger/tst_offsets.cpp | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/auto/debugger/tst_offsets.cpp b/tests/auto/debugger/tst_offsets.cpp index cf428aafe8c..2745c1da24b 100644 --- a/tests/auto/debugger/tst_offsets.cpp +++ b/tests/auto/debugger/tst_offsets.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -52,6 +53,23 @@ OFFSET_ACCESS(QString, QFileSystemEntry, m_filePath); OFFSET_ACCESS(QFileSystemEntry, QFileInfoPrivate, fileEntry); OFFSET_ACCESS(QObjectPrivate::ExtraData*, QObjectPrivate, extraData); +#if QT_VERSION >= 0x60000 +OFFSET_ACCESS(QFileSystemEntry, QDirPrivate, dirEntry); + +#if QT_VERSION < 0x60600 +OFFSET_ACCESS(QStringList, QDirPrivate, files); +OFFSET_ACCESS(QFileInfoList, QDirPrivate, fileInfos); +OFFSET_ACCESS(QFileSystemEntry, QDirPrivate, absoluteDirEntry); +#else +using FileCache = QDirPrivate::FileCache; + +OFFSET_ACCESS(QDirPrivate::FileCache, QDirPrivate, fileCache); +OFFSET_ACCESS(QStringList, FileCache, files); +OFFSET_ACCESS(QFileInfoList, FileCache, fileInfos); +OFFSET_ACCESS(QFileSystemEntry, FileCache, absoluteDirEntry); +#endif +#endif + #if QT_VERSION < 0x50000 OFFSET_ACCESS(QString, QObjectPrivate, objectName); #endif @@ -290,6 +308,21 @@ void tst_offsets::offsets_data() OFFSET_TEST(QDateTimePrivate, m_timeZone) << 20 << 24; #endif +#if QT_VERSION >= 0x60000 +#if QT_VERSION < 0x60600 + OFFSET_TEST(QDirPrivate, dirEntry) << 40 << 96; + OFFSET_TEST(QDirPrivate, files) << 4 << 8; + OFFSET_TEST(QDirPrivate, fileInfos) << 16 << 32; + OFFSET_TEST(QDirPrivate, absoluteDirEntry) << 72 << 152; +#else + OFFSET_TEST(QDirPrivate, fileCache) << 52 << 104; + OFFSET_TEST(QDirPrivate, dirEntry) << 24 << 48; + OFFSET_TEST(FileCache, files) << 4 << 8; + OFFSET_TEST(FileCache, fileInfos) << 16 << 32; + OFFSET_TEST(FileCache, absoluteDirEntry) << 32 << 64; +#endif +#endif + #ifdef HAS_BOOST OFFSET_TEST(Uset, table_) << 0 << 0; OFFSET_TEST(UsetTable, size_) << 8 << 16;