From 788a7bfdb1981108efbf55bc42a468ca0e8b102e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 10 Sep 2021 15:48:06 -0700 Subject: 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 --- tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'tests') 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("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(&header), sizeof(header)); QByteArray cborValid = [] { QCborMap m; -- cgit v1.2.3