diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-09-10 15:48:06 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-10-04 14:01:34 -0700 |
commit | 788a7bfdb1981108efbf55bc42a468ca0e8b102e (patch) | |
tree | e42ebf168ee4ff3359e9421049d9ea4e9ef6fe80 /tests | |
parent | 2adf444b5e73f1f43ac358581c88917c0eace8e8 (diff) |
QPlugin: move some of the logic from moc's output to qplugin.h
This will allow us to make changes in QtCore itself, without having to
worry about moc compatibility.
The output uses an #ifdef so this version of moc can still be used to
compile earlier versions of Qt (usually, in cross-compilation
environments). See discussion in the mailing list[1].
[1] https://lists.qt-project.org/pipermail/development/2021-September/041732.html
Change-Id: I2de1b4dfacd443148279fffd16a39784c80c5f3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp index 8b221dfc7a..14be0082c7 100644 --- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp +++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2018 Intel Corporation. +** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -138,11 +138,8 @@ void tst_QPlugin::scanInvalidPlugin_data() QTest::addColumn<QString>("errMsg"); // CBOR metadata - QByteArray cprefix = "QTMETADATA !1234"; - cprefix[12] = 0; // current version - cprefix[13] = QT_VERSION_MAJOR; - cprefix[14] = QT_VERSION_MINOR; - cprefix[15] = qPluginArchRequirements(); + static constexpr QPluginMetaData::MagicHeader header = {}; + QByteArray cprefix(reinterpret_cast<const char *>(&header), sizeof(header)); QByteArray cborValid = [] { QCborMap m; |