diff options
-rw-r--r-- | src/corelib/global/qhooks.cpp | 11 | ||||
-rw-r--r-- | src/corelib/global/qhooks_p.h | 1 | ||||
-rw-r--r-- | tests/auto/corelib/global/qhooks/tst_qhooks.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/toolsupport/tst_toolsupport.cpp | 10 |
4 files changed, 22 insertions, 2 deletions
diff --git a/src/corelib/global/qhooks.cpp b/src/corelib/global/qhooks.cpp index 382f45f592..40a7c88f13 100644 --- a/src/corelib/global/qhooks.cpp +++ b/src/corelib/global/qhooks.cpp @@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE // Only add to the end, and bump version if you do. quintptr Q_CORE_EXPORT qtHookData[] = { - 2, // hook data version + 3, // hook data version QHooks::LastHookIndex, // size of qtHookData QT_VERSION, @@ -52,6 +52,15 @@ quintptr Q_CORE_EXPORT qtHookData[] = { 0, // Startup, void(*)(), called once QCoreApplication is operational + 0, + + // TypeInformationVersion, an integral value, bumped whenever private + // object sizes or member offsets that are used in Qt Creator's + // data structure "pretty printing" change. + // + // The required sizes and offsets are tested in tests/auto/other/toolsupport. + // When this fails and the change was intentional, adjust the test and + // adjust this value here. 0 }; diff --git a/src/corelib/global/qhooks_p.h b/src/corelib/global/qhooks_p.h index 12a59a1399..28e0c1ed37 100644 --- a/src/corelib/global/qhooks_p.h +++ b/src/corelib/global/qhooks_p.h @@ -50,6 +50,7 @@ enum HookIndex { AddQObject = 3, RemoveQObject = 4, Startup = 5, + TypeInformationVersion = 6, LastHookIndex }; diff --git a/tests/auto/corelib/global/qhooks/tst_qhooks.cpp b/tests/auto/corelib/global/qhooks/tst_qhooks.cpp index b5930790e4..a38a396a5d 100644 --- a/tests/auto/corelib/global/qhooks/tst_qhooks.cpp +++ b/tests/auto/corelib/global/qhooks/tst_qhooks.cpp @@ -46,7 +46,7 @@ private slots: void tst_QHooks::testVersion() { - QVERIFY(qtHookData[QHooks::HookDataVersion] >= 1); + QVERIFY(qtHookData[QHooks::HookDataVersion] >= 3); QCOMPARE(qtHookData[QHooks::HookDataSize], (quintptr)QHooks::LastHookIndex); QCOMPARE(qtHookData[QHooks::QtVersion], (quintptr)QT_VERSION); } diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index bbd787bf38..a5b85ef221 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -29,6 +29,16 @@ #include <QtTest> +// +// Note: +// +// When this test here fails and the change leading to the failure +// intentionally changed a private class, adjust the test here and bump +// the TypeInformationVersion field in src/corelib/global/qhooks.cpp +// in the same commit as the modification to the private class. +// + + // Don't do this at home. This is test code, not production. #define protected public #define private public |