05fc3aef53
Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
28 lines
696 B
C++
28 lines
696 B
C++
// Copyright (C) 2016 Intel Corporation.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#include <QtDBus/QDBusMessage>
|
|
|
|
#define HAS_HOOKSETUPFUNCTION 1
|
|
static void hookSetupFunction();
|
|
|
|
// Ugly hack, look away
|
|
#include "../qdbusconnection/tst_qdbusconnection.cpp"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
extern Q_DBUS_EXPORT void qDBusAddSpyHook(void (*Hook)(const QDBusMessage&));
|
|
QT_END_NAMESPACE
|
|
|
|
static void hookFunction(const QDBusMessage &)
|
|
{
|
|
// qDebug() << "hook called";
|
|
++tst_QDBusConnection::hookCallCount;
|
|
}
|
|
|
|
static void hookSetupFunction()
|
|
{
|
|
QT_PREPEND_NAMESPACE(qDBusAddSpyHook)(hookFunction);
|
|
}
|
|
|
|
QTEST_MAIN(tst_QDBusConnection_SpyHook)
|